org.apache.catalina.ha.session
public class ReplicatedSession extends StandardSession implements ClusterSession
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isDirty |
accessCount, ACTIVITY_CHECK, attributes, authType, creationTime, EMPTY_ARRAY, excludedAttributes, expiring, facade, id, info, isNew, isValid, lastAccessedTime, listeners, manager, maxInactiveInterval, NOT_SERIALIZED, notes, principal, sessionContext, sm, support, thisAccessedTimeSESSION_ACTIVATED_EVENT, SESSION_CREATED_EVENT, SESSION_DESTROYED_EVENT, SESSION_PASSIVATED_EVENT| Constructor and Description |
|---|
ReplicatedSession(Manager manager) |
| Modifier and Type | Method and Description |
|---|---|
void |
expire()
Perform the internal processing required to invalidate this session,
without triggering an exception if the session has already expired.
|
int |
getAccessCount() |
long |
getLastAccessedTime()
Return the last time the client sent a request associated with this
session, as the number of milliseconds since midnight, January 1, 1970
GMT.
|
long |
getLastAccessWasDistributed() |
long |
getThisAccessedTime() |
void |
invalidate()
Invalidates this session and unbinds any objects bound to it.
|
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(java.lang.String message)
Implements a log method to log through the manager
|
protected void |
log(java.lang.String message,
java.lang.Throwable x) |
void |
readObjectData(java.io.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(java.lang.String name)
Remove the object bound with the specified name from this session.
|
void |
removeAttribute(java.lang.String name,
boolean notify)
see parent description,
plus we also notify other nodes in the cluster
|
void |
setAccessCount(int accessCount) |
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Sets an attribute and notifies the other nodes in the cluster
|
void |
setId(java.lang.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)
Set the maximum time interval, in seconds, between client requests
before the servlet container will invalidate the session.
|
void |
setPrimarySession(boolean primarySession)
Sets whether this is the primary session or not.
|
void |
setPrincipal(java.security.Principal principal)
Set the authenticated Principal that is associated with this Session.
|
void |
setThisAccessedTime(long thisAccessedTime) |
java.lang.String |
toString()
Return a string representation of this object.
|
void |
writeObjectData(java.io.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.
|
access, activate, addSessionListener, endAccess, exclude, expire, fireContainerEvent, fireSessionEvent, getAttribute, getAttributeNames, getAuthType, getCreationTime, getId, getIdInternal, getInfo, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, getPrincipal, getServletContext, getSession, getSessionContext, getValue, getValueNames, isNew, isValid, isValidInternal, keys, passivate, putValue, readObject, recycle, removeAttributeInternal, removeNote, removeSessionListener, removeValue, setAttribute, setAuthType, setCreationTime, setId, setManager, setNew, setNote, setValid, tellNew, writeObjectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaccess, addSessionListener, endAccess, getAuthType, getCreationTime, getId, getIdInternal, getInfo, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, getPrincipal, getSession, isValid, recycle, removeNote, removeSessionListener, setAuthType, setCreationTime, setId, setManager, setNew, setNote, setValidpublic ReplicatedSession(Manager manager)
public boolean isDirty()
public void setIsDirty(boolean dirty)
public void setLastAccessWasDistributed(long time)
public long getLastAccessWasDistributed()
public void removeAttribute(java.lang.String name)
StandardSession
After this method executes, and if the object implements
HttpSessionBindingListener, the container calls
valueUnbound() on the object.
removeAttribute in interface javax.servlet.http.HttpSessionremoveAttribute in class StandardSessionname - Name of the object to remove from this session.public void removeAttribute(java.lang.String name,
boolean notify)
removeAttribute in class StandardSessionname - Name of the object to remove from this session.notify - Should we notify interested listeners that this
attribute is being removed?public void setAttribute(java.lang.String name,
java.lang.Object value)
setAttribute in interface javax.servlet.http.HttpSessionsetAttribute in class StandardSessionname - Name to which the object is bound, cannot be nullvalue - Object to be bound, cannot be nullpublic void setMaxInactiveInterval(int interval)
StandardSessionsetMaxInactiveInterval in interface javax.servlet.http.HttpSessionsetMaxInactiveInterval in interface SessionsetMaxInactiveInterval in class StandardSessioninterval - The new maximum intervalpublic void setManager(SimpleTcpReplicationManager mgr)
mgr - - the servers InMemoryReplicationManagerpublic void setPrincipal(java.security.Principal principal)
Authenticator with a means to cache a
previously authenticated Principal, and avoid potentially expensive
Realm.authenticate() calls on every request.setPrincipal in interface SessionsetPrincipal in class StandardSessionprincipal - The new Principal, or null if nonepublic void expire()
StandardSessionexpire in interface Sessionexpire in class StandardSessionpublic void invalidate()
StandardSessioninvalidate in interface javax.servlet.http.HttpSessioninvalidate in class StandardSessionpublic void readObjectData(java.io.ObjectInputStream stream)
throws java.lang.ClassNotFoundException,
java.io.IOException
readObjectData in class StandardSessionstream - The object input stream to read fromjava.lang.ClassNotFoundException - if an unknown class is specifiedjava.io.IOException - if an input/output error occurspublic void writeObjectData(java.io.ObjectOutputStream stream)
throws java.io.IOException
writeObjectData in class StandardSessionstream - The object output stream to write tojava.io.IOException - if an input/output error occurspublic void setId(java.lang.String id,
boolean tellNew)
public boolean isPrimarySession()
isPrimarySession in interface ClusterSessionpublic void setPrimarySession(boolean primarySession)
setPrimarySession in interface ClusterSessionprimarySession - Flag valueprotected void log(java.lang.String message)
protected void log(java.lang.String message,
java.lang.Throwable x)
public java.lang.String toString()
StandardSessiontoString in class StandardSessionpublic int getAccessCount()
public void setAccessCount(int accessCount)
public long getLastAccessedTime()
StandardSessiongetLastAccessedTime in interface javax.servlet.http.HttpSessiongetLastAccessedTime in interface SessiongetLastAccessedTime in class StandardSessionlong
representing the last time
the client sent a request associated
with this session, expressed in
milliseconds since 1/1/1970 GMTpublic void setLastAccessedTime(long lastAccessedTime)
public long getThisAccessedTime()
public void setThisAccessedTime(long thisAccessedTime)
Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.