Top Description Fields Constructors Methods
org.springframework.web.context.support

public Class RequestHandledEvent

extends ApplicationEvent
Class Inheritance
Known Direct Subclasses
org.springframework.web.context.support.ServletRequestHandledEvent
Annotations
@SuppressWarnings:serial
Imports
org.springframework.context.ApplicationEvent, org.springframework.lang.Nullable

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.

Authors
Rod Johnson, Juergen Hoeller
Since
January 17, 2001
See Also
ServletRequestHandledEvent, org.springframework.web.servlet.FrameworkServlet, org.springframework.context.ApplicationContext#publishEvent

Field Summary

Modifier and TypeField and Description
private Throwable
failureCause

Cause of failure, if any.

private final long
processingTimeMillis

Request processing time.

private final String
sessionId

Session id that applied to the request, if any.

private final String
userName

Usually the UserPrincipal.

Constructor Summary

AccessConstructor and Description
public
RequestHandledEvent(Object
the component that published the event
source
,
String
the id of the HTTP session, if any
sessionId
,
String
the name of the user that was associated with the request, if any (usually the UserPrincipal)
userName
,
long
the processing time of the request in milliseconds
processingTimeMillis
)

Create a new RequestHandledEvent with session information.

public
RequestHandledEvent(Object
the component that published the event
source
,
String
the id of the HTTP session, if any
sessionId
,
String
the name of the user that was associated with the request, if any (usually the UserPrincipal)
userName
,
long
the processing time of the request in milliseconds
processingTimeMillis
,
Throwable
the cause of failure, if any
failureCause
)

Create a new RequestHandledEvent with session information.

Method Summary

Modifier and TypeMethod and Description
public String
getDescription()

Return a full description of this event, involving all available context data.

public Throwable
getFailureCause()

Return the cause of failure, if any.

public long
getProcessingTimeMillis()

Return the processing time of the request in milliseconds.

public String
getSessionId()

Return the id of the HTTP session, if any.

public String
getShortDescription()

Return a short description of this event, only involving the most important context data.

public String
getUserName()

Return the name of the user that was associated with the request (usually the UserPrincipal).

public String
toString()

Overrides java.util.EventObject.toString.

Returns a String representation of this EventObject.

public boolean
wasFailure()

Return whether the request failed.

Inherited from org.springframework.context.ApplicationEvent:
getTimestamp

Field Detail

failureCauseback to summary
private Throwable failureCause

Cause of failure, if any.

Annotations
@Nullable
processingTimeMillisback to summary
private final long processingTimeMillis

Request processing time.

sessionIdback to summary
private final String sessionId

Session id that applied to the request, if any.

Annotations
@Nullable
userNameback to summary
private final String userName

Usually the UserPrincipal.

Annotations
@Nullable

Constructor Detail

RequestHandledEventback to summary
public RequestHandledEvent(Object source, String sessionId, String userName, long processingTimeMillis)

Create a new RequestHandledEvent with session information.

Parameters
source:Object

the component that published the event

sessionId:String

the id of the HTTP session, if any

userName:String

the name of the user that was associated with the request, if any (usually the UserPrincipal)

processingTimeMillis:long

the processing time of the request in milliseconds

RequestHandledEventback to summary
public RequestHandledEvent(Object source, String sessionId, String userName, long processingTimeMillis, Throwable failureCause)

Create a new RequestHandledEvent with session information.

Parameters
source:Object

the component that published the event

sessionId:String

the id of the HTTP session, if any

userName:String

the name of the user that was associated with the request, if any (usually the UserPrincipal)

processingTimeMillis:long

the processing time of the request in milliseconds

failureCause:Throwable

the cause of failure, if any

Method Detail

getDescriptionback to summary
public String getDescription()

Return a full description of this event, involving all available context data.

getFailureCauseback to summary
public Throwable getFailureCause()

Return the cause of failure, if any.

Annotations
@Nullable
getProcessingTimeMillisback to summary
public long getProcessingTimeMillis()

Return the processing time of the request in milliseconds.

getSessionIdback to summary
public String getSessionId()

Return the id of the HTTP session, if any.

Annotations
@Nullable
getShortDescriptionback to summary
public String getShortDescription()

Return a short description of this event, only involving the most important context data.

getUserNameback to summary
public String getUserName()

Return the name of the user that was associated with the request (usually the UserPrincipal).

Annotations
@Nullable
See Also
jakarta.servlet.http.HttpServletRequest#getUserPrincipal()
toStringback to summary
public String toString()

Overrides java.util.EventObject.toString.

Doc from java.util.EventObject.toString.

Returns a String representation of this EventObject.

Returns:String

a String representation of this EventObject

Annotations
@Override
wasFailureback to summary
public boolean wasFailure()

Return whether the request failed.