org.apache.catalina.valves

Class ValveBase

public abstract class ValveBase extends 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: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $

Author: Craig R. McClanahan

Field Summary
protected Containercontainer
The Container whose pipeline this Valve is a component of.
protected LogcontainerLog
Container log
protected ObjectNamecontroller
protected Stringdomain
protected static Stringinfo
Descriptive information about this Valve implementation.
protected MBeanServermserver
protected Valvenext
The next Valve in the pipeline this Valve is a component of.
protected ObjectNameoname
protected static StringManagersm
The string manager for this package.
Method Summary
voidbackgroundProcess()
Execute a periodic task, such as reloading, etc.
ObjectNamecreateObjectName(String domain, ObjectName parent)
voidevent(Request request, Response response, CometEvent event)
Process a Comet event.
ContainergetContainer()
Return the Container with which this Valve is associated, if any.
ObjectNamegetContainerName()
ObjectNamegetController()
StringgetDomain()
StringgetInfo()
Return descriptive information about this Valve implementation.
ValvegetNext()
Return the next Valve in this pipeline, or null if this is the last Valve in the pipeline.
ObjectNamegetObjectName()
ObjectNamegetParentName(ObjectName valveName)
From the name, extract the parent object name
abstract voidinvoke(Request request, Response response)
The implementation-specific logic represented by this Valve.
voidpostDeregister()
voidpostRegister(Boolean registrationDone)
voidpreDeregister()
ObjectNamepreRegister(MBeanServer server, ObjectName name)
voidsetContainer(Container container)
Set the Container with which this Valve is associated, if any.
voidsetController(ObjectName controller)
voidsetNext(Valve valve)
Set the Valve that follows this one in the pipeline it is part of.
voidsetObjectName(ObjectName oname)
StringtoString()
Return a String rendering of this object.

Field Detail

container

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

containerLog

protected Log containerLog
Container log

controller

protected ObjectName controller

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

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

oname

protected ObjectName oname

sm

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

Method Detail

backgroundProcess

public void backgroundProcess()
Execute a periodic task, such as reloading, etc. This method will be invoked inside the classloading context of this container. Unexpected throwables will be caught and logged.

createObjectName

public ObjectName createObjectName(String domain, ObjectName parent)

event

public void event(Request request, Response response, CometEvent event)
Process a Comet event. This method will rarely need to be provided by a subclass, unless it needs to reassociate a particular object with the thread that is processing the request.

Parameters: request The servlet request to be processed response The servlet response to be created

Throws: IOException if an input/output error occurs, or is thrown by a subsequently invoked Valve, Filter, or Servlet ServletException if a servlet error occurs, or is thrown by a subsequently invoked Valve, Filter, or Servlet

getContainer

public Container getContainer()
Return the Container with which this Valve is associated, if any.

getContainerName

public ObjectName getContainerName()

getController

public ObjectName getController()

getDomain

public String getDomain()

getInfo

public String getInfo()
Return descriptive information about this Valve implementation.

getNext

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

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 abstract void invoke(Request request, Response response)
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.

Parameters: request The servlet request to be processed response The servlet response to be created

Throws: IOException if an input/output error occurs ServletException if a servlet error occurs

postDeregister

public void postDeregister()

postRegister

public void postRegister(Boolean registrationDone)

preDeregister

public void preDeregister()

preRegister

public ObjectName preRegister(MBeanServer server, ObjectName name)

setContainer

public void setContainer(Container container)
Set the Container with which this Valve is associated, if any.

Parameters: container The new associated container

setController

public void setController(ObjectName controller)

setNext

public void setNext(Valve valve)
Set the Valve that follows this one in the pipeline it is part of.

Parameters: valve The new next valve

setObjectName

public void setObjectName(ObjectName oname)

toString

public String toString()
Return a String rendering of this object.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.