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.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 handler;
31:
32: private HandlerInterceptor[] interceptors;
33:
34: /**
35: * Create a new HandlerExecutionChain.
36: * @param handler the handler object to execute
37: */
38: public HandlerExecutionChain(Object 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 handler,
49: HandlerInterceptor[] interceptors) {
50: this .handler = handler;
51: this .interceptors = interceptors;
52: }
53:
54: /**
55: * Return the handler object to execute.
56: * @return the handler object (never <code>null</code>)
57: */
58: public Object 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: }
|