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
The class publishes the Spring Web extension events:
- Since:
- 1.0.0
- Author:
- Mercy
- See Also:
-
Field Summary
FieldsFields inherited from class io.microsphere.spring.context.lifecycle.AbstractSmartLifecycle
EARLIEST_PHASE, LATEST_PHASE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterExecute
(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
beforeExecute
(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request) Interception point before the execution of aHandlerMethod
.protected void
doStart()
protected void
doStop()
Methods inherited from class io.microsphere.spring.context.lifecycle.AbstractSmartLifecycle
getPhase, isAutoStartup, isRunning, isStarted, setPhase, setStarted, start, stop, stop
-
Field Details
-
DEFAULT_PHASE
public static final int DEFAULT_PHASE- See Also:
-
-
Constructor Details
-
WebEventPublisher
public WebEventPublisher(org.springframework.context.ApplicationContext context)
-
-
Method Details
-
beforeExecute
public void beforeExecute(org.springframework.web.method.HandlerMethod handlerMethod, Object[] args, org.springframework.web.context.request.NativeWebRequest request) throws Exception Description copied from interface:HandlerMethodInterceptor
Interception point before the execution of aHandlerMethod
. Called after HandlerMapping determined an appropriate handler object, but before HandlerAdapter invokes the handler.- Specified by:
beforeExecute
in interfaceHandlerMethodInterceptor
- Parameters:
handlerMethod
-HandlerMethod
args
- the resolved arguments ofHandlerMethod
request
-WebRequest
- Throws:
Exception
- if any error caused
-
afterExecute
public void afterExecute(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:HandlerMethodInterceptor
Interception point after successful execution of aHandlerMethod
. Called after HandlerAdapter actually invoked the handler.- Specified by:
afterExecute
in interfaceHandlerMethodInterceptor
- 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
-
doStart
protected void doStart()- Specified by:
doStart
in classAbstractSmartLifecycle
-
doStop
protected void doStop()- Specified by:
doStop
in classAbstractSmartLifecycle
-