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 io.microsphere.spring.context.event.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 TypeMethodDescriptionvoidafterExecuteMethod(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.voidafterResolveArgument(org.springframework.core.MethodParameter parameter, Object resolvedArgument, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) callback after theMethodParameterbeing resolvedvoidbeforeExecuteMethod(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request) Interception point before the execution of aHandlerMethod.voidbeforeResolveArgument(org.springframework.core.MethodParameter parameter, org.springframework.web.method.HandlerMethod handlerMethod, org.springframework.web.context.request.NativeWebRequest webRequest) callback before theMethodParameterbeing resolvedprotected voidonApplicationContextEvent(org.springframework.context.event.ContextRefreshedEvent event) Methods inherited from class io.microsphere.spring.context.event.OnceApplicationContextEventListener
getApplicationContext, onApplicationEvent, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
onApplicationContextEventin classio.microsphere.spring.context.event.OnceApplicationContextEventListener<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:HandlerMethodAdvicecallback before theMethodParameterbeing resolved- Specified by:
beforeResolveArgumentin 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:HandlerMethodAdvicecallback after theMethodParameterbeing resolved- Specified by:
afterResolveArgumentin 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:HandlerMethodAdviceInterception point before the execution of aHandlerMethod. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.- Specified by:
beforeExecuteMethodin interfaceHandlerMethodAdvice- Parameters:
handlerMethod-HandlerMethodargs- the resolved arguments ofHandlerMethodrequest-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:HandlerMethodAdviceInterception point after successful execution of aHandlerMethod. Called after HandlerAdapter actually invoked the handler.- Specified by:
afterExecuteMethodin interfaceHandlerMethodAdvice- Parameters:
handlerMethod-HandlerMethodargs- the resolved arguments ofHandlerMethodreturnValue- the return value ofHandlerMethoderror- the error afterHandlerMethodinvocationrequest-WebRequest- Throws:
Exception- if any error caused
-