FileDocCategorySizeDatePackage
InstanceEvent.javaAPI DocApache Tomcat 6.0.1413997Fri Jul 20 04:20:30 BST 2007org.apache.catalina

InstanceEvent

public final class InstanceEvent extends EventObject
General event for notifying listeners of significant events related to a specific instance of a Servlet, or a specific instance of a Filter, as opposed to the Wrapper component that manages it.
author
Craig R. McClanahan
version
$Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
public static final String
BEFORE_INIT_EVENT
The event indicating that the init() method is about to be called for this instance.
public static final String
AFTER_INIT_EVENT
The event indicating that the init() method has returned.
public static final String
BEFORE_SERVICE_EVENT
The event indicating that the service() method is about to be called on a servlet. The servlet property contains the servlet being called, and the request and response properties contain the current request and response being processed.
public static final String
AFTER_SERVICE_EVENT
The event indicating that the service() method has returned. The servlet property contains the servlet that was called, and the request and response properties contain the current request and response being processed.
public static final String
BEFORE_DESTROY_EVENT
The event indicating that the destroy method is about to be called for this instance.
public static final String
AFTER_DESTROY_EVENT
The event indicating that the destroy() method has returned.
public static final String
BEFORE_DISPATCH_EVENT
The event indicating that the service() method of a servlet accessed via a request dispatcher is about to be called. The servlet property contains a reference to the dispatched-to servlet instance, and the request and response properties contain the current request and response being processed. The wrapper property will contain a reference to the dispatched-to Wrapper.
public static final String
AFTER_DISPATCH_EVENT
The event indicating that the service() method of a servlet accessed via a request dispatcher has returned. The servlet property contains a reference to the dispatched-to servlet instance, and the request and response properties contain the current request and response being processed. The wrapper property will contain a reference to the dispatched-to Wrapper.
public static final String
BEFORE_FILTER_EVENT
The event indicating that the doFilter() method of a Filter is about to be called. The filter property contains a reference to the relevant filter instance, and the request and response properties contain the current request and response being processed.
public static final String
AFTER_FILTER_EVENT
The event indicating that the doFilter() method of a Filter has returned. The filter property contains a reference to the relevant filter instance, and the request and response properties contain the current request and response being processed.
private Throwable
exception
The exception that was thrown during the processing being reported by this event (AFTER_INIT_EVENT, AFTER_SERVICE_EVENT, AFTER_DESTROY_EVENT, AFTER_DISPATCH_EVENT, and AFTER_FILTER_EVENT only).
private Filter
filter
The Filter instance for which this event occurred (BEFORE_FILTER_EVENT and AFTER_FILTER_EVENT only).
private ServletRequest
request
The servlet request being processed (BEFORE_FILTER_EVENT, AFTER_FILTER_EVENT, BEFORE_SERVICE_EVENT, and AFTER_SERVICE_EVENT).
private ServletResponse
response
The servlet response being processed (BEFORE_FILTER_EVENT, AFTER_FILTER_EVENT, BEFORE_SERVICE_EVENT, and AFTER_SERVICE_EVENT).
private Servlet
servlet
The Servlet instance for which this event occurred (not present on BEFORE_FILTER_EVENT or AFTER_FILTER_EVENT events).
private String
type
The event type this instance represents.
private Wrapper
wrapper
The Wrapper managing the servlet instance for which this event occurred.
Constructors Summary
public InstanceEvent(Wrapper wrapper, Filter filter, String type)
Construct a new InstanceEvent with the specified parameters. This constructor is used for filter lifecycle events.

param
wrapper Wrapper managing this servlet instance
param
filter Filter instance for which this event occurred
param
type Event type (required)



    // ----------------------------------------------------------- Constructors


                                               
           

      super(wrapper);
      this.wrapper = wrapper;
      this.filter = filter;
      this.servlet = null;
      this.type = type;

    
public InstanceEvent(Wrapper wrapper, Filter filter, String type, Throwable exception)
Construct a new InstanceEvent with the specified parameters. This constructor is used for filter lifecycle events.

param
wrapper Wrapper managing this servlet instance
param
filter Filter instance for which this event occurred
param
type Event type (required)
param
exception Exception that occurred


      super(wrapper);
      this.wrapper = wrapper;
      this.filter = filter;
      this.servlet = null;
      this.type = type;
      this.exception = exception;

    
