01: /*
02: * Copyright 2002-2007 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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 handler;
30:
31: private HandlerInterceptor[] interceptors;
32:
33: /**
34: * Create a new HandlerExecutionChain.
35: * @param handler the handler object to execute
36: */
37: public HandlerExecutionChain(Object handler) {
38: this .handler = handler;
39: }
40:
41: /**
42: * Create a new HandlerExecutionChain.
43: * @param handler the handler object to execute
44: * @param interceptors the array of interceptors to apply
45: * (in the given order) before the handler itself executes
46: */
47: public HandlerExecutionChain(Object handler,
48: HandlerInterceptor[] interceptors) {
49: this .handler = handler;
50: this .interceptors = interceptors;
51: }
52:
53: /**
54: * Return the handler object to execute.
55: * @return the handler object (never <code>null</code>)
56: */
57: public Object getHandler() {
58: return this .handler;
59: }
60:
61: /**
62: * Return the array of interceptors to apply (in the given order).
63: * @return the array of HandlerInterceptors instances (may be <code>null</code>)
64: */
65: public HandlerInterceptor[] getInterceptors() {
66: return this.interceptors;
67: }
68:
69: }
|