## org.apache.catalina.valves
Class ValveBase

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

All Implemented Interfaces:
  Contained, javax.management.MBeanRegistration, Valve

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

public abstract class ValveBase
extends java.lang.Object
implements Contained, Valve, javax.management.MBeanRegistration

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.12 $ $Date: 2004/05/26 16:28:23 $
Author:
  Craig R. McClanahan

Field Summary
`protected Container` `container` The Container whose pipeline this Valve is a component of.
`protected javax.management.ObjectName` `controller`
`protected int` `debug` The debugging detail level for this component.
`protected java.lang.String` `domain`
`protected static java.lang.String` `info` Descriptive information about this Valve implementation.
`protected javax.management.MBeanServer` `mserver`
`protected javax.management.ObjectName` `oname`
`protected static StringManager` `sm` The string manager for this package.

Constructor Summary
`ValveBase()`

Method Summary
`javax.management.ObjectName` `createObjectName(java.lang.String domain, javax.management.ObjectName parent)`
`Container` `getContainer()` Return the Container with which this Valve is associated, if any.
`javax.management.ObjectName` `getContainerName()`
`javax.management.ObjectName` `getController()`
`int` `getDebug()` Return the debugging detail level for this component.
`java.lang.String` `getDomain()`
`java.lang.String` `getInfo()` Return descriptive information about this Valve implementation.
`javax.management.ObjectName` `getObjectName()`
`javax.management.ObjectName` `getParentName(javax.management.ObjectName valveName)` From the name, extract the parent object name
`abstract void` `invoke(Request request, Response response, ValveContext context)` The implementation-specific logic represented by this Valve.
`void` `postDeregister()`
`void` `postRegister(java.lang.Boolean registrationDone)`
`void` `preDeregister()`
`javax.management.ObjectName` `preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)`
`void` `setContainer(Container container)` Set the Container with which this Valve is associated, if any.
`void` `setController(javax.management.ObjectName controller)`
`void` `setDebug(int debug)` Set the debugging detail level for this component.
`void` `setObjectName(javax.management.ObjectName oname)`

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.

### domain

    protected java.lang.String domain

### oname

    protected javax.management.ObjectName oname

### mserver

    protected javax.management.MBeanServer mserver

### controller

    protected javax.management.ObjectName controller

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

### getObjectName

    public javax.management.ObjectName getObjectName()

### setObjectName

    public void setObjectName(javax.management.ObjectName oname)

### getDomain

    public java.lang.String getDomain()

### preRegister

    public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                                   javax.management.ObjectName name)
                                            throws java.lang.Exception

  Specified by:
    `preRegister` in interface `javax.management.MBeanRegistration`
  Throws:
    `java.lang.Exception`

### postRegister

    public void postRegister(java.lang.Boolean registrationDone)

  Specified by:
    `postRegister` in interface `javax.management.MBeanRegistration`

### preDeregister

    public void preDeregister()
                       throws java.lang.Exception

  Specified by:
    `preDeregister` in interface `javax.management.MBeanRegistration`
  Throws:
    `java.lang.Exception`

### postDeregister

    public void postDeregister()

  Specified by:
    `postDeregister` in interface `javax.management.MBeanRegistration`

### getController

    public javax.management.ObjectName getController()

### setController

    public void setController(javax.management.ObjectName controller)

### getParentName

    public javax.management.ObjectName getParentName(javax.management.ObjectName valveName)

  From the name, extract the parent object name

  Parameters:
    `valveName` - The valve name
  Returns:
    ObjectName The parent name

### createObjectName

    public javax.management.ObjectName createObjectName(java.lang.String domain,
                                                        javax.management.ObjectName parent)
                                                 throws javax.management.MalformedObjectNameException

  Throws:
    `javax.management.MalformedObjectNameException`

### getContainerName

    public javax.management.ObjectName getContainerName()

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