Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.enhydra.servlet.filter
Class Filter  view Filter download Filter.java

java.lang.Object
  extended byorg.enhydra.servlet.filter.Filter
Direct Known Subclasses:
MultiServerFilter, PrintTransactionFilter

public abstract class Filter
extends java.lang.Object

This replaces the BasicTransactionFilter. Also note that the BasicTransactionServlet is no longer used and that it is functionally replaced by implementing the org.apache.tomcat.core.LifecycleInterceptor and org.apache.tomcat.core.ServiceInterceptor. There is no interface defined for this, since this is a temporary halfway point between the old Enhydra TransactionFilter and the future Tomcat Interceptors. Extend this class to create a filter with additional attributes. The object model is not currently very clean because we need to bridge between the Interceptor model of Tomcat for service(), init(), and destroy(), while maintaining the Enhydra request and response wrapping (Valve model).


Field Summary
private  java.lang.String description
           
private  org.apache.tomcat.core.LifecycleInterceptor destroyInterceptor
           
private  org.apache.tomcat.core.LifecycleInterceptor initInterceptor
           
private  org.apache.tomcat.core.ServiceInterceptor serviceInterceptor
           
 
Constructor Summary
Filter()
          Default constructor.
Filter(java.lang.String description)
          Constructor given a description only.
 
Method Summary
 java.lang.String getDescription()
          Get the String description for this Filter.
 org.apache.tomcat.core.LifecycleInterceptor getDestroyInterceptor()
          Get the destroy() LifecycleInterceptor for this Filter.
 org.apache.tomcat.core.LifecycleInterceptor getInitInterceptor()
          Get the init() LifecycleInterceptor for this Filter.
 org.apache.tomcat.core.ServiceInterceptor getServiceInterceptor()
          Get the ServiceInterceptor for this Filter.
 void registerInterceptors(java.lang.String id)
          Adds the service, init, and destroy interceptors to the Tomcat Context for the given servlet.
 void setDescription(java.lang.String description)
          Set the String description for this Filter.
 void setDestroyInterceptor(org.apache.tomcat.core.LifecycleInterceptor destroyInterceptor)
          Set the destroy() LifecycleInterceptor for this Filter.
 void setInitInterceptor(org.apache.tomcat.core.LifecycleInterceptor initInterceptor)
          Set the init() LifecycleInterceptor for this Filter.
 void setServiceInterceptor(org.apache.tomcat.core.ServiceInterceptor serviceInterceptor)
          Set the ServiceInterceptor for this Filter.
 java.lang.String toString()
          Override toString since that is what the Admin used to use to get the description.
 void unregisterInterceptors(java.lang.String id)
          Removes the service, init, and destroy interceptors from the Tomcat Context for the given servlet.
 RequestFilter wrapRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the RequestFilter for this Filter by wrapping the given Request.
abstract  ResponseFilter wrapResponse(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Get the ResponseFilter for this Filter by wrapping the given Response.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serviceInterceptor

private org.apache.tomcat.core.ServiceInterceptor serviceInterceptor

initInterceptor

private org.apache.tomcat.core.LifecycleInterceptor initInterceptor

destroyInterceptor

private org.apache.tomcat.core.LifecycleInterceptor destroyInterceptor

description

private java.lang.String description
Constructor Detail

Filter

public Filter()
Default constructor. Other filter elements must be set with the set methods.


Filter

public Filter(java.lang.String description)
Constructor given a description only. Other filter elements must be set with the set methods.

Method Detail

registerInterceptors

public void registerInterceptors(java.lang.String id)
Adds the service, init, and destroy interceptors to the Tomcat Context for the given servlet.


unregisterInterceptors

public void unregisterInterceptors(java.lang.String id)
Removes the service, init, and destroy interceptors from the Tomcat Context for the given servlet.


setDescription

public void setDescription(java.lang.String description)
Set the String description for this Filter. This should be suitable for display in a select list.


getDescription

public java.lang.String getDescription()
Get the String description for this Filter.


toString

public java.lang.String toString()
Override toString since that is what the Admin used to use to get the description.


wrapRequest

public RequestFilter wrapRequest(javax.servlet.http.HttpServletRequest request,
                                 javax.servlet.http.HttpServletResponse response)
Get the RequestFilter for this Filter by wrapping the given Request.


wrapResponse

public abstract ResponseFilter wrapResponse(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response)
Get the ResponseFilter for this Filter by wrapping the given Response.


setServiceInterceptor

public void setServiceInterceptor(org.apache.tomcat.core.ServiceInterceptor serviceInterceptor)
Set the ServiceInterceptor for this Filter.


getServiceInterceptor

public org.apache.tomcat.core.ServiceInterceptor getServiceInterceptor()
Get the ServiceInterceptor for this Filter.


setInitInterceptor

public void setInitInterceptor(org.apache.tomcat.core.LifecycleInterceptor initInterceptor)
Set the init() LifecycleInterceptor for this Filter.


getInitInterceptor

public org.apache.tomcat.core.LifecycleInterceptor getInitInterceptor()
Get the init() LifecycleInterceptor for this Filter.


setDestroyInterceptor

public void setDestroyInterceptor(org.apache.tomcat.core.LifecycleInterceptor destroyInterceptor)
Set the destroy() LifecycleInterceptor for this Filter.


getDestroyInterceptor

public org.apache.tomcat.core.LifecycleInterceptor getDestroyInterceptor()
Get the destroy() LifecycleInterceptor for this Filter.