spring-framework / org.springframework.web.context.support / RequestHandledEvent

RequestHandledEvent

open class RequestHandledEvent : ApplicationEvent

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. Used, for example, by Spring's out-of-the-box PerformanceMonitorListener.

Author
Rod Johnson

Author
Juergen Hoeller

Since
January 17, 2001

See Also
ServletRequestHandledEventorg.springframework.web.servlet.FrameworkServletorg.springframework.context.ApplicationContext#publishEvent

Constructors

<init>

RequestHandledEvent(source: Any, sessionId: String, userName: String, processingTimeMillis: Long)
RequestHandledEvent(source: Any, sessionId: String, userName: String, processingTimeMillis: Long, failureCause: Throwable)

Create a new RequestHandledEvent with session information.

Functions

getDescription

open fun getDescription(): String

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

getFailureCause

open fun getFailureCause(): Throwable

Return the cause of failure, if any.

getProcessingTimeMillis

open fun getProcessingTimeMillis(): Long

Return the processing time of the request in milliseconds.

getSessionId

open fun getSessionId(): String

Return the id of the HTTP session, if any.

getShortDescription

open fun getShortDescription(): String

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

getUserName

open fun getUserName(): String

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

toString

open fun toString(): String

wasFailure

open fun wasFailure(): Boolean

Return whether the request failed.

Inheritors

ServletRequestHandledEvent

open class ServletRequestHandledEvent : RequestHandledEvent

Servlet-specific subclass of RequestHandledEvent, adding servlet-specific context information.