org.apache.catalina.valves
Class ValveBase

java.lang.Object
  |
  +--org.apache.catalina.valves.ValveBase
All Implemented Interfaces:
Valve
Direct Known Subclasses:
AccessLogValve, AuthenticatorBase, CertificatesValve, RequestFilterValve, SingleSignOn

public abstract class ValveBase
extends java.lang.Object
implements Valve

Convenience base class for implementations of the Valve interface. A subclass MUST implement an invoke() method to provide the required functionality, and MAY implement the Lifecycle interface to provide configuration management and lifecycle support.

Version:
$Revision: 1.1 $ $Date: 2000/08/11 17:03:15 $
Author:
Craig R. McClanahan

Field Summary
protected  Container container
          The Container whose pipeline this Valve is a component of.
protected static java.lang.String info
          Descriptive information about this Valve implementation.
protected  Valve next
          The next Valve in the pipeline this Valve is a component of.
protected  Valve previous
          The previous Valve in the pipeline this Valve is a component of.
protected static StringManager sm
          The string manager for this package.
 
Constructor Summary
ValveBase()
           
 
Method Summary
 Container getContainer()
          Return the Container with which this Valve is associated, if any.
 java.lang.String getInfo()
          Return descriptive information about this Valve implementation.
 Valve getNext()
          Return the next Valve in this pipeline, or null if this is the last Valve in the pipeline.
 Valve getPrevious()
          Return the previous Valve in this pipeline, or null if this is the first Valve in the pipeline.
abstract  void invoke(Request request, Response response)
          The implementation-specific logic represented by this Valve.
 void invokeNext(Request request, Response response)
          Invoke the next Valve in our pipeline, or complain if there is no such Valve remaining.
 void setContainer(Container container)
          Set the Container with which this Valve is associated, if any.
 void setNext(Valve valve)
          Set the Valve that follows this one in the pipeline it is part of.
 void setPrevious(Valve valve)
          Set the Valve that preceeds this one in the pipeline it is part of.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

container

protected Container container
The Container whose pipeline this Valve is a component of.

info

protected static java.lang.String info
Descriptive information about this Valve implementation. This value should be overridden by subclasses.

next

protected Valve next
The next Valve in the pipeline this Valve is a component of.

previous

protected Valve previous
The previous Valve in the pipeline this Valve is a component of.

sm

protected static final StringManager sm
The string manager for this package.
Constructor Detail

ValveBase

public ValveBase()
Method Detail

getContainer

public Container getContainer()
Return the Container with which this Valve is associated, if any.
Specified by:
getContainer in interface Valve

setContainer

public void setContainer(Container container)
Set the Container with which this Valve is associated, if any.
Specified by:
setContainer in interface Valve
Parameters:
container - The new associated container

getInfo

public java.lang.String getInfo()
Return descriptive information about this Valve implementation.
Specified by:
getInfo in interface Valve

getNext

public Valve getNext()
Return the next Valve in this pipeline, or null if this is the last Valve in the pipeline.
Specified by:
getNext in interface Valve

setNext

public void setNext(Valve valve)
Set the Valve that follows this one in the pipeline it is part of.
Specified by:
setNext in interface Valve
Parameters:
valve - The new next valve

getPrevious

public Valve getPrevious()
Return the previous Valve in this pipeline, or null if this is the first Valve in the pipeline.
Specified by:
getPrevious in interface Valve

setPrevious

public void setPrevious(Valve valve)
Set the Valve that preceeds this one in the pipeline it is part of.
Specified by:
setPrevious in interface Valve
Parameters:
valve - The previous valve

invoke

public abstract void invoke(Request request,
                            Response response)
                     throws java.io.IOException,
                            javax.servlet.ServletException
The implementation-specific logic represented by this Valve. See the Valve description for the normal design patterns for this method.

This method MUST be provided by a subclass.

Specified by:
invoke in interface Valve
Parameters:
request - The servlet request to be processed
response - The servlet response to be created
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet error occurs

invokeNext

public void invokeNext(Request request,
                       Response response)
                throws java.io.IOException,
                       javax.servlet.ServletException
Invoke the next Valve in our pipeline, or complain if there is no such Valve remaining.
Parameters:
request - The servlet request to be processed
response - The servlet response to be created
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet error occurs


Copyright © 2000 Apache Software Foundation. All Rights Reserved.