类 RequestHandledEvent
- java.lang.Object
- java.util.EventObject
- org.springframework.context.ApplicationEvent
- org.springframework.web.context.support.RequestHandledEvent
- 所有已实现的接口:
Serializable
public class RequestHandledEvent extends 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.
- 从以下版本开始:
- January 17, 2001
- 作者:
- Rod Johnson, Juergen Hoeller
- 另请参阅:
ServletRequestHandledEvent
,FrameworkServlet
,ApplicationEventPublisher.publishEvent(org.springframework.context.ApplicationEvent)
, 序列化表格
字段概要
从类继承的字段 java.util.EventObject
source
构造器概要
构造器 构造器 说明 RequestHandledEvent(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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String
getDescription()
Return a full description of this event, involving all available context data.Throwable
getFailureCause()
Return the cause of failure, if any.long
getProcessingTimeMillis()
Return the processing time of the request in milliseconds.String
getSessionId()
Return the id of the HTTP session, if any.String
getShortDescription()
Return a short description of this event, only involving the most important context data.String
getUserName()
Return the name of the user that was associated with the request (usually the UserPrincipal).String
toString()
boolean
wasFailure()
Return whether the request failed.从类继承的方法 org.springframework.context.ApplicationEvent
getTimestamp
从类继承的方法 java.util.EventObject
getSource
构造器详细资料
RequestHandledEvent
public RequestHandledEvent(Object source, String sessionId, String userName, long processingTimeMillis)
Create a new RequestHandledEvent with session information.- 参数:
source
- the component that published the eventsessionId
- the id of the HTTP session, if anyuserName
- 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
RequestHandledEvent
public RequestHandledEvent(Object source, String sessionId, String userName, long processingTimeMillis, Throwable failureCause)
Create a new RequestHandledEvent with session information.- 参数:
source
- the component that published the eventsessionId
- the id of the HTTP session, if anyuserName
- the name of the user that was associated with the request, if any (usually the UserPrincipal)processingTimeMillis
- the processing time of the request in millisecondsfailureCause
- the cause of failure, if any
方法详细资料
getProcessingTimeMillis
public long getProcessingTimeMillis()
Return the processing time of the request in milliseconds.
getSessionId
public String getSessionId()
Return the id of the HTTP session, if any.
getUserName
public String getUserName()
Return the name of the user that was associated with the request (usually the UserPrincipal).
wasFailure
public boolean wasFailure()
Return whether the request failed.
getFailureCause
public Throwable getFailureCause()
Return the cause of failure, if any.
getShortDescription
public String getShortDescription()
Return a short description of this event, only involving the most important context data.
getDescription
public String getDescription()
Return a full description of this event, involving all available context data.
toString
public String toString()
- 覆盖:
toString
在类中EventObject