org.apache.catalina.valves

Class ValveBase

Implemented Interfaces:
Contained, MBeanRegistration, Valve
Known Direct Subclasses:
AccessLogValve, AuthenticatorBase, ErrorReportValve, ExtendedAccessLogValve, JDBCAccessLogValve, PersistentValve, RequestDumperValve, RequestFilterValve, SingleSignOn

public abstract class ValveBase
extends java.lang.Object
implements Contained, Valve, 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 ObjectName
controller
protected int
debug
The debugging detail level for this component.
protected String
domain
protected static String
info
Descriptive information about this Valve implementation.
protected MBeanServer
mserver
protected ObjectName
oname
protected static StringManager
sm
The string manager for this package.

Method Summary

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

Field Details

container

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


controller

protected ObjectName controller


debug

protected int debug
The debugging detail level for this component.


domain

protected String domain


info

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


mserver

protected MBeanServer mserver


oname

protected ObjectName oname


sm

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

Method Details

createObjectName

public ObjectName createObjectName(String domain,
                                   ObjectName parent)
            throws MalformedObjectNameException


getContainer

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


getContainerName

public ObjectName getContainerName()


getController

public ObjectName getController()


getDebug

public int getDebug()
Return the debugging detail level for this component.


getDomain

public String getDomain()


getInfo

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


getObjectName

public ObjectName getObjectName()


getParentName

public ObjectName getParentName(ObjectName valveName)
From the name, extract the parent object name

Parameters:
valveName - The valve name

Returns:
ObjectName The parent name


invoke

public void invoke(Request request,
                   Response response,
                   ValveContext context)
            throws IOException,
                   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


postDeregister

public void postDeregister()


postRegister

public void postRegister(Boolean registrationDone)


preDeregister

public void preDeregister()
            throws Exception


preRegister

public ObjectName preRegister(MBeanServer server,
                              ObjectName name)
            throws Exception


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


setController

public void setController(ObjectName controller)


setDebug

public void setDebug(int debug)
Set the debugging detail level for this component.

Parameters:
debug - The new debugging detail level


setObjectName

public void setObjectName(ObjectName oname)


Copyright B) 2000-2003 Apache Software Foundation. All Rights Reserved.