## org.apache.catalina.valves
Class ValveBase

    java.lang.Object
      org.apache.catalina.valves.ValveBase

All Implemented Interfaces:
  Contained, Valve

Direct Known Subclasses:
  AccessLogValve, AuthenticatorBase, CertificatesValve, ErrorDispatcherValve, ErrorReportValve, ExtendedAccessLogValve, JDBCAccessLogValve, RequestDumperValve, RequestFilterValve, SingleSignOn

public abstract class ValveBase
extends java.lang.Object
implements Contained, 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: 466595 $ $Date: 2006-10-21 23:24:41 +0100 (Sat, 21 Oct 2006) $
Author:
  Craig R. McClanahan

Field Summary
`protected Container` `container` The Container whose pipeline this Valve is a component of.
`protected int` `debug` The debugging detail level for this component.
`protected static java.lang.String` `info` Descriptive information about this Valve implementation.
`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.
`int` `getDebug()` Return the debugging detail level for this component.
`java.lang.String` `getInfo()` Return descriptive information about this Valve implementation.
`abstract void` `invoke(Request request, Response response, ValveContext context)` The implementation-specific logic represented by this Valve.
`void` `setContainer(Container container)` Set the Container with which this Valve is associated, if any.
`void` `setDebug(int debug)` Set the debugging detail level for this component.

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.

### debug

    protected int debug

  The debugging detail level for this component.

### info

    protected static java.lang.String info

  Descriptive information about this Valve implementation. This value should be overridden by subclasses.

### 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 `Contained`

### setContainer

    public void setContainer(Container container)

  Set the Container with which this Valve is associated, if any.

  Specified by:
    `setContainer` in interface `Contained`
  Parameters:
    `container` - The new associated container

### getDebug

    public int getDebug()

  Return the debugging detail level for this component.

### setDebug

    public void setDebug(int debug)

  Set the debugging detail level for this component.

  Parameters:
    `debug` - The new debugging detail level

### getInfo

    public java.lang.String getInfo()

  Return descriptive information about this Valve implementation.

  Specified by:
    `getInfo` in interface `Valve`

### invoke

    public abstract void invoke(Request request,
                                Response response,
                                ValveContext context)
                         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
    `context` - The valve context used to invoke the next valve in the current processing pipeline
  Throws:
    `java.io.IOException` - if an input/output error occurs
    `javax.servlet.ServletException` - if a servlet error occurs

Copyright © 2000-2002 Apache Software Foundation. All Rights Reserved.