org.springframework.web.context.support
Class RequestHandledEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.springframework.context.ApplicationEvent
          extended by org.springframework.web.context.support.RequestHandledEvent
All Implemented Interfaces:
Serializable

public class RequestHandledEvent
extends ApplicationEvent

Event raised when a request is handled within a WebApplicationContext. Supported by Spring's own FrameworkServlet, but can also be raised by any other web component.

Since:
January 17, 2001
Author:
Rod Johnson, Juergen Hoeller
See Also:
FrameworkServlet, Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
RequestHandledEvent(Object source, String requestUrl, long processingTimeMillis, String clientAddress, String method, String servletName)
          Create a new RequestHandledEvent.
RequestHandledEvent(Object source, String requestUrl, long processingTimeMillis, String clientAddress, String method, String servletName, String sessionId, String userName)
          Create a new RequestHandledEvent with session information.
RequestHandledEvent(Object source, String requestUrl, long processingTimeMillis, String clientAddress, String method, String servletName, String sessionId, String userName, Throwable failureCause)
          Create a new RequestHandledEvent with session information.
RequestHandledEvent(Object source, String requestUrl, long processingTimeMillis, String clientAddress, String method, String servletName, Throwable failureCause)
          Create a new RequestHandledEvent.
 
Method Summary
 String getClientAddress()
          Return the IP address that the request came from.
 Throwable getFailureCause()
          Return the cause of failure, if any.
 String getMethod()
          Return the HTTP method of the request (usually GET or POST).
 long getProcessingTimeMillis()
          Return the processing time of the request in milliseconds.
 String getRequestUrl()
          Return the URL of the request.
 String getServletName()
          Return the name of the servlet that handled the request.
 String getSessionId()
          Return the id of the HTTP session, if any.
 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.
 
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RequestHandledEvent

public RequestHandledEvent(Object source,
                           String requestUrl,
                           long processingTimeMillis,
                           String clientAddress,
                           String method,
                           String servletName)
Create a new RequestHandledEvent.

Parameters:
source - the component that published the event
requestUrl - the URL of the request
processingTimeMillis - the processing time of the request in milliseconds
clientAddress - the IP address that the request came from
method - the HTTP method of the request (usually GET or POST)
servletName - the name of the servlet that handled the request

RequestHandledEvent

public RequestHandledEvent(Object source,
                           String requestUrl,
                           long processingTimeMillis,
                           String clientAddress,
                           String method,
                           String servletName,
                           Throwable failureCause)
Create a new RequestHandledEvent.

Parameters:
source - the component that published the event
requestUrl - the URL of the request
processingTimeMillis - the processing time of the request in milliseconds
clientAddress - the IP address that the request came from
method - the HTTP method of the request (usually GET or POST)
servletName - the name of the servlet that handled the request
failureCause - the cause of failure, if any

RequestHandledEvent

public RequestHandledEvent(Object source,
                           String requestUrl,
                           long processingTimeMillis,
                           String clientAddress,
                           String method,
                           String servletName,
                           String sessionId,
                           String userName)
Create a new RequestHandledEvent with session information.

Parameters:
source - the component that published the event
requestUrl - the URL of the request
processingTimeMillis - the processing time of the request in milliseconds
clientAddress - the IP address that the request came from
method - the HTTP method of the request (usually GET or POST)
servletName - the name of the servlet that handled the request
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)

RequestHandledEvent

public RequestHandledEvent(Object source,
                           String requestUrl,
                           long processingTimeMillis,
                           String clientAddress,
                           String method,
                           String servletName,
                           String sessionId,
                           String userName,
                           Throwable failureCause)
Create a new RequestHandledEvent with session information.

Parameters:
source - the component that published the event
requestUrl - the URL of the request
processingTimeMillis - the processing time of the request in milliseconds
clientAddress - the IP address that the request came from
method - the HTTP method of the request (usually GET or POST)
servletName - the name of the servlet that handled the request
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)
failureCause - the cause of failure, if any
Method Detail

getRequestUrl

public String getRequestUrl()
Return the URL of the request.


getProcessingTimeMillis

public long getProcessingTimeMillis()
Return the processing time of the request in milliseconds.


getClientAddress

public String getClientAddress()
Return the IP address that the request came from.


getMethod

public String getMethod()
Return the HTTP method of the request (usually GET or POST).


getServletName

public String getServletName()
Return the name of the servlet that handled the request.


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).

See Also:
HttpServletRequest.getUserPrincipal()

wasFailure

public boolean wasFailure()
Return whether the request failed.


getFailureCause

public Throwable getFailureCause()
Return the cause of failure, if any.


toString

public String toString()
Overrides:
toString in class EventObject


Copyright (c) 2002-2006 The Spring Framework Project.