public InstanceEvent(Wrapper wrapper, Filter filter, String type, ServletRequest request, ServletResponse response)
Construct a new InstanceEvent with the specified parameters. This constructor is used for filter processing events.

param
wrapper Wrapper managing this servlet instance
param
filter Filter instance for which this event occurred
param
type Event type (required)
param
request Servlet request we are processing
param
response Servlet response we are processing


      super(wrapper);
      this.wrapper = wrapper;
      this.filter = filter;
      this.servlet = null;
      this.type = type;
      this.request = request;
      this.response = response;

    
public InstanceEvent(Wrapper wrapper, Filter filter, String type, ServletRequest request, ServletResponse response, Throwable exception)
Construct a new InstanceEvent with the specified parameters. This constructor is used for filter processing events.

param
wrapper Wrapper managing this servlet instance
param
filter Filter instance for which this event occurred
param
type Event type (required)
param
request Servlet request we are processing
param
response Servlet response we are processing
param
exception Exception that occurred


      super(wrapper);
      this.wrapper = wrapper;
      this.filter = filter;
      this.servlet = null;
      this.type = type;
      this.request = request;
      this.response = response;
      this.exception = exception;

    
public InstanceEvent(Wrapper wrapper, Servlet servlet, String type)
Construct a new InstanceEvent with the specified parameters. This constructor is used for processing servlet lifecycle events.

param
wrapper Wrapper managing this servlet instance
param
servlet Servlet instance for which this event occurred
param
type Event type (required)


      super(wrapper);
      this.wrapper = wrapper;
      this.filter = null;
      this.servlet = servlet;
      this.type = type;

    
public InstanceEvent(Wrapper wrapper, Servlet servlet, String type, Throwable exception)
Construct a new InstanceEvent with the specified parameters. This constructor is used for processing servlet lifecycle events.

param
wrapper Wrapper managing this servlet instance
param
servlet Servlet instance for which this event occurred
param
type Event type (required)
param
exception Exception that occurred


      super(wrapper);
      this.wrapper = wrapper;
      this.filter = null;
      this.servlet = servlet;
      this.type = type;
      this.exception = exception;

    
public InstanceEvent(Wrapper wrapper, Servlet servlet, String type, ServletRequest request, ServletResponse response)
Construct a new InstanceEvent with the specified parameters. This constructor is used for processing servlet processing events.

param
wrapper Wrapper managing this servlet instance
param
servlet Servlet instance for which this event occurred
param
type Event type (required)
param
request Servlet request we are processing
param
response Servlet response we are processing


      super(wrapper);
      this.wrapper = wrapper;
      this.filter = null;
      this.servlet = servlet;
      this.type = type;
      this.request = request;
      this.response = response;

    
public InstanceEvent(Wrapper wrapper, Servlet servlet, String type, ServletRequest request, ServletResponse response, Throwable exception)
Construct a new InstanceEvent with the specified parameters. This constructor is used for processing servlet processing events.

param
wrapper Wrapper managing this servlet instance
param
servlet Servlet instance for which this event occurred
param
type Event type (required)
param
request Servlet request we are processing
param
response Servlet response we are processing
param
exception Exception that occurred


      super(wrapper);
      this.wrapper = wrapper;
      this.filter = null;
      this.servlet = servlet;
      this.type = type;
      this.request = request;
      this.response = response;
      this.exception = exception;

    
Methods Summary
public java.lang.ThrowablegetException()
Return the exception that occurred during the processing that was reported by this event.



    // ------------------------------------------------------------- Properties


                       
       

        return (this.exception);

    
public javax.servlet.FiltergetFilter()
Return the filter instance for which this event occurred.


        return (this.filter);

    
public javax.servlet.ServletRequestgetRequest()
Return the servlet request for which this event occurred.


        return (this.request);

    
public javax.servlet.ServletResponsegetResponse()
Return the servlet response for which this event occurred.


        return (this.response);

    
public javax.servlet.ServletgetServlet()
Return the servlet instance for which this event occurred.


        return (this.servlet);

    
public java.lang.StringgetType()
Return the event type of this event.


        return (this.type);

    
public WrappergetWrapper()
Return the Wrapper managing the servlet instance for which this event occurred.


        return (this.wrapper);