KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > portlet > HandlerExecutionChain


1 /*
2  * Copyright 2002-2007 the original author or authors.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.springframework.web.portlet;
18
19 /**
20  * Handler execution chain, consisting of handler object and any handler interceptors.
21  * Returned by HandlerMapping's {@link HandlerMapping#getHandler} method.
22  *
23  * @author Juergen Hoeller
24  * @author John A. Lewis
25  * @since 2.0
26  * @see HandlerInterceptor
27  */

28 public class HandlerExecutionChain {
29
30     private Object JavaDoc handler;
31
32     private HandlerInterceptor[] interceptors;
33
34
35     /**
36      * Create a new HandlerExecutionChain.
37      * @param handler the handler object to execute
38      */

39     public HandlerExecutionChain(Object JavaDoc handler) {
40         this.handler = handler;
41     }
42
43     /**
44      * Create a new HandlerExecutionChain.
45      * @param handler the handler object to execute
46      * @param interceptors the array of interceptors to apply
47      * (in the given order) before the handler itself executes
48      */

49     public HandlerExecutionChain(Object JavaDoc handler, HandlerInterceptor[] interceptors) {
50         this.handler = handler;
51         this.interceptors = interceptors;
52     }
53
54
55     /**
56      * Return the handler object to execute.
57      * @return the handler object (never <code>null</code>)
58      */

59     public Object JavaDoc getHandler() {
60         return this.handler;
61     }
62
63     /**
64      * Return the array of interceptors to apply (in the given order).
65      * @return the array of HandlerInterceptors instances (may be <code>null</code>)
66      */

67     public HandlerInterceptor[] getInterceptors() {
68         return this.interceptors;
69     }
70
71 }
72
Popular Tags