Save This Page
Home » apache-tomcat-6.0.16-src » org.apache » catalina » ha » tcp » [javadoc | source]
org.apache.catalina.ha.tcp
public class: ReplicationValve [javadoc | source]
java.lang.Object
   org.apache.catalina.valves.ValveBase
      org.apache.catalina.ha.tcp.ReplicationValve

All Implemented Interfaces:
    ClusterValve, Valve, MBeanRegistration, Contained

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.ha.tcp.isPrimarySession. is set true, when request processing is at sessions primary node.

Field Summary
protected static  StringManager sm    The StringManager for this package. 
protected  Pattern[] reqFilters    holds file endings to not call for like images and others 
protected  String filter    Orginal filter 
protected  ThreadLocal crossContextSessions    crossContext session container 
protected  boolean doProcessingStats    doProcessingStats (default = off) 
protected  long totalRequestTime     
protected  long totalSendTime     
protected  long nrOfRequests     
protected  long lastSendTime     
protected  long nrOfFilterRequests     
protected  long nrOfSendRequests     
protected  long nrOfCrossContextSendRequests     
protected  boolean primaryIndicator    must primary change indicator set 
protected  String primaryIndicatorName    Name of primary change indicator as request attribute 
Fields inherited from org.apache.catalina.valves.ValveBase:
container,  containerLog,  info,  next,  sm,  domain,  oname,  mserver,  controller
Constructor:
 public ReplicationValve() 
Method from org.apache.catalina.ha.tcp.ReplicationValve Summary:
createPrimaryIndicator,   doStatistics,   getCluster,   getFilter,   getInfo,   getLastSendTime,   getNrOfCrossContextSendRequests,   getNrOfFilterRequests,   getNrOfRequests,   getNrOfSendRequests,   getPrimaryIndicatorName,   getReqFilters,   getTotalRequestTime,   getTotalSendTime,   invoke,   isPrimaryIndicator,   isRequestWithoutSessionChange,   registerReplicationSession,   resetDeltaRequest,   resetReplicationRequest,   resetStatistics,   send,   sendCrossContextSession,   sendInvalidSessions,   sendMessage,   sendReplicationMessage,   sendSessionReplicationMessage,   setCluster,   setFilter,   setPrimaryIndicator,   setPrimaryIndicatorName,   setReqFilters,   setStatistics,   toString,   updateStats
Methods from org.apache.catalina.valves.ValveBase:
backgroundProcess,   createObjectName,   event,   getContainer,   getContainerName,   getController,   getDomain,   getInfo,   getNext,   getObjectName,   getParentName,   invoke,   postDeregister,   postRegister,   preDeregister,   preRegister,   setContainer,   setController,   setNext,   setObjectName,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.ha.tcp.ReplicationValve Detail:
 protected  void createPrimaryIndicator(Request request) throws IOException 
    Mark Request that processed at primary node with attribute primaryIndicatorName
 public boolean doStatistics() 
    Calc processing stats
 public CatalinaCluster getCluster() 
 public String getFilter() 
 public String getInfo() 
    Return descriptive information about this Valve implementation.
 public long getLastSendTime() 
 public long getNrOfCrossContextSendRequests() 
 public long getNrOfFilterRequests() 
 public long getNrOfRequests() 
 public long getNrOfSendRequests() 
 public String getPrimaryIndicatorName() 
 protected Pattern[] getReqFilters() 
 public long getTotalRequestTime() 
 public long getTotalSendTime() 
 public  void invoke(Request request,
    Response response) throws IOException, ServletException 
    Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.
 public boolean isPrimaryIndicator() 
 protected boolean isRequestWithoutSessionChange(String uri) 
    is request without possible session change
 public  void registerReplicationSession(DeltaSession session) 
    Register all cross context sessions inside endAccess. Use a list with contains check, that the Portlet API can include a lot of fragments from same or different applications with session changes.
 protected  void resetDeltaRequest(Session session) 
    Reset DeltaRequest from session
 protected  void resetReplicationRequest(Request request,
    boolean isCrossContext) 
    Fix memory leak for long sessions with many changes, when no backup member exists!
 public  void resetStatistics() 
    reset the active statitics
 protected  void send(ClusterManager manager,
    CatalinaCluster cluster,
    String sessionId) 
    send manager requestCompleted message to cluster
 protected  void sendCrossContextSession(CatalinaCluster containerCluster) 
    Send all changed cross context sessions to backups
 protected  void sendInvalidSessions(ClusterManager manager,
    CatalinaCluster cluster) 
    check for session invalidations
 protected  void sendMessage(Session session,
    ClusterManager manager,
    CatalinaCluster cluster) 
    Send message delta message from request session
 protected  void sendReplicationMessage(Request request,
    long totalstart,
    boolean isCrossContext,
    ClusterManager clusterManager,
    CatalinaCluster containerCluster) 
 protected  void sendSessionReplicationMessage(Request request,
    ClusterManager manager,
    CatalinaCluster cluster) 
    Send Cluster Replication Request
 public  void setCluster(CatalinaCluster cluster) 
 public  void setFilter(String filter) 
    compile filter string to regular expressions
 public  void setPrimaryIndicator(boolean primaryIndicator) 
 public  void setPrimaryIndicatorName(String primaryIndicatorName) 
 protected  void setReqFilters(Pattern[] reqFilters) 
 public  void setStatistics(boolean doProcessingStats) 
    Set Calc processing stats
 public String toString() 
    Return a String rendering of this object.
 protected  void updateStats(long requestTime,
    long clusterTime) 
    protocol cluster replications stats