Java Doc for DeltaManager.java in  » Sevlet-Container » tomcat-cluster » org » apache » catalina » cluster » session » 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 » tomcat cluster » org.apache.catalina.cluster.session 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.catalina.session.ManagerBase
      org.apache.catalina.cluster.session.DeltaManager

DeltaManager
public class DeltaManager extends ManagerBase implements Lifecycle,PropertyChangeListener,ClusterManager(Code)
The DeltaManager manages replicated sessions by only replicating the deltas in data. For applications written to handle this, the DeltaManager is the optimal way of replicating data. This code is almost identical to StandardManager with a difference in how it persists sessions and some modifications to it. IMPLEMENTATION NOTE: Correct behavior of session storing and reloading depends upon external calls to the start() and stop() methods of this class at the correct times.
author:
   Filip Hanik
author:
   Craig R. McClanahan
author:
   Jean-Francois Arcand
version:
   $Revision: 1.27 $ $Date: 2004/06/04 20:22:27 $


Field Summary
 intexpiredSessions
    
protected  LifecycleSupportlifecycle
     The lifecycle event support for this component.
public static  org.apache.commons.logging.Loglog
    
protected static  StringmanagerName
     The descriptive name of this Manager implementation (for logging).
protected  Stringname
    
 longprocessingTime
    
 intrejectedSessions
    

Constructor Summary
public  DeltaManager()
    

Method Summary
public  voidaddLifecycleListener(LifecycleListener listener)
     Add a lifecycle event listener to this component.
public  voidbackgroundProcess()
    
public  SessioncreateSession()
     Construct and return a new session object, based on the default settings specified by this Manager's properties.
public  SessioncreateSession(boolean distribute)
    
public  LifecycleListener[]findLifecycleListeners()
     Get the lifecycle listeners associated with this lifecycle.
public  CatalinaClustergetCluster()
    
public  booleangetExpireSessionsOnShutdown()
    
public  intgetExpiredSessions()
     Number of sessions that expired.
public  StringgetInfo()
     Return descriptive information about this Manager implementation and the corresponding version number, in the format <description>/<version>.
public  String[]getInvalidatedSessions()
     When the manager expires session not tied to a request.
public  intgetMaxActiveSessions()
     Return the maximum number of active Sessions allowed, or -1 for no limit.
public  StringgetName()
     Return the descriptive short name of this Manager implementation.
protected  DeltaSessiongetNewDeltaSession()
     Get new session class to be used in the doLoad() method.
public  StringgetPathname()
     Return the session persistence pathname, if any.
public  booleangetPrintToScreen()
    
public  longgetProcessingTime()
    
public  intgetRejectedSessions()
    
public  booleangetStateTransferred()
    
public  booleangetUseDirtyFlag()
    
public  voidload()
    
public  voidmessageDataReceived(SessionMessage msg)
     A message was received from another node, this is the callback method to implement if you are interested in receiving replication messages.
protected  voidmessageReceived(SessionMessage msg, Member sender)
     This method is called by the received thread when a SessionMessage has been received from one of the other nodes in the cluster.
public  voidprocessExpires()
     Invalidate all sessions that have expired.
public  voidpropertyChange(PropertyChangeEvent event)
     Process property change events from our associated Context.
public  voidremoveLifecycleListener(LifecycleListener listener)
     Remove a lifecycle event listener from this component.
public  SessionMessagerequestCompleted(String sessionId)
     When the request has been completed, the replication valve will notify the manager, and the manager will decide whether any replication is needed or not. If there is a need for replication, the manager will create a session message and that will be replicated. The cluster determines where it gets sent.
Parameters:
  sessionId - - the sessionId that just completed.
protected  voidsessionExpired(String id)
    
public  voidsetCluster(CatalinaCluster cluster)
    
public  voidsetContainer(Container container)
     Set the Container with which this Manager has been associated.
public  voidsetExpireSessionsOnShutdown(boolean expireSessionsOnShutdown)
    
