org.apache.catalina.ha.session
public class DeltaSession extends StandardSession implements Externalizable, ClusterSession, ReplicatedMapEntry
Version: $Revision: 896383 $ $Date: 2010-01-06 11:51:53 +0100 (Wed, 06 Jan 2010) $
Field Summary | |
---|---|
protected Lock | diffLock |
static Log | log |
protected static StringManager | sm
The string manager for this package. |
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 | endAccess()
End the access and register to ReplicationValve (crossContext support) |
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 Object | getAttributeInternal(String name)
Return the value of an attribute without a check for validity. |
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() |
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(ObjectInput in) |
void | readObjectData(ObjectInput stream) |
void | recycle()
Release all object references, and initialize instance variables, in
preparation for reuse of this object. |
void | removeAttribute(String name, boolean notify)
Remove the object bound with the specified name from this session. |
void | removeAttribute(String name, boolean notify, boolean addDeltaRequest) |
protected void | removeAttributeInternal(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(String name, Object value)
Bind an object to this session, using the specified name. |
void | setAttribute(String name, Object value, boolean notify, boolean addDeltaRequest) |
void | setId(String id)
Set the session identifier for this session.
|
void | setIdInternal(String id)
Set the session identifier for this session without notify listeners.
|
protected void | setLastTimeReplicated(long lastTimeReplicated) |
void | setMaxInactiveInterval(int interval) |
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(Object owner) |
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 | setPrincipal(Principal principal, boolean addDeltaRequest) |
void | setVersion(long version) |
String | toString()
Return a string representation of this object. |
void | unlock()
Unlock after serialization |
void | writeExternal(ObjectOutput out) |
protected void | writeObject(ObjectOutputStream stream)
Write a serialized version of this session object to the specified object
output stream.
|
void | writeObjectData(ObjectOutput stream) |
Parameters: manager The manager with which this Session is associated
Parameters: diff byte[] offset int length int
Throws: IOException
Parameters: notify Should we notify listeners about the demise of this session?
Returns: byte[]
Throws: IOException
See Also: .
Returns: boolean
Returns: boolean
isValid
flag for this session.
After this method executes, and if the object implements
HttpSessionBindingListener
, the container calls
valueUnbound()
on the object.
Parameters: name Name of the object to remove from this session. notify Should we notify interested listeners that this attribute is being removed?
Throws: IllegalStateException if this method is called on an invalidated session
After this method executes, and if the object implements
HttpSessionBindingListener
, the container calls
valueBound()
on the object.
Parameters: name Name to which the object is bound, cannot be null value Object to be bound, cannot be null
Throws: IllegalArgumentException if an attempt is made to add a non-serializable object in an environment marked distributable. IllegalStateException if this method is called on an invalidated session
Parameters: id The new session identifier
Parameters: id The new session identifier
isNew
flag for this session.
Parameters: isNew
The new value for the isNew
flag
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
IMPLEMENTATION NOTE : The owning Manager will not be stored in the
serialized representation of this Session. After calling
readObject()
, you must set the associated Manager
explicitly.
IMPLEMENTATION NOTE : Any attribute that is not Serializable will
be unbound from the session, with appropriate actions if it implements
HttpSessionBindingListener. If you do not want any such attributes, be
sure the distributable
property of the associated Manager
is set to true
.
Parameters: stream The output stream to write to
Throws: IOException if an input/output error occurs