|Method from org.apache.catalina.cluster.session.SimpleTcpReplicationManager Detail:|
public Session createSession(String sessionId)
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
protected Session createSession(String sessionId,
Creates a HTTP session.
Most of the code in here is copied from the StandardManager.
This is not pretty, yeah I know, but it was necessary since the
StandardManager had hard coded the session instantiation to the a
StandardSession, when we actually want to instantiate a ReplicatedSession
If the call comes from the Tomcat servlet engine, a SessionMessage goes out to the other
nodes in the cluster that this session has been created.
public CatalinaCluster getCluster()
public boolean getDistributable()
public boolean getExpireSessionsOnShutdown()
public String getInvalidatedSessions()
public String getName()
public boolean isDefaultMode()
public boolean isManagerRunning()
public boolean isNotifyListenersOnReplication()
public boolean isSendClusterDomainOnly()
public boolean isStateTransferred()
public void messageDataReceived(ClusterMessage cmsg)
protected void messageReceived(SessionMessage msg,
This method is called by the received thread when a SessionMessage has
been received from one of the other nodes in the cluster.
protected Session readSession(byte data,
Reinstantiates a serialized session from the data passed in.
This will first call createSession() so that we get a fresh instance with all
the managers set and all the transient fields validated.
Then it calls Session.readObjectData(byte) to deserialize the object
public ClusterMessage requestCompleted(String sessionId)
public void sessionInvalidated(String sessionId)
public void setCluster(CatalinaCluster cluster)
public void setDefaultMode(boolean defaultMode)
public void setDistributable(boolean dist)
public void setExpireSessionsOnShutdown(boolean expireSessionsOnShutdown)
public void setName(String name)
public void setNotifyListenersOnReplication(boolean notifyListenersOnReplication)
public void setPrintToScreen(boolean printtoscreen)
public void setSendClusterDomainOnly(boolean sendClusterDomainOnly)
public void setSynchronousReplication(boolean flag)
public void setUseDirtyFlag(boolean usedirtyflag)
public void start() throws LifecycleException
Prepare for the beginning of active use of the public methods of this
component. This method should be called after
and before any of the public methods of the component are utilized.
Starts the cluster communication channel, this will connect with the other nodes
in the cluster, and request the current session state to be transferred to this node.
public void stop() throws LifecycleException
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.
This will disconnect the cluster communication channel and stop the listener thread.
public void unload() throws IOException
Override persistence since they don't go hand in hand with replication for now.
protected byte writeSession(Session session)
Serialize a session into a byte array
This method simple calls the writeObjectData method on the session
and returns the byte data from that call