Class DelegatingHandlerMethodAdvice
java.lang.Object
io.microsphere.spring.context.event.OnceApplicationContextEventListener<org.springframework.context.event.ContextRefreshedEvent>
io.microsphere.spring.web.method.support.DelegatingHandlerMethodAdvice
- All Implemented Interfaces:
HandlerMethodAdvice
,EventListener
,org.springframework.beans.factory.Aware
,org.springframework.context.ApplicationContextAware
,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
public class DelegatingHandlerMethodAdvice
extends OnceApplicationContextEventListener<org.springframework.context.event.ContextRefreshedEvent>
implements HandlerMethodAdvice
HandlerMethodAdvice
class delegates to the beans of HandlerMethodArgumentInterceptor
and
HandlerMethodInterceptor
.- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterExecuteMethod
(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, Object returnValue, Throwable error, org.springframework.web.context.request.NativeWebRequest request) Interception point after successful execution of aHandlerMethod
.void
afterResolveArgument
(org.springframework.core.MethodParameter parameter, Object resolvedArgument, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) callback after theMethodParameter
being resolvedvoid
beforeExecuteMethod
(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request) Interception point before the execution of aHandlerMethod
.void
beforeResolveArgument
(org.springframework.core.MethodParameter parameter, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) callback before theMethodParameter
being resolvedprotected void
onApplicationContextEvent
(org.springframework.context.event.ContextRefreshedEvent event) Methods inherited from class io.microsphere.spring.context.event.OnceApplicationContextEventListener
getApplicationContext, onApplicationEvent, setApplicationContext
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
BEAN_NAME
- See Also:
-
-
Constructor Details
-
DelegatingHandlerMethodAdvice
public DelegatingHandlerMethodAdvice()
-
-
Method Details
-
onApplicationContextEvent
protected void onApplicationContextEvent(org.springframework.context.event.ContextRefreshedEvent event) - Specified by:
onApplicationContextEvent
in classOnceApplicationContextEventListener<org.springframework.context.event.ContextRefreshedEvent>
-
beforeResolveArgument
public void beforeResolveArgument(org.springframework.core.MethodParameter parameter, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception Description copied from interface:HandlerMethodAdvice
callback before theMethodParameter
being resolved- Specified by:
beforeResolveArgument
in interfaceHandlerMethodAdvice
- Parameters:
parameter
- the method parameter to resolve.handlerMethod
- the method to handlewebRequest
- the current request- Throws:
Exception
- in case of errors with the preparation of argument values
-
afterResolveArgument
public void afterResolveArgument(org.springframework.core.MethodParameter parameter, Object resolvedArgument, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) throws Exception Description copied from interface:HandlerMethodAdvice
callback after theMethodParameter
being resolved- Specified by:
afterResolveArgument
in interfaceHandlerMethodAdvice
- Parameters:
parameter
- the method parameter to resolve.resolvedArgument
- the resolved argumenthandlerMethod
- the method to handlewebRequest
- the current request- Throws:
Exception
- in case of errors with the preparation of argument values
-
beforeExecuteMethod
public void beforeExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request) throws Exception Description copied from interface:HandlerMethodAdvice
Interception point before the execution of aHandlerMethod
. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.- Specified by:
beforeExecuteMethod
in interfaceHandlerMethodAdvice
- Parameters:
handlerMethod
-HandlerMethod
args
- the resolved arguments ofHandlerMethod
request
-WebRequest
- Throws:
Exception
- if any error caused
-
afterExecuteMethod
public void afterExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, Object returnValue, Throwable error, org.springframework.web.context.request.NativeWebRequest request) throws Exception Description copied from interface:HandlerMethodAdvice
Interception point after successful execution of aHandlerMethod
. Called after HandlerAdapter actually invoked the handler.- Specified by:
afterExecuteMethod
in interfaceHandlerMethodAdvice
- Parameters:
handlerMethod
-HandlerMethod
args
- the resolved arguments ofHandlerMethod
returnValue
- the return value ofHandlerMethod
error
- the error afterHandlerMethod
invocationrequest
-WebRequest
- Throws:
Exception
- if any error caused
-