|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.catalina.session.StandardSession
org.apache.catalina.ha.session.DeltaSession
public class DeltaSession
Similar to the StandardSession except that this session will keep track of deltas during a request.
Field Summary | |
---|---|
protected java.util.concurrent.locks.Lock |
diffLock
|
static Log |
log
|
protected static StringManager |
sm
The string manager for this package. |
Fields inherited from class org.apache.catalina.session.StandardSession |
---|
accessCount, ACTIVITY_CHECK, attributes, authType, containerEventMethod, containerEventTypes, creationTime, EMPTY_ARRAY, excludedAttributes, expiring, facade, id, info, isNew, isValid, lastAccessedTime, listeners, manager, maxInactiveInterval, NOT_SERIALIZED, notes, principal, sessionContext, support, thisAccessedTime |
Fields inherited from interface org.apache.catalina.Session |
---|
SESSION_ACTIVATED_EVENT, SESSION_CREATED_EVENT, SESSION_DESTROYED_EVENT, SESSION_PASSIVATED_EVENT |
Constructor Summary | |
---|---|
DeltaSession()
Construct a new Session associated with the specified Manager. |
|
DeltaSession(Manager manager)
|
Method Summary | |
---|---|
void |
applyDiff(byte[] diff,
int offset,
int length)
Applies a diff to an existing object. |
void |
expire(boolean notify)
Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired. |
void |
expire(boolean notify,
boolean notifyCluster)
|
protected java.lang.Object |
getAttributeInternal(java.lang.String name)
Return the value of an attribute without a check for validity. |
java.lang.ClassLoader[] |
getClassLoaders()
|
DeltaRequest |
getDeltaRequest()
|
byte[] |
getDiff()
Returns a diff and sets the dirty map to false |
long |
getLastAccessedTimeInternal()
Return the last client access time without invalidation check |
protected long |
getLastTimeReplicated()
|
long |
getVersion()
For accuracy checking, a serialized attribute can contain a version number This number increases as modifications are made to the data. |
boolean |
isDiffable()
If this returns true, the map will extract the diff using getDiff() Otherwise it will serialize the entire object. |
boolean |
isDirty()
Has the object changed since last replication and is not in a locked state |
boolean |
isPrimarySession()
returns true if this session is the primary session, if that is the case, the manager can expire it upon timeout. |
boolean |
isValid()
Return the isValid flag for this session. |
void |
lock()
Lock during serialization |
void |
readExternal(java.io.ObjectInput in)
|
void |
readObjectData(java.io.ObjectInput 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 |
recycle()
Release all object references, and initialize instance variables, in preparation for reuse of this object. |
void |
removeAttribute(java.lang.String name,
boolean notify)
Remove the object bound with the specified name from this session. |
void |
removeAttribute(java.lang.String name,
boolean notify,
boolean addDeltaRequest)
|
protected void |
removeAttributeInternal(java.lang.String name,
boolean notify,
boolean addDeltaRequest)
|
void |
resetDeltaRequest()
|
void |
resetDiff()
Resets the current diff state and resets the dirty flag |
protected void |
setAccessCount(int count)
|
void |
setAttribute(java.lang.String name,
java.lang.Object value)
Bind an object to this session, using the specified name. |
void |
setAttribute(java.lang.String name,
java.lang.Object value,
boolean notify,
boolean addDeltaRequest)
|
void |
setId(java.lang.String id)
Set the session identifier for this session. |
void |
setIdInternal(java.lang.String id)
Set the session identifier for this session without notify listeners. |
protected void |
setLastTimeReplicated(long lastTimeReplicated)
|
void |
setMaxInactiveInterval(int interval)
Set the maximum time interval, in seconds, between client requests before the servlet container will invalidate the session. |
void |
setMaxInactiveInterval(int interval,
boolean addDeltaRequest)
|
void |
setNew(boolean isNew)
Set the isNew flag for this session. |
void |
setNew(boolean isNew,
boolean addDeltaRequest)
|
void |
setOwner(java.lang.Object owner)
This method is called after the object has been created on a remote map. |
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 |
setPrincipal(java.security.Principal principal,
boolean addDeltaRequest)
|
void |
setVersion(long version)
Forces a certain version to a replicated map entry |
java.lang.String |
toString()
Return a string representation of this object. |
void |
unlock()
Unlock after serialization |
void |
writeExternal(java.io.ObjectOutput out)
|
void |
writeObjectData(java.io.ObjectOutput 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. |
Methods inherited from class org.apache.catalina.session.StandardSession |
---|
access, activate, addSessionListener, endAccess, exclude, expire, fireContainerEvent, fireSessionEvent, getAttribute, getAttributeNames, getAuthType, getCreationTime, getId, getIdInternal, getInfo, getLastAccessedTime, getManager, getMaxInactiveInterval, getNote, getNoteNames, getPrincipal, getServletContext, getSession, getSessionContext, getValue, getValueNames, invalidate, isNew, isValidInternal, keys, passivate, putValue, readObject, readObjectData, removeAttribute, removeAttributeInternal, removeNote, removeSessionListener, removeValue, setAttribute, setAuthType, setCreationTime, setManager, setNote, setValid, tellNew, writeObject, writeObjectData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.catalina.Session |
---|
access, addSessionListener, endAccess, expire, getAuthType, getCreationTime, getId, getIdInternal, getInfo, getLastAccessedTime, getManager, getMaxInactiveInterval, getNote, getNoteNames, getPrincipal, getSession, removeNote, removeSessionListener, setAuthType, setCreationTime, setManager, setNote, setValid |
Methods inherited from interface javax.servlet.http.HttpSession |
---|
getAttribute, getAttributeNames, getCreationTime, getId, getLastAccessedTime, getMaxInactiveInterval, getServletContext, getSessionContext, getValue, getValueNames, invalidate, isNew, putValue, removeAttribute, removeValue |
Field Detail |
---|
public static Log log
protected static StringManager sm
protected java.util.concurrent.locks.Lock diffLock
Constructor Detail |
---|
public DeltaSession()
manager
- The manager with which this Session is associatedpublic DeltaSession(Manager manager)
Method Detail |
---|
public boolean isDirty()
isDirty
in interface ReplicatedMapEntry
public boolean isDiffable()
isDiffable
in interface ReplicatedMapEntry
public byte[] getDiff() throws java.io.IOException
getDiff
in interface ReplicatedMapEntry
java.io.IOException
public java.lang.ClassLoader[] getClassLoaders()
public void applyDiff(byte[] diff, int offset, int length) throws java.io.IOException, java.lang.ClassNotFoundException
applyDiff
in interface ReplicatedMapEntry
diff
- byte[]offset
- intlength
- int
java.io.IOException
java.lang.ClassNotFoundException
public void resetDiff()
resetDiff
in interface ReplicatedMapEntry
public void lock()
lock
in interface ReplicatedMapEntry
public void unlock()
unlock
in interface ReplicatedMapEntry
public void setOwner(java.lang.Object owner)
ReplicatedMapEntry
setOwner
in interface ReplicatedMapEntry
owner
- Objectpublic boolean isPrimarySession()
isPrimarySession
in interface ClusterSession
public void setPrimarySession(boolean primarySession)
setPrimarySession
in interface ClusterSession
primarySession
- Flag valuepublic void setIdInternal(java.lang.String id)
id
- The new session identifierpublic void setId(java.lang.String id)
setId
in interface Session
setId
in class StandardSession
id
- The new session identifierpublic long getLastAccessedTimeInternal()
getLastAccessedTimeInternal
in interface Session
getLastAccessedTimeInternal
in class StandardSession
StandardSession.getLastAccessedTime().
public void setMaxInactiveInterval(int interval)
StandardSession
setMaxInactiveInterval
in interface javax.servlet.http.HttpSession
setMaxInactiveInterval
in interface Session
setMaxInactiveInterval
in class StandardSession
interval
- The new maximum intervalpublic void setMaxInactiveInterval(int interval, boolean addDeltaRequest)
public void setNew(boolean isNew)
isNew
flag for this session.
setNew
in interface Session
setNew
in class StandardSession
isNew
- The new value for the isNew
flagpublic void setNew(boolean isNew, boolean addDeltaRequest)
public 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 Session
setPrincipal
in class StandardSession
principal
- The new Principal, or null
if nonepublic void setPrincipal(java.security.Principal principal, boolean addDeltaRequest)
public boolean isValid()
isValid
flag for this session.
isValid
in interface Session
isValid
in class StandardSession
public void expire(boolean notify)
expire
in class StandardSession
notify
- Should we notify listeners about the demise of this session?public void expire(boolean notify, boolean notifyCluster)
public void recycle()
recycle
in interface Session
recycle
in class StandardSession
public java.lang.String toString()
toString
in class StandardSession
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void readObjectData(java.io.ObjectInput stream) throws java.lang.ClassNotFoundException, java.io.IOException
stream
- The object input stream to read from
java.lang.ClassNotFoundException
- if an unknown class is specified
java.io.IOException
- if an input/output error occurspublic void writeObjectData(java.io.ObjectOutput stream) throws java.io.IOException
stream
- The object output stream to write to
java.io.IOException
- if an input/output error occurspublic void resetDeltaRequest()
public DeltaRequest getDeltaRequest()
public void removeAttribute(java.lang.String name, boolean notify)
After this method executes, and if the object implements
HttpSessionBindingListener
, the container calls
valueUnbound()
on the object.
removeAttribute
in class StandardSession
name
- Name of the object to remove from this session.notify
- Should we notify interested listeners that this attribute is
being removed?
java.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic void removeAttribute(java.lang.String name, boolean notify, boolean addDeltaRequest)
public void setAttribute(java.lang.String name, java.lang.Object value)
After this method executes, and if the object implements
HttpSessionBindingListener
, the container calls
valueBound()
on the object.
setAttribute
in interface javax.servlet.http.HttpSession
setAttribute
in class StandardSession
name
- Name to which the object is bound, cannot be nullvalue
- Object to be bound, cannot be null
java.lang.IllegalArgumentException
- if an attempt is made to add a non-serializable object in
an environment marked distributable.
java.lang.IllegalStateException
- if this method is called on an invalidated sessionpublic void setAttribute(java.lang.String name, java.lang.Object value, boolean notify, boolean addDeltaRequest)
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
protected java.lang.Object getAttributeInternal(java.lang.String name)
protected void removeAttributeInternal(java.lang.String name, boolean notify, boolean addDeltaRequest)
protected long getLastTimeReplicated()
public long getVersion()
ReplicatedMapEntry
getVersion
in interface ReplicatedMapEntry
protected void setLastTimeReplicated(long lastTimeReplicated)
public void setVersion(long version)
ReplicatedMapEntry
setVersion
in interface ReplicatedMapEntry
version
- longprotected void setAccessCount(int count)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |