Class RequestHandledEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.web.context.support.RequestHandledEvent
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- ServletRequestHandledEvent
Event raised when a request is handled within an ApplicationContext.
 
Supported by Spring's own FrameworkServlet (through a specific ServletRequestHandledEvent subclass), but can also be raised by any other web component.
- Since:
- January 17, 2001
- Author:
- Rod Johnson, Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class java.util.EventObjectsource
- 
Constructor SummaryConstructorsConstructorDescriptionRequestHandledEvent(Object source, String sessionId, String userName, long processingTimeMillis) Create a new RequestHandledEvent with session information.RequestHandledEvent(Object source, String sessionId, String userName, long processingTimeMillis, Throwable failureCause) Create a new RequestHandledEvent with session information.
- 
Method SummaryModifier and TypeMethodDescriptionReturn a full description of this event, involving all available context data.Return the cause of failure, if any.longReturn the processing time of the request in milliseconds.Return the id of the HTTP session, if any.Return a short description of this event, only involving the most important context data.Return the name of the user that was associated with the request (usually the UserPrincipal).toString()booleanReturn whether the request failed.Methods inherited from class org.springframework.context.ApplicationEventgetTimestampMethods inherited from class java.util.EventObjectgetSource
- 
Constructor Details- 
RequestHandledEventpublic RequestHandledEvent(Object source, @Nullable String sessionId, @Nullable String userName, long processingTimeMillis) Create a new RequestHandledEvent with session information.- Parameters:
- source- the component that published the event
- sessionId- the id of the HTTP session, if any
- userName- the name of the user that was associated with the request, if any (usually the UserPrincipal)
- processingTimeMillis- the processing time of the request in milliseconds
 
- 
RequestHandledEventpublic RequestHandledEvent(Object source, @Nullable String sessionId, @Nullable String userName, long processingTimeMillis, @Nullable Throwable failureCause) Create a new RequestHandledEvent with session information.- Parameters:
- source- the component that published the event
- sessionId- the id of the HTTP session, if any
- userName- the name of the user that was associated with the request, if any (usually the UserPrincipal)
- processingTimeMillis- the processing time of the request in milliseconds
- failureCause- the cause of failure, if any
 
 
- 
- 
Method Details- 
getProcessingTimeMillispublic long getProcessingTimeMillis()Return the processing time of the request in milliseconds.
- 
getSessionIdReturn the id of the HTTP session, if any.
- 
getUserNameReturn the name of the user that was associated with the request (usually the UserPrincipal).- See Also:
 
- 
wasFailurepublic boolean wasFailure()Return whether the request failed.
- 
getFailureCauseReturn the cause of failure, if any.
- 
getShortDescriptionReturn a short description of this event, only involving the most important context data.
- 
getDescriptionReturn a full description of this event, involving all available context data.
- 
toString- Overrides:
- toStringin class- EventObject
 
 
-