public  voidsetExpiredSessions(int expiredSessions)
    
public  voidsetMaxActiveSessions(int max)
     Set the maximum number of actives Sessions allowed, or -1 for no limit.
public  voidsetName(String name)
    
public  voidsetPathname(String pathname)
     Set the session persistence pathname to the specified value.
public  voidsetPrintToScreen(boolean printToScreen)
    
public  voidsetProcessingTime(long processingTime)
    
public  voidsetRejectedSessions(int rejectedSessions)
    
public  voidsetStateTransferred(boolean stateTransferred)
    
public  voidsetUseDirtyFlag(boolean useDirtyFlag)
    
public  voidstart()
     Prepare for the beginning of active use of the public methods of this component.
public  voidstop()
     Gracefully terminate the active use of the public methods of this component.
public  voidunload()
    

Field Detail
expiredSessions
int expiredSessions(Code)



lifecycle
protected LifecycleSupport lifecycle(Code)
The lifecycle event support for this component.



log
public static org.apache.commons.logging.Log log(Code)



managerName
protected static String managerName(Code)
The descriptive name of this Manager implementation (for logging).



name
protected String name(Code)



processingTime
long processingTime(Code)



rejectedSessions
int rejectedSessions(Code)




Constructor Detail
DeltaManager
public DeltaManager()(Code)




Method Detail
addLifecycleListener
public void addLifecycleListener(LifecycleListener listener)(Code)
Add a lifecycle event listener to this component.
Parameters:
  listener - The listener to add



backgroundProcess
public void backgroundProcess()(Code)



createSession
public Session createSession()(Code)
Construct and return a new session object, based on the default settings specified by this Manager's properties. The session id will be assigned by this method, and available via the getId() method of the returned session. If a new session cannot be created for any reason, return null.
exception:
  IllegalStateException - if a new session cannot beinstantiated for any reasonConstruct and return a new session object, based on the defaultsettings specified by this Manager's properties. The sessionid will be assigned by this method, and available via the getId()method of the returned session. If a new session cannot be createdfor any reason, return null.
exception:
  IllegalStateException - if a new session cannot beinstantiated for any reason



createSession
public Session createSession(boolean distribute)(Code)



findLifecycleListeners
public LifecycleListener[] findLifecycleListeners()(Code)
Get the lifecycle listeners associated with this lifecycle. If this Lifecycle has no listeners registered, a zero-length array is returned.



getCluster
public CatalinaCluster getCluster()(Code)



getExpireSessionsOnShutdown
public boolean getExpireSessionsOnShutdown()(Code)



getExpiredSessions
public int getExpiredSessions()(Code)
Number of sessions that expired. The count



getInfo
public String getInfo()(Code)
Return descriptive information about this Manager implementation and the corresponding version number, in the format <description>/<version>.



getInvalidatedSessions
public String[] getInvalidatedSessions()(Code)
When the manager expires session not tied to a request. The cluster will periodically ask for a list of sessions that should expire and that should be sent across the wire.



getMaxActiveSessions
public int getMaxActiveSessions()(Code)
Return the maximum number of active Sessions allowed, or -1 for no limit.



getName
public String getName()(Code)
Return the descriptive short name of this Manager implementation.



getNewDeltaSession
protected DeltaSession getNewDeltaSession()(Code)
Get new session class to be used in the doLoad() method.



getPathname
public String getPathname()(Code)
Return the session persistence pathname, if any.



getPrintToScreen
public boolean getPrintToScreen()(Code)



getProcessingTime
public long getProcessingTime()(Code)



getRejectedSessions
public int getRejectedSessions()(Code)
Number of session creations that failed due to maxActiveSessions The count



getStateTransferred
public boolean getStateTransferred()(Code)



getUseDirtyFlag
public boolean getUseDirtyFlag()(Code)



load
public void load()(Code)



messageDataReceived
public void messageDataReceived(SessionMessage msg)(Code)
A message was received from another node, this is the callback method to implement if you are interested in receiving replication messages.
Parameters:
  msg - - the message received.



messageReceived
protected void messageReceived(SessionMessage msg, Member sender)(Code)
This method is called by the received thread when a SessionMessage has been received from one of the other nodes in the cluster.
Parameters:
  msg - - the message received
Parameters:
  sender - - the sender of the message, this is used if we receive aEVT_GET_ALL_SESSION message, so that we only reply tothe requesting node



processExpires
public void processExpires()(Code)
Invalidate all sessions that have expired.



propertyChange
public void propertyChange(PropertyChangeEvent event)(Code)
Process property change events from our associated Context.
Parameters:
  event - The property change event that has occurred



removeLifecycleListener
public void removeLifecycleListener(LifecycleListener listener)(Code)
Remove a lifecycle event listener from this component.
Parameters:
  listener - The listener to remove



requestCompleted
public SessionMessage requestCompleted(String sessionId)(Code)
When the request has been completed, the replication valve will notify the manager, and the manager will decide whether any replication is needed or not. If there is a need for replication, the manager will create a session message and that will be replicated. The cluster determines where it gets sent.
Parameters:
  sessionId - - the sessionId that just completed. a SessionMessage to be sent,



sessionExpired
protected void sessionExpired(String id)(Code)



setCluster
public void setCluster(CatalinaCluster cluster)(Code)



setContainer
public void setContainer(Container container)(Code)
Set the Container with which this Manager has been associated. If it is a Context (the usual case), listen for changes to the session timeout property.
Parameters:
  container - The associated Container



setExpireSessionsOnShutdown
public void setExpireSessionsOnShutdown(boolean expireSessionsOnShutdown)(Code)



setExpiredSessions
public void setExpiredSessions(int expiredSessions)(Code)



setMaxActiveSessions
public void setMaxActiveSessions(int max)(Code)
Set the maximum number of actives Sessions allowed, or -1 for no limit.
Parameters:
  max - The new maximum number of sessions



setName
public void setName(String name)(Code)



setPathname
public void setPathname(String pathname)(Code)
Set the session persistence pathname to the specified value. If no persistence support is desired, set the pathname to null.
Parameters:
  pathname - New session persistence pathname



setPrintToScreen
public void setPrintToScreen(boolean printToScreen)(Code)



setProcessingTime
public void setProcessingTime(long processingTime)(Code)



setRejectedSessions
public void setRejectedSessions(int rejectedSessions)(Code)



setStateTransferred
public void setStateTransferred(boolean stateTransferred)(Code)



setUseDirtyFlag
public void setUseDirtyFlag(boolean useDirtyFlag)(Code)



start
public void start() throws LifecycleException(Code)
Prepare for the beginning of active use of the public methods of this component. This method should be called after configure(), and before any of the public methods of the component are utilized.
exception:
  LifecycleException - if this component detects a fatal errorthat prevents this component from being used



stop
public void stop() throws LifecycleException(Code)
Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component.
exception:
  LifecycleException - if this component detects a fatal errorthat needs to be reported



unload
public void unload()(Code)



Fields inherited from org.apache.catalina.session.ManagerBase
final protected static String DEFAULT_ALGORITHM(Code)(Java Doc)
protected String algorithm(Code)(Java Doc)
protected Container container(Code)(Java Doc)
protected int debug(Code)(Java Doc)
protected DefaultContext defaultContext(Code)(Java Doc)
protected String devRandomSource(Code)(Java Doc)
protected MessageDigest digest(Code)(Java Doc)
protected boolean distributable(Code)(Java Doc)
protected String domain(Code)(Java Doc)
protected int duplicates(Code)(Java Doc)
protected String entropy(Code)(Java Doc)
protected boolean initialized(Code)(Java Doc)
protected Log log(Code)(Java Doc)
protected int maxActive(Code)(Java Doc)
protected int maxInactiveInterval(Code)(Java Doc)
protected MBeanServer mserver(Code)(Java Doc)
protected static String name(Code)(Java Doc)
protected ObjectName oname(Code)(Java Doc)
protected Random random(Code)(Java Doc)
protected String randomClass(Code)(Java Doc)
protected DataInputStream randomIS(Code)(Java Doc)
protected int sessionCounter(Code)(Java Doc)
protected int sessionIdLength(Code)(Java Doc)
protected HashMap sessions(Code)(Java Doc)
protected static StringManager sm(Code)(Java Doc)
protected PropertyChangeSupport support(Code)(Java Doc)

Methods inherited from org.apache.catalina.session.ManagerBase
public void add(Session session)(Code)(Java Doc)
public void addPropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
public void backgroundProcess()(Code)(Java Doc)
public Session createEmptySession()(Code)(Java Doc)
public Session createSession()(Code)(Java Doc)
public void destroy()(Code)(Java Doc)
public void expireSession(String sessionId)(Code)(Java Doc)
public Session findSession(String id) throws IOException(Code)(Java Doc)
public Session[] findSessions()(Code)(Java Doc)
protected synchronized String generateSessionId()(Code)(Java Doc)
public int getActiveSessions()(Code)(Java Doc)
public String getAlgorithm()(Code)(Java Doc)
public String getClassName()(Code)(Java Doc)
public Container getContainer()(Code)(Java Doc)
public int getDebug()(Code)(Java Doc)
public DefaultContext getDefaultContext()(Code)(Java Doc)
public synchronized MessageDigest getDigest()(Code)(Java Doc)
public boolean getDistributable()(Code)(Java Doc)
public String getDomain()(Code)(Java Doc)
public int getDuplicates()(Code)(Java Doc)
public Engine getEngine()(Code)(Java Doc)
public String getEntropy()(Code)(Java Doc)
public String getInfo()(Code)(Java Doc)
public String getJvmRoute()(Code)(Java Doc)
public String getLastAccessedTime(String sessionId)(Code)(Java Doc)
public int getMaxActive()(Code)(Java Doc)
public int getMaxInactiveInterval()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
protected StandardSession getNewSession()(Code)(Java Doc)
public ObjectName getObjectName()(Code)(Java Doc)
public synchronized Random getRandom()(Code)(Java Doc)
protected void getRandomBytes(byte bytes)(Code)(Java Doc)
public String getRandomClass()(Code)(Java Doc)
public String getRandomFile()(Code)(Java Doc)
public String getSessionAttribute(String sessionId, String key)(Code)(Java Doc)
public int getSessionCounter()(Code)(Java Doc)
public int getSessionIdLength()(Code)(Java Doc)
public void init()(Code)(Java Doc)
public String listSessionIds()(Code)(Java Doc)
protected void log(String message)(Code)(Java Doc)
protected void log(String message, Throwable throwable)(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 remove(Session session)(Code)(Java Doc)
public void removePropertyChangeListener(PropertyChangeListener listener)(Code)(Java Doc)
public void setAlgorithm(String algorithm)(Code)(Java Doc)
public void setContainer(Container container)(Code)(Java Doc)
public void setDebug(int debug)(Code)(Java Doc)
public void setDefaultContext(DefaultContext defaultContext)(Code)(Java Doc)
public void setDistributable(boolean distributable)(Code)(Java Doc)
public void setDuplicates(int duplicates)(Code)(Java Doc)
public void setEntropy(String entropy)(Code)(Java Doc)
public void setMaxActive(int maxActive)(Code)(Java Doc)
public void setMaxInactiveInterval(int interval)(Code)(Java Doc)
public void setRandomClass(String randomClass)(Code)(Java Doc)
public void setRandomFile(String s)(Code)(Java Doc)
public void setSessionCounter(int sessionCounter)(Code)(Java Doc)
public void setSessionIdLength(int idLength)(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.