org.apache.catalina.ha.session
public class ReplicatedSession extends StandardSession implements ClusterSession
Version: $Revision: 467222 $ $Date: 2006-10-24 05:17:11 +0200 (Tue, 24 Oct 2006) $
Description:
The ReplicatedSession class is a simple extension of the StandardSession class
It overrides a few methods (setAttribute, removeAttribute, expire, access) and has
hooks into the InMemoryReplicationManager to broadcast and receive events from the cluster.
This class inherits the readObjectData and writeObject data methods from the StandardSession
and does not contain any serializable elements in addition to the inherited ones from the StandardSession
Field Summary | |
---|---|
protected boolean | isDirty |
Constructor Summary | |
---|---|
ReplicatedSession(Manager manager) |
Method Summary | |
---|---|
void | expire() |
int | getAccessCount() |
long | getLastAccessedTime() |
long | getLastAccessWasDistributed() |
long | getThisAccessedTime() |
void | invalidate() |
boolean | isDirty() |
boolean | isPrimarySession()
returns true if this session is the primary session, if that is the
case, the manager can expire it upon timeout. |
protected void | log(String message)
Implements a log method to log through the manager |
protected void | log(String message, Throwable x) |
void | readObjectData(ObjectInputStream stream)
Read a serialized version of the contents of this session object from
the specified object input stream, without requiring that the
StandardSession itself have been serialized.
|
void | removeAttribute(String name) |
void | removeAttribute(String name, boolean notify)
see parent description,
plus we also notify other nodes in the cluster |
void | setAccessCount(int accessCount) |
void | setAttribute(String name, Object value)
Sets an attribute and notifies the other nodes in the cluster |
void | setId(String id, boolean tellNew) |
void | setIsDirty(boolean dirty) |
void | setLastAccessedTime(long lastAccessedTime) |
void | setLastAccessWasDistributed(long time) |
void | setManager(SimpleTcpReplicationManager mgr)
Sets the manager for this session |
void | setMaxInactiveInterval(int interval) |
void | setPrimarySession(boolean primarySession)
Sets whether this is the primary session or not. |
void | setPrincipal(Principal principal)
Set the authenticated Principal that is associated with this Session.
|
void | setThisAccessedTime(long thisAccessedTime) |
String | toString() |
void | writeObjectData(ObjectOutputStream stream)
Write a serialized version of the contents of this session object to
the specified object output stream, without requiring that the
StandardSession itself have been serialized.
|
Parameters: stream The object input stream to read from
Throws: ClassNotFoundException if an unknown class is specified IOException if an input/output error occurs
Parameters: mgr - the servers InMemoryReplicationManager
Parameters: primarySession Flag value
Authenticator
with a means to cache a
previously authenticated Principal, and avoid potentially expensive
Realm.authenticate()
calls on every request.
Parameters: principal The new Principal, or null
if none
Parameters: stream The object output stream to write to
Throws: IOException if an input/output error occurs