KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > springframework > web > servlet > 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.servlet;
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  * @since 20.06.2003
25  * @see HandlerInterceptor
26  */

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

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

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

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

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