Package io.microsphere.spring.web.event
Class WebEventPublisher
- java.lang.Object
-
- io.microsphere.spring.context.lifecycle.AbstractSmartLifecycle
-
- io.microsphere.spring.web.event.WebEventPublisher
-
- All Implemented Interfaces:
HandlerMethodInterceptor,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle
public class WebEventPublisher extends AbstractSmartLifecycle implements HandlerMethodInterceptor
The class publishes the Spring Web extension events:- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
HandlerMethodArgumentsResolvedEvent
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_PHASE-
Fields inherited from class io.microsphere.spring.context.lifecycle.AbstractSmartLifecycle
EARLIEST_PHASE, LATEST_PHASE
-
-
Constructor Summary
Constructors Constructor Description WebEventPublisher(org.springframework.context.ApplicationContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterExecute(org.springframework.web.method.HandlerMethod handlerMethod, java.lang.Object[] args, java.lang.Object returnValue, java.lang.Throwable error, org.springframework.web.context.request.NativeWebRequest request)Interception point after successful execution of aHandlerMethod.voidbeforeExecute(org.springframework.web.method.HandlerMethod handlerMethod, java.lang.Object[] args, org.springframework.web.context.request.NativeWebRequest request)Interception point before the execution of aHandlerMethod.protected voiddoStart()protected voiddoStop()-
Methods inherited from class io.microsphere.spring.context.lifecycle.AbstractSmartLifecycle
getPhase, isAutoStartup, isRunning, isStarted, setPhase, setStarted, start, stop, stop
-
-
-
-
Field Detail
-
DEFAULT_PHASE
public static final int DEFAULT_PHASE
- See Also:
- Constant Field Values
-
-
Method Detail
-
beforeExecute
public void beforeExecute(org.springframework.web.method.HandlerMethod handlerMethod, java.lang.Object[] args, org.springframework.web.context.request.NativeWebRequest request) throws java.lang.ExceptionDescription copied from interface:HandlerMethodInterceptorInterception point before the execution of aHandlerMethod. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.- Specified by:
beforeExecutein interfaceHandlerMethodInterceptor- Parameters:
handlerMethod-HandlerMethodargs- the resolved arguments ofHandlerMethodrequest-WebRequest- Throws:
java.lang.Exception- if any error caused
-
afterExecute
public void afterExecute(org.springframework.web.method.HandlerMethod handlerMethod, java.lang.Object[] args, java.lang.Object returnValue, java.lang.Throwable error, org.springframework.web.context.request.NativeWebRequest request) throws java.lang.ExceptionDescription copied from interface:HandlerMethodInterceptorInterception point after successful execution of aHandlerMethod. Called after HandlerAdapter actually invoked the handler.- Specified by:
afterExecutein interfaceHandlerMethodInterceptor- Parameters:
handlerMethod-HandlerMethodargs- the resolved arguments ofHandlerMethodreturnValue- the return value ofHandlerMethoderror- the error afterHandlerMethodinvocationrequest-WebRequest- Throws:
java.lang.Exception- if any error caused
-
doStart
protected void doStart()
- Specified by:
doStartin classAbstractSmartLifecycle
-
doStop
protected void doStop()
- Specified by:
doStopin classAbstractSmartLifecycle
-
-