|
Apache Tomcat 6.0.43 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.catalina.valves.ValveBase org.apache.catalina.ha.tcp.ReplicationValve
public class ReplicationValve
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 java.lang.ThreadLocal |
crossContextSessions
crossContext session container |
protected boolean |
doProcessingStats
doProcessingStats (default = off) |
protected java.lang.String |
filter
Orginal filter |
protected long |
lastSendTime
|
protected long |
nrOfCrossContextSendRequests
|
protected long |
nrOfFilterRequests
|
protected long |
nrOfRequests
|
protected long |
nrOfSendRequests
|
protected boolean |
primaryIndicator
must primary change indicator set |
protected java.lang.String |
primaryIndicatorName
Name of primary change indicator as request attribute |
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 |
createPrimaryIndicator(Request request)
Mark Request that processed at primary node with attribute primaryIndicatorName |
boolean |
doStatistics()
Calc processing stats |
CatalinaCluster |
getCluster()
Returns the cluster the cluster deployer is associated with |
java.lang.String |
getFilter()
|
java.lang.String |
getInfo()
Return descriptive information about this Valve implementation. |
long |
getLastSendTime()
|
long |
getNrOfCrossContextSendRequests()
|
long |
getNrOfFilterRequests()
|
long |
getNrOfRequests()
|
long |
getNrOfSendRequests()
|
java.lang.String |
getPrimaryIndicatorName()
|
protected java.util.regex.Pattern[] |
getReqFilters()
|
long |
getTotalRequestTime()
|
long |
getTotalSendTime()
|
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()
|
protected boolean |
isRequestWithoutSessionChange(java.lang.String uri)
is request without possible session change |
void |
registerReplicationSession(DeltaSession session)
Register all cross context sessions inside endAccess. |
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! |
void |
resetStatistics()
reset the active statitics |
protected void |
send(ClusterManager manager,
CatalinaCluster cluster,
java.lang.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 |
void |
setCluster(CatalinaCluster cluster)
Associates the cluster deployer with a cluster |
void |
setFilter(java.lang.String filter)
compile filter string to regular expressions |
void |
setPrimaryIndicator(boolean primaryIndicator)
|
void |
setPrimaryIndicatorName(java.lang.String primaryIndicatorName)
|
protected void |
setReqFilters(java.util.regex.Pattern[] reqFilters)
|
void |
setStatistics(boolean doProcessingStats)
Set Calc processing stats |
java.lang.String |
toString()
Return a String rendering of this object. |
protected void |
updateStats(long requestTime,
long clusterTime)
protocol cluster replications stats |
Methods inherited from class org.apache.catalina.valves.ValveBase |
---|
backgroundProcess, createObjectName, event, 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 |
Methods inherited from interface org.apache.catalina.Valve |
---|
backgroundProcess, event, getNext, setNext |
Field Detail |
---|
protected static StringManager sm
protected java.util.regex.Pattern[] reqFilters
protected java.lang.String filter
protected java.lang.ThreadLocal crossContextSessions
protected boolean doProcessingStats
protected long totalRequestTime
protected long totalSendTime
protected long nrOfRequests
protected long lastSendTime
protected long nrOfFilterRequests
protected long nrOfSendRequests
protected long nrOfCrossContextSendRequests
protected boolean primaryIndicator
protected java.lang.String primaryIndicatorName
Constructor Detail |
---|
public ReplicationValve()
Method Detail |
---|
public java.lang.String getInfo()
getInfo
in interface Valve
getInfo
in class ValveBase
public CatalinaCluster getCluster()
ClusterValve
getCluster
in interface ClusterValve
public void setCluster(CatalinaCluster cluster)
ClusterValve
setCluster
in interface ClusterValve
cluster
- The cluster to set.public java.lang.String getFilter()
public void setFilter(java.lang.String filter)
filter
- The filter to set.Pattern.compile(java.lang.String)
public boolean isPrimaryIndicator()
public void setPrimaryIndicator(boolean primaryIndicator)
primaryIndicator
- The primaryIndicator to set.public java.lang.String getPrimaryIndicatorName()
public void setPrimaryIndicatorName(java.lang.String primaryIndicatorName)
primaryIndicatorName
- The primaryIndicatorName to set.public boolean doStatistics()
public void setStatistics(boolean doProcessingStats)
resetStatistics()
public long getLastSendTime()
public long getNrOfRequests()
public long getNrOfFilterRequests()
public long getNrOfCrossContextSendRequests()
public long getNrOfSendRequests()
public long getTotalRequestTime()
public long getTotalSendTime()
protected java.util.regex.Pattern[] getReqFilters()
protected void setReqFilters(java.util.regex.Pattern[] reqFilters)
reqFilters
- The reqFilters to set.public void registerReplicationSession(DeltaSession session)
session
- cross context sessionpublic void invoke(Request request, Response response) throws java.io.IOException, javax.servlet.ServletException
invoke
in interface Valve
invoke
in class ValveBase
request
- The servlet request to be processedresponse
- The servlet response to be created
java.io.IOException
- if an input/output error occurs
javax.servlet.ServletException
- if a servlet error occurspublic void resetStatistics()
public java.lang.String toString()
toString
in class ValveBase
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster)
request
- totalstart
- isCrossContext
- clusterManager
- containerCluster
- protected void sendCrossContextSession(CatalinaCluster containerCluster)
containerCluster
- protected void resetReplicationRequest(Request request, boolean isCrossContext)
request
- current request after responce is generatedisCrossContext
- check crosscontext threadlocalprotected void resetDeltaRequest(Session session)
session
- HttpSession from current request or cross context sessionprotected void sendSessionReplicationMessage(Request request, ClusterManager manager, CatalinaCluster cluster)
request
- current requestmanager
- session managercluster
- replication clusterprotected void sendMessage(Session session, ClusterManager manager, CatalinaCluster cluster)
session
- current sessionmanager
- session managercluster
- replication clusterprotected void send(ClusterManager manager, CatalinaCluster cluster, java.lang.String sessionId)
manager
- SessionManagercluster
- replication clustersessionId
- sessionid from the managerDeltaManager.requestCompleted(String)
,
SimpleTcpCluster.send(ClusterMessage)
protected void sendInvalidSessions(ClusterManager manager, CatalinaCluster cluster)
manager
- cluster
- protected boolean isRequestWithoutSessionChange(java.lang.String uri)
uri
- The request uri
protected void updateStats(long requestTime, long clusterTime)
requestTime
- clusterTime
- protected void createPrimaryIndicator(Request request) throws java.io.IOException
request
-
java.io.IOException
|
Apache Tomcat 6.0.43 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |