org.apache.catalina.cluster.tcp
Class ReplicationValve

java.lang.Object
  extended byorg.apache.catalina.valves.ValveBase
      extended byorg.apache.catalina.cluster.tcp.ReplicationValve
All Implemented Interfaces:
Contained, javax.management.MBeanRegistration, Valve

public class ReplicationValve
extends ValveBase

Implementation of a Valve that logs interesting contents from the specified Request (before processing) and the corresponding Response (after processing). It is especially useful in debugging problems related to headers and cookies.

This Valve may be attached to any Container, depending on the granularity of the logging you wish to perform.

primaryIndicator=true, then the request attribute org.apache.catalina.cluster.tcp.isPrimarySession. is set true, when request processing is at sessions primary node.

Version:
$Revision: 1.17 $ $Date: 2005/02/11 19:45:18 $
Author:
Craig R. McClanahan, Filip Hanik, Peter Rossbach

Field Summary
protected  java.lang.String filter
           
protected  long lastSendTime
           
protected  long nrOfRequests
           
protected  boolean primaryIndicator
           
protected  java.lang.String primaryIndicatorName
           
protected  java.util.regex.Pattern[] reqFilters
          holds file endings to not call for like images and others
protected static StringManager sm
          The StringManager for this package.
protected  long totalRequestTime
           
protected  long totalSendTime
           
 
Fields inherited from class org.apache.catalina.valves.ValveBase
container, containerLog, controller, domain, mserver, next, oname
 
Constructor Summary
ReplicationValve()
           
 
Method Summary
protected  void addClusterSendTime(long requestTime, long clusterTime)
           
protected  void createPrimaryIndicator(Request request)
          Mark Request that processed at primary node with attribute primaryIndicatorName
 java.lang.String getFilter()
           
 java.lang.String getInfo()
          Return descriptive information about this Valve implementation.
 java.lang.String getPrimaryIndicatorName()
           
 void invoke(Request request, Response response)
          Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.
 boolean isPrimaryIndicator()
           
 void setFilter(java.lang.String filter)
           
 void setPrimaryIndicator(boolean primaryIndicator)
           
 void setPrimaryIndicatorName(java.lang.String primaryIndicatorName)
           
 java.lang.String toString()
          Return a String rendering of this object.
 
Methods inherited from class org.apache.catalina.valves.ValveBase
backgroundProcess, createObjectName, getContainer, getContainerName, getController, getDomain, getNext, getObjectName, getParentName, postDeregister, postRegister, preDeregister, preRegister, setContainer, setController, setNext, setObjectName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sm

protected static StringManager sm
The StringManager for this package.


reqFilters

protected java.util.regex.Pattern[] reqFilters
holds file endings to not call for like images and others


filter

protected java.lang.String filter

totalRequestTime

protected long totalRequestTime

totalSendTime

protected long totalSendTime

nrOfRequests

protected long nrOfRequests

lastSendTime

protected long lastSendTime

primaryIndicator

protected boolean primaryIndicator

primaryIndicatorName

protected java.lang.String primaryIndicatorName
Constructor Detail

ReplicationValve

public ReplicationValve()
Method Detail

getInfo

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

Specified by:
getInfo in interface Valve
Overrides:
getInfo in class ValveBase

addClusterSendTime

protected void addClusterSendTime(long requestTime,
                                  long clusterTime)

invoke

public void invoke(Request request,
                   Response response)
            throws java.io.IOException,
                   javax.servlet.ServletException
Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.

Specified by:
invoke in interface Valve
Specified by:
invoke in class ValveBase
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

createPrimaryIndicator

protected void createPrimaryIndicator(Request request)
                               throws java.io.IOException
Mark Request that processed at primary node with attribute primaryIndicatorName

Parameters:
request -
Throws:
java.io.IOException

toString

public java.lang.String toString()
Return a String rendering of this object.


setFilter

public void setFilter(java.lang.String filter)
Parameters:
filter - The filter to set.

getFilter

public java.lang.String getFilter()
Returns:
Returns the filter

isPrimaryIndicator

public boolean isPrimaryIndicator()
Returns:
Returns the primaryIndicator.

setPrimaryIndicator

public void setPrimaryIndicator(boolean primaryIndicator)
Parameters:
primaryIndicator - The primaryIndicator to set.

getPrimaryIndicatorName

public java.lang.String getPrimaryIndicatorName()
Returns:
Returns the primaryIndicatorName.

setPrimaryIndicatorName

public void setPrimaryIndicatorName(java.lang.String primaryIndicatorName)
Parameters:
primaryIndicatorName - The primaryIndicatorName to set.


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