Java Doc for ReplicationValve.java in  » Sevlet-Container » apache-tomcat-6.0.14 » org » apache » catalina » ha » tcp » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Sevlet Container » apache tomcat 6.0.14 » org.apache.catalina.ha.tcp 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.catalina.valves.ValveBase
      org.apache.catalina.ha.tcp.ReplicationValve

ReplicationValve
public class ReplicationValve extends ValveBase implements ClusterValve(Code)

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.


author:
   Craig R. McClanahan
author:
   Filip Hanik
author:
   Peter Rossbach
version:
   $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $


Field Summary
protected  ThreadLocalcrossContextSessions
    
protected  booleandoProcessingStats
    
protected  Stringfilter
    
protected  longlastSendTime
    
protected  longnrOfCrossContextSendRequests
    
protected  longnrOfFilterRequests
    
protected  longnrOfRequests
    
protected  longnrOfSendRequests
    
protected  booleanprimaryIndicator
    
protected  StringprimaryIndicatorName
    
protected  java.util.regex.Pattern[]reqFilters
    
protected static  StringManagersm
     The StringManager for this package.
protected  longtotalRequestTime
    
protected  longtotalSendTime
    

Constructor Summary
public  ReplicationValve()
    

Method Summary
protected  voidcreatePrimaryIndicator(Request request)
    
public  booleandoStatistics()
    
public  CatalinaClustergetCluster()
    
public  StringgetFilter()
    
public  StringgetInfo()
     Return descriptive information about this Valve implementation.
public  longgetLastSendTime()
    
public  longgetNrOfCrossContextSendRequests()
    
public  longgetNrOfFilterRequests()
    
public  longgetNrOfRequests()
    
public  longgetNrOfSendRequests()
    
public  StringgetPrimaryIndicatorName()
    
protected  java.util.regex.Pattern[]getReqFilters()
    
public  longgetTotalRequestTime()
    
public  longgetTotalSendTime()
    
public  voidinvoke(Request request, Response response)
     Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.
public  booleanisPrimaryIndicator()
    
protected  booleanisRequestWithoutSessionChange(String uri)
    
public  voidregisterReplicationSession(DeltaSession session)
     Register all cross context sessions inside endAccess.
protected  voidresetDeltaRequest(Session session)
    
protected  voidresetReplicationRequest(Request request, boolean isCrossContext)
    
public  voidresetStatistics()
    
protected  voidsend(ClusterManager manager, CatalinaCluster cluster, String sessionId)
    
protected  voidsendCrossContextSession(CatalinaCluster containerCluster)
    
protected  voidsendInvalidSessions(ClusterManager manager, CatalinaCluster cluster)
    
protected  voidsendMessage(Session session, ClusterManager manager, CatalinaCluster cluster)
    
protected  voidsendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster)
    
protected  voidsendSessionReplicationMessage(Request request, ClusterManager manager, CatalinaCluster cluster)
    
public  voidsetCluster(CatalinaCluster cluster)
    
public  voidsetFilter(String filter)
    
public  voidsetPrimaryIndicator(boolean primaryIndicator)
    
public  voidsetPrimaryIndicatorName(String primaryIndicatorName)
    
protected  voidsetReqFilters(java.util.regex.Pattern[] reqFilters)
    
public  voidsetStatistics(boolean doProcessingStats)
    
public  StringtoString()
     Return a String rendering of this object.
protected  voidupdateStats(long requestTime, long clusterTime)
    

Field Detail
crossContextSessions
protected ThreadLocal crossContextSessions(Code)
crossContext session container



doProcessingStats
protected boolean doProcessingStats(Code)
doProcessingStats (default = off)



filter
protected String filter(Code)
Orginal filter



lastSendTime
protected long lastSendTime(Code)



nrOfCrossContextSendRequests
protected long nrOfCrossContextSendRequests(Code)



nrOfFilterRequests
protected long nrOfFilterRequests(Code)



nrOfRequests
protected long nrOfRequests(Code)



nrOfSendRequests
protected long nrOfSendRequests(Code)



primaryIndicator
protected boolean primaryIndicator(Code)
must primary change indicator set



primaryIndicatorName
protected String primaryIndicatorName(Code)
Name of primary change indicator as request attribute



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



sm
protected static StringManager sm(Code)
The StringManager for this package.



totalRequestTime
protected long totalRequestTime(Code)



totalSendTime
protected long totalSendTime(Code)




Constructor Detail
ReplicationValve
public ReplicationValve()(Code)




Method Detail
createPrimaryIndicator
protected void createPrimaryIndicator(Request request) throws IOException(Code)
Mark Request that processed at primary node with attribute primaryIndicatorName
Parameters:
  request -
throws:
  IOException -



doStatistics
public boolean doStatistics()(Code)
Calc processing stats



getCluster
public CatalinaCluster getCluster()(Code)
Returns the cluster.



getFilter
public String getFilter()(Code)
Returns the filter



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



getLastSendTime
public long getLastSendTime()(Code)
Returns the lastSendTime.



getNrOfCrossContextSendRequests
public long getNrOfCrossContextSendRequests()(Code)
Returns the nrOfCrossContextSendRequests.



getNrOfFilterRequests
public long getNrOfFilterRequests()(Code)
Returns the nrOfFilterRequests.



getNrOfRequests
public long getNrOfRequests()(Code)
Returns the nrOfRequests.



getNrOfSendRequests
public long getNrOfSendRequests()(Code)
Returns the nrOfSendRequests.



getPrimaryIndicatorName
public String getPrimaryIndicatorName()(Code)
Returns the primaryIndicatorName.



getReqFilters
protected java.util.regex.Pattern[] getReqFilters()(Code)
Returns the reqFilters.



getTotalRequestTime
public long getTotalRequestTime()(Code)
Returns the totalRequestTime.



getTotalSendTime
public long getTotalSendTime()(Code)
Returns the totalSendTime.



invoke
public void invoke(Request request, Response response) throws IOException, ServletException(Code)
Log the interesting request parameters, invoke the next Valve in the sequence, and log the interesting response parameters.
Parameters:
  request - The servlet request to be processed
Parameters:
  response - The servlet response to be created
exception:
  IOException - if an input/output error occurs
exception:
  ServletException - if a servlet error occurs



isPrimaryIndicator
public boolean isPrimaryIndicator()(Code)
Returns the primaryIndicator.



isRequestWithoutSessionChange
protected boolean isRequestWithoutSessionChange(String uri)(Code)
is request without possible session change
Parameters:
  uri - The request uri True if no session change



registerReplicationSession
public void registerReplicationSession(DeltaSession session)(Code)
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.
Parameters:
  session - cross context session



resetDeltaRequest
protected void resetDeltaRequest(Session session)(Code)
Reset DeltaRequest from session
Parameters:
  session - HttpSession from current request or cross context session



resetReplicationRequest
protected void resetReplicationRequest(Request request, boolean isCrossContext)(Code)
Fix memory leak for long sessions with many changes, when no backup member exists!
Parameters:
  request - current request after responce is generated
Parameters:
  isCrossContext - check crosscontext threadlocal



resetStatistics
public void resetStatistics()(Code)
reset the active statitics



send
protected void send(ClusterManager manager, CatalinaCluster cluster, String sessionId)(Code)
send manager requestCompleted message to cluster
Parameters:
  manager - SessionManager
Parameters:
  cluster - replication cluster
Parameters:
  sessionId - sessionid from the manager
See Also:   DeltaManager.requestCompleted(String)
See Also:   SimpleTcpCluster.send(ClusterMessage)



sendCrossContextSession
protected void sendCrossContextSession(CatalinaCluster containerCluster)(Code)
Send all changed cross context sessions to backups
Parameters:
  containerCluster -



sendInvalidSessions
protected void sendInvalidSessions(ClusterManager manager, CatalinaCluster cluster)(Code)
check for session invalidations
Parameters:
  manager -
Parameters:
  cluster -



sendMessage
protected void sendMessage(Session session, ClusterManager manager, CatalinaCluster cluster)(Code)
Send message delta message from request session
Parameters:
  request - current request
Parameters:
  manager - session manager
Parameters:
  cluster - replication cluster



sendReplicationMessage
protected void sendReplicationMessage(Request request, long totalstart, boolean isCrossContext, ClusterManager clusterManager, CatalinaCluster containerCluster)(Code)

Parameters:
  request -
Parameters:
  totalstart -
Parameters:
  isCrossContext -
Parameters:
  clusterManager -
Parameters:
  containerCluster -



sendSessionReplicationMessage
protected void sendSessionReplicationMessage(Request request, ClusterManager manager, CatalinaCluster cluster)(Code)
Send Cluster Replication Request
Parameters:
  request - current request
Parameters:
  manager - session manager
Parameters:
  cluster - replication cluster



setCluster
public void setCluster(CatalinaCluster cluster)(Code)

Parameters:
  cluster - The cluster to set.



setFilter
public void setFilter(String filter)(Code)
compile filter string to regular expressions
See Also:   Pattern.compile(java.lang.String)
Parameters:
  filter - The filter to set.



setPrimaryIndicator
public void setPrimaryIndicator(boolean primaryIndicator)(Code)

Parameters:
  primaryIndicator - The primaryIndicator to set.



setPrimaryIndicatorName
public void setPrimaryIndicatorName(String primaryIndicatorName)(Code)

Parameters:
  primaryIndicatorName - The primaryIndicatorName to set.



setReqFilters
protected void setReqFilters(java.util.regex.Pattern[] reqFilters)(Code)

Parameters:
  reqFilters - The reqFilters to set.



setStatistics
public void setStatistics(boolean doProcessingStats)(Code)
Set Calc processing stats
See Also:   ReplicationValve.resetStatistics()



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



updateStats
protected void updateStats(long requestTime, long clusterTime)(Code)
protocol cluster replications stats
Parameters:
  requestTime -
Parameters:
  clusterTime -



Fields inherited from org.apache.catalina.valves.ValveBase
protected Container container(Code)(Java Doc)
protected Log containerLog(Code)(Java Doc)
protected ObjectName controller(Code)(Java Doc)
protected String domain(Code)(Java Doc)
protected static String info(Code)(Java Doc)
protected MBeanServer mserver(Code)(Java Doc)
protected Valve next(Code)(Java Doc)
protected ObjectName oname(Code)(Java Doc)
final protected static StringManager sm(Code)(Java Doc)

Methods inherited from org.apache.catalina.valves.ValveBase
public void backgroundProcess()(Code)(Java Doc)
public ObjectName createObjectName(String domain, ObjectName parent) throws MalformedObjectNameException(Code)(Java Doc)
public void event(Request request, Response response, CometEvent event) throws IOException, ServletException(Code)(Java Doc)
public Container getContainer()(Code)(Java Doc)
public ObjectName getContainerName()(Code)(Java Doc)
public ObjectName getController()(Code)(Java Doc)
public String getDomain()(Code)(Java Doc)
public String getInfo()(Code)(Java Doc)
public Valve getNext()(Code)(Java Doc)
public ObjectName getObjectName()(Code)(Java Doc)
public ObjectName getParentName(ObjectName valveName)(Code)(Java Doc)
abstract public void invoke(Request request, Response response) throws IOException, ServletException(Code)(Java Doc)
public void postDeregister()(Code)(Java Doc)
public void postRegister(Boolean registrationDone)(Code)(Java Doc)
public void preDeregister() throws Exception(Code)(Java Doc)
public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception(Code)(Java Doc)
public void setContainer(Container container)(Code)(Java Doc)
public void setController(ObjectName controller)(Code)(Java Doc)
public void setNext(Valve valve)(Code)(Java Doc)
public void setObjectName(ObjectName oname)(Code)(Java Doc)
public String toString()(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.