public class HandlerExecutionChain
extends java.lang.Object
HandlerMapping.getHandler(HttpServletRequest)
method.HandlerInterceptor
Modifier and Type | Field and Description |
---|---|
private java.lang.Object |
handler |
private int |
interceptorIndex |
private java.util.List<HandlerInterceptor> |
interceptorList |
private HandlerInterceptor[] |
interceptors |
private static Log |
logger |
Constructor and Description |
---|
HandlerExecutionChain(java.lang.Object handler)
Create a new HandlerExecutionChain.
|
HandlerExecutionChain(java.lang.Object handler,
HandlerInterceptor... interceptors)
Create a new HandlerExecutionChain.
|
Modifier and Type | Method and Description |
---|---|
void |
addInterceptor(HandlerInterceptor interceptor) |
void |
addInterceptor(int index,
HandlerInterceptor interceptor) |
void |
addInterceptors(HandlerInterceptor... interceptors) |
(package private) void |
applyAfterConcurrentHandlingStarted(HttpServletRequest request,
HttpServletResponse response)
Apply afterConcurrentHandlerStarted callback on mapped AsyncHandlerInterceptors.
|
(package private) void |
applyPostHandle(HttpServletRequest request,
HttpServletResponse response,
ModelAndView mv)
Apply postHandle methods of registered interceptors.
|
(package private) boolean |
applyPreHandle(HttpServletRequest request,
HttpServletResponse response)
Apply preHandle methods of registered interceptors.
|
java.lang.Object |
getHandler()
Return the handler object to execute.
|
HandlerInterceptor[] |
getInterceptors()
Return the array of interceptors to apply (in the given order).
|
private java.util.List<HandlerInterceptor> |
initInterceptorList() |
java.lang.String |
toString()
Delegates to the handler and interceptors'
toString() . |
(package private) void |
triggerAfterCompletion(HttpServletRequest request,
HttpServletResponse response,
java.lang.Exception ex)
Trigger afterCompletion callbacks on the mapped HandlerInterceptors.
|
private static final Log logger
private final java.lang.Object handler
@Nullable private HandlerInterceptor[] interceptors
@Nullable private java.util.List<HandlerInterceptor> interceptorList
private int interceptorIndex
public HandlerExecutionChain(java.lang.Object handler)
handler
- the handler object to executepublic HandlerExecutionChain(java.lang.Object handler, @Nullable HandlerInterceptor... interceptors)
handler
- the handler object to executeinterceptors
- the array of interceptors to apply
(in the given order) before the handler itself executespublic java.lang.Object getHandler()
public void addInterceptor(HandlerInterceptor interceptor)
public void addInterceptor(int index, HandlerInterceptor interceptor)
public void addInterceptors(HandlerInterceptor... interceptors)
private java.util.List<HandlerInterceptor> initInterceptorList()
@Nullable public HandlerInterceptor[] getInterceptors()
null
)boolean applyPreHandle(HttpServletRequest request, HttpServletResponse response) throws java.lang.Exception
true
if the execution chain should proceed with the
next interceptor or the handler itself. Else, DispatcherServlet assumes
that this interceptor has already dealt with the response itself.java.lang.Exception
void applyPostHandle(HttpServletRequest request, HttpServletResponse response, @Nullable ModelAndView mv) throws java.lang.Exception
java.lang.Exception
void triggerAfterCompletion(HttpServletRequest request, HttpServletResponse response, @Nullable java.lang.Exception ex) throws java.lang.Exception
java.lang.Exception
void applyAfterConcurrentHandlingStarted(HttpServletRequest request, HttpServletResponse response)
public java.lang.String toString()
toString()
.toString
in class java.lang.Object