Home » apache-tomcat-6.0.26-src » org.apache » catalina » cluster » session » [javadoc | source]
org.apache.catalina.cluster.session
public class: ReplicatedSession [javadoc | source]
java.lang.Object
   org.apache.catalina.session.StandardSession
      org.apache.catalina.cluster.session.ReplicatedSession

All Implemented Interfaces:
    ClusterSession, HttpSession, Session, Serializable

Title: Tomcat Session Replication for Tomcat 4.0
Description: A very simple straight forward implementation of session replication of servers in a cluster.
This session replication is implemented "live". By live I mean, when a session attribute is added into a session on Node A a message is broadcasted to other messages and setAttribute is called on the replicated sessions.
A full description of this implementation can be found under Filip's Tomcat Page
Copyright: See apache license
Field Summary
protected  boolean isDirty     
Fields inherited from org.apache.catalina.session.StandardSession:
ACTIVITY_CHECK,  EMPTY_ARRAY,  NOT_SERIALIZED,  attributes,  authType,  creationTime,  excludedAttributes,  expiring,  facade,  id,  info,  lastAccessedTime,  listeners,  manager,  maxInactiveInterval,  isNew,  isValid,  notes,  principal,  sm,  sessionContext,  support,  thisAccessedTime,  accessCount
Constructor:
 public ReplicatedSession(Manager manager) 
Method from org.apache.catalina.cluster.session.ReplicatedSession Summary:
expire,   getAccessCount,   getLastAccessWasDistributed,   getLastAccessedTime,   getThisAccessedTime,   invalidate,   isDirty,   isPrimarySession,   log,   log,   readObjectData,   removeAttribute,   removeAttribute,   setAccessCount,   setAttribute,   setId,   setIsDirty,   setLastAccessWasDistributed,   setLastAccessedTime,   setManager,   setMaxInactiveInterval,   setPrimarySession,   setPrincipal,   setThisAccessedTime,   toString,   writeObjectData
Methods from org.apache.catalina.session.StandardSession:
access,   activate,   addSessionListener,   endAccess,   exclude,   expire,   expire,   fireContainerEvent,   fireSessionEvent,   getAttribute,   getAttributeNames,   getAuthType,   getCreationTime,   getId,   getIdInternal,   getInfo,   getLastAccessedTime,   getLastAccessedTimeInternal,   getManager,   getMaxInactiveInterval,   getNote,   getNoteNames,   getPrincipal,   getServletContext,   getSession,   getSessionContext,   getValue,   getValueNames,   invalidate,   isNew,   isValid,   isValidInternal,   keys,   passivate,   putValue,   readObject,   readObjectData,   recycle,   removeAttribute,   removeAttribute,   removeAttributeInternal,   removeNote,   removeSessionListener,   removeValue,   setAttribute,   setAttribute,   setAuthType,   setCreationTime,   setId,   setManager,   setMaxInactiveInterval,   setNew,   setNote,   setPrincipal,   setValid,   tellNew,   toString,   writeObject,   writeObjectData
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.catalina.cluster.session.ReplicatedSession Detail:
 public  void expire() 
 public int getAccessCount() 
 public long getLastAccessWasDistributed() 
 public long getLastAccessedTime() 
 public long getThisAccessedTime() 
 public  void invalidate() 
 public boolean isDirty() 
 public 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) 
 public  void readObjectData(ObjectInputStream stream) throws ClassNotFoundException, IOException 
    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.
 public  void removeAttribute(String name) 
 public  void removeAttribute(String name,
    boolean notify) 
    see parent description, plus we also notify other nodes in the cluster
 public  void setAccessCount(int accessCount) 
 public  void setAttribute(String name,
    Object value) 
    Sets an attribute and notifies the other nodes in the cluster
 public  void setId(String id,
    boolean tellNew) 
 public  void setIsDirty(boolean dirty) 
 public  void setLastAccessWasDistributed(long time) 
 public  void setLastAccessedTime(long lastAccessedTime) 
 public  void setManager(SimpleTcpReplicationManager mgr) 
    Sets the manager for this session
 public  void setMaxInactiveInterval(int interval) 
 public  void setPrimarySession(boolean primarySession) 
    Sets whether this is the primary session or not.
 public  void setPrincipal(Principal principal) 
    Set the authenticated Principal that is associated with this Session. This provides an Authenticator with a means to cache a previously authenticated Principal, and avoid potentially expensive Realm.authenticate() calls on every request.
 public  void setThisAccessedTime(long thisAccessedTime) 
 public String toString() 
 public  void writeObjectData(ObjectOutputStream stream) throws IOException 
    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.