Class DeltaSession
- java.lang.Object
-
- org.apache.catalina.session.StandardSession
-
- org.apache.catalina.ha.session.DeltaSession
-
- All Implemented Interfaces:
HttpSession,java.io.Externalizable,java.io.Serializable,ClusterSession,Session,ReplicatedMapEntry
public class DeltaSession extends StandardSession implements java.io.Externalizable, ClusterSession, ReplicatedMapEntry
Similar to the StandardSession except that this session will keep track of deltas during a request.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.concurrent.locks.LockdiffLockWrite lock used to protect delta operations.static LoglogThe logger for this class.protected static StringManagersmThe string manager for this package.-
Fields inherited from class org.apache.catalina.session.StandardSession
accessCount, activityCheck, attributes, authType, creationTime, EMPTY_ARRAY, expiring, facade, id, isNew, isValid, lastAccessAtStart, lastAccessedTime, listeners, manager, maxInactiveInterval, notes, principal, support, thisAccessedTime
-
Fields inherited from interface org.apache.catalina.Session
SESSION_ACTIVATED_EVENT, SESSION_CHANGED_ID_EVENT, SESSION_CREATED_EVENT, SESSION_DESTROYED_EVENT, SESSION_PASSIVATED_EVENT
-
-
Constructor Summary
Constructors Constructor Description DeltaSession()Default constructor required byExternalizable.DeltaSession(Manager manager)Construct a new Session associated with the specified Manager.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaccessEntry()Access to an existing object.voidaddSessionListener(SessionListener listener)Add a session event listener to this component.voidaddSessionListener(SessionListener listener, boolean addDeltaRequest)Add a session listener.voidapplyDiff(byte[] diff, int offset, int length)Applies a diff to an existing object.protected DeltaRequestcreateRequest(java.lang.String sessionId, boolean recordAllActions)Create a DeltaRequest instance.protected voiddeserializeAndExecuteDeltaRequest(byte[] delta)Deserialize a delta request and execute its actions on this session.protected voiddoReadObject(java.io.ObjectInputStream stream)Read a serialized version of this session object from the specified object input stream.protected voiddoWriteObject(java.io.ObjectOutputStream stream)Write a serialized version of this session object to the specified object output stream.voidendAccess()End access to the session.voidexpire(boolean notify)Perform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.voidexpire(boolean notify, boolean notifyCluster)Expire this session.java.lang.ClassLoader[]getClassLoaders()Get the class loaders used for deserialization.DeltaRequestgetDeltaRequest()Deprecated.Unused.byte[]getDiff()Returns a diff and sets the dirty map to falselonggetLastTimeReplicated()Returns the last replicate time.longgetVersion()For accuracy checking, a serialized attribute can contain a version number This number increases as modifications are made to the data.booleanisAccessReplicate()If this returns true, to replicate that an object has been accessedbooleanisDiffable()If this returns true, the map will extract the diff using getDiff() Otherwise it will serialize the entire object.booleanisDirty()Has the object changed since last replication and is not in a locked statebooleanisPrimarySession()returns true if this session is the primary session, if that is the case, the manager can expire it upon timeout.booleanisValid()Returns whether the session is still valid.voidlock()Lock during serializationvoidreadExternal(java.io.ObjectInput in)voidreadObjectData(java.io.ObjectInput stream)Read object data from the given input stream.voidreadObjectData(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.voidrecycle()Release all object references, and initialize instance variables, in preparation for reuse of this object.voidremoveAttribute(java.lang.String name, boolean notify)Remove the object bound with the specified name from this session.voidremoveAttribute(java.lang.String name, boolean notify, boolean addDeltaRequest)Remove an attribute from this session.protected voidremoveAttributeInternal(java.lang.String name, boolean notify, boolean addDeltaRequest)Remove an attribute from this session without additional validation.voidremoveNote(java.lang.String name)Remove any object bound to the specified name in the internal notes for this session.voidremoveNote(java.lang.String name, boolean addDeltaRequest)Remove a note from this session.voidremoveSessionListener(SessionListener listener)Remove a session event listener from this component.voidremoveSessionListener(SessionListener listener, boolean addDeltaRequest)Remove a session listener.voidresetDeltaRequest()Reset the delta request, clearing all recorded actions.voidresetDiff()Resets the current diff state and resets the dirty flagprotected voidsetAccessCount(int count)Set the access count for this session.voidsetAttribute(java.lang.String name, java.lang.Object value)Binds an object to this session, using the name specified.voidsetAttribute(java.lang.String name, java.lang.Object value, boolean notify, boolean addDeltaRequest)Set an attribute on this session.voidsetAuthType(java.lang.String authType)Set the authentication type used to authenticate our cached Principal, if any.voidsetAuthType(java.lang.String authType, boolean addDeltaRequest)Set the authentication type.voidsetId(java.lang.String id)Set the session identifier for this session and notifies any associated listeners that a new session has been created.voidsetId(java.lang.String id, boolean notify)Set the session identifier for this session and optionally notifies any associated listeners that a new session has been created.voidsetLastTimeReplicated(long lastTimeReplicated)Set the last replicate time.voidsetMaxInactiveInterval(int interval)Specifies the time, in seconds, between client requests before the servlet container will invalidate this session.voidsetMaxInactiveInterval(int interval, boolean addDeltaRequest)Set the maximum inactive interval.voidsetNew(boolean isNew)Set theisNewflag for this session.voidsetNew(boolean isNew, boolean addDeltaRequest)Set the new flag.voidsetNote(java.lang.String name, java.lang.Object value)Bind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name.voidsetNote(java.lang.String name, java.lang.Object value, boolean addDeltaRequest)Set a note on this session.voidsetOwner(java.lang.Object owner)This method is called after the object has been created on a remote map.voidsetPrimarySession(boolean primarySession)Sets whether this is the primary session or not.voidsetPrincipal(java.security.Principal principal)Set the authenticated Principal that is associated with this Session.voidsetPrincipal(java.security.Principal principal, boolean addDeltaRequest)Set the session principal.voidsetVersion(long version)Forces a certain version to a replicated map entryjava.lang.StringtoString()voidunlock()Unlock after serializationvoidwriteExternal(java.io.ObjectOutput out)voidwriteObjectData(java.io.ObjectOutput stream)Write object data to the given output stream.voidwriteObjectData(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.-
Methods inherited from class org.apache.catalina.session.StandardSession
access, activate, exclude, expire, fireSessionEvent, getAttribute, getAttributeNames, getAuthType, getCreationTime, getCreationTimeInternal, getId, getIdInternal, getIdleTime, getIdleTimeInternal, getLastAccessedTime, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, getPrincipal, getServletContext, getSession, getThisAccessedTime, getThisAccessedTimeInternal, invalidate, isAttributeDistributable, isNew, isValidInternal, keys, passivate, removeAttribute, removeAttributeInternal, setAttribute, setCreationTime, setManager, setValid, tellChangedSessionId, tellNew
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jakarta.servlet.http.HttpSession
getAttribute, getAttributeNames, getCreationTime, getId, getLastAccessedTime, getMaxInactiveInterval, getServletContext, invalidate, isNew, removeAttribute
-
Methods inherited from interface org.apache.catalina.Session
access, expire, getAuthType, getCreationTime, getCreationTimeInternal, getId, getIdInternal, getIdleTime, getIdleTimeInternal, getLastAccessedTime, getLastAccessedTimeInternal, getManager, getMaxInactiveInterval, getNote, getNoteNames, getPrincipal, getSession, getThisAccessedTime, getThisAccessedTimeInternal, isAttributeDistributable, setCreationTime, setManager, setValid, tellChangedSessionId
-
-
-
-
Field Detail
-
log
public static final Log log
The logger for this class.
-
sm
protected static final StringManager sm
The string manager for this package.
-
diffLock
protected final java.util.concurrent.locks.Lock diffLock
Write lock used to protect delta operations.
-
-
Constructor Detail
-
DeltaSession
public DeltaSession()
Default constructor required byExternalizable.
-
DeltaSession
public DeltaSession(Manager manager)
Construct a new Session associated with the specified Manager.- Parameters:
manager- The manager with which this Session is associated
-
-
Method Detail
-
createRequest
protected DeltaRequest createRequest(java.lang.String sessionId, boolean recordAllActions)
Create a DeltaRequest instance. This protected method enables subclasses to override and use custom DeltaRequest implementations.- Parameters:
sessionId- Session identifierrecordAllActions- Record all actions, including duplicates- Returns:
- New DeltaRequest instance
-
isDirty
public boolean isDirty()
Description copied from interface:ReplicatedMapEntryHas the object changed since last replication and is not in a locked state- Specified by:
isDirtyin interfaceReplicatedMapEntry- Returns:
- boolean
-
isDiffable
public boolean isDiffable()
Description copied from interface:ReplicatedMapEntryIf this returns true, the map will extract the diff using getDiff() Otherwise it will serialize the entire object.- Specified by:
isDiffablein interfaceReplicatedMapEntry- Returns:
- boolean
-
getDiff
public byte[] getDiff() throws java.io.IOExceptionDescription copied from interface:ReplicatedMapEntryReturns a diff and sets the dirty map to false- Specified by:
getDiffin interfaceReplicatedMapEntry- Returns:
- Serialized diff data
- Throws:
java.io.IOException- IO error serializing
-
getClassLoaders
public java.lang.ClassLoader[] getClassLoaders()
Get the class loaders used for deserialization.- Returns:
- Class loaders or
nullif none available
-
applyDiff
public void applyDiff(byte[] diff, int offset, int length) throws java.io.IOException, java.lang.ClassNotFoundExceptionDescription copied from interface:ReplicatedMapEntryApplies a diff to an existing object.- Specified by:
applyDiffin interfaceReplicatedMapEntry- Parameters:
diff- Serialized diff dataoffset- Array offsetlength- Array length- Throws:
java.io.IOException- IO error deserializingjava.lang.ClassNotFoundException- Serialization error
-
resetDiff
public void resetDiff()
Resets the current diff state and resets the dirty flagThis implementation is a NO-OP. The diff is reset in
getDiff().- Specified by:
resetDiffin interfaceReplicatedMapEntry
-
lock
public void lock()
Lock during serializationThis implementation is a NO-OP. Any required locking takes place in the methods that make modifications.
- Specified by:
lockin interfaceReplicatedMapEntry
-
unlock
public void unlock()
Unlock after serializationThis implementation is a NO-OP. Any required unlocking takes place in the methods that make modifications.
- Specified by:
unlockin interfaceReplicatedMapEntry
-
setOwner
public void setOwner(java.lang.Object owner)
Description copied from interface:ReplicatedMapEntryThis method is called after the object has been created on a remote map. On this method, the object can initialize itself for any data that wasn't- Specified by:
setOwnerin interfaceReplicatedMapEntry- Parameters:
owner- Object
-
isAccessReplicate
public boolean isAccessReplicate()
Description copied from interface:ReplicatedMapEntryIf this returns true, to replicate that an object has been accessed- Specified by:
isAccessReplicatein interfaceReplicatedMapEntry- Returns:
- boolean
-
accessEntry
public void accessEntry()
Description copied from interface:ReplicatedMapEntryAccess to an existing object.- Specified by:
accessEntryin interfaceReplicatedMapEntry
-
isPrimarySession
public boolean isPrimarySession()
Description copied from interface:ClusterSessionreturns true if this session is the primary session, if that is the case, the manager can expire it upon timeout.- Specified by:
isPrimarySessionin interfaceClusterSession- Returns:
- True if this session is primary
-
setPrimarySession
public void setPrimarySession(boolean primarySession)
Description copied from interface:ClusterSessionSets whether this is the primary session or not.- Specified by:
setPrimarySessionin interfaceClusterSession- Parameters:
primarySession- Flag value
-
setId
public void setId(java.lang.String id, boolean notify)Description copied from interface:SessionSet the session identifier for this session and optionally notifies any associated listeners that a new session has been created.- Specified by:
setIdin interfaceSession- Overrides:
setIdin classStandardSession- Parameters:
id- The new session identifiernotify- Should any associated listeners be notified that a new session has been created?
-
setId
public void setId(java.lang.String id)
Description copied from interface:SessionSet the session identifier for this session and notifies any associated listeners that a new session has been created.- Specified by:
setIdin interfaceSession- Overrides:
setIdin classStandardSession- Parameters:
id- The new session identifier
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval)
Description copied from interface:jakarta.servlet.http.HttpSessionSpecifies the time, in seconds, between client requests before the servlet container will invalidate this session. A zero or negative time indicates that the session should never timeout.- Specified by:
setMaxInactiveIntervalin interfaceHttpSession- Specified by:
setMaxInactiveIntervalin interfaceSession- Overrides:
setMaxInactiveIntervalin classStandardSession- Parameters:
interval- An integer specifying the number of seconds
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int interval, boolean addDeltaRequest)Set the maximum inactive interval.- Parameters:
interval- Max inactive interval in secondsaddDeltaRequest- Whether to add a delta request entry
-
setNew
public void setNew(boolean isNew)
Description copied from interface:SessionSet theisNewflag for this session.- Specified by:
setNewin interfaceSession- Overrides:
setNewin classStandardSession- Parameters:
isNew- The new value for theisNewflag
-
setNew
public void setNew(boolean isNew, boolean addDeltaRequest)Set the new flag.- Parameters:
isNew- New flag valueaddDeltaRequest- Whether to add a delta request entry
-
setPrincipal
public void setPrincipal(java.security.Principal principal)
Description copied from interface:SessionSet the authenticated Principal that is associated with this Session. This provides anAuthenticatorwith a means to cache a previously authenticated Principal, and avoid potentially expensiveRealm.authenticate()calls on every request.- Specified by:
setPrincipalin interfaceSession- Overrides:
setPrincipalin classStandardSession- Parameters:
principal- The new Principal, ornullif none
-
setPrincipal
public void setPrincipal(java.security.Principal principal, boolean addDeltaRequest)Set the session principal.- Parameters:
principal- Session principaladdDeltaRequest- Whether to add a delta request entry
-
setAuthType
public void setAuthType(java.lang.String authType)
Description copied from interface:SessionSet the authentication type used to authenticate our cached Principal, if any.- Specified by:
setAuthTypein interfaceSession- Overrides:
setAuthTypein classStandardSession- Parameters:
authType- The new cached authentication type
-
setAuthType
public void setAuthType(java.lang.String authType, boolean addDeltaRequest)Set the authentication type.- Parameters:
authType- Authentication typeaddDeltaRequest- Whether to add a delta request entry
-
isValid
public boolean isValid()
Description copied from interface:SessionReturns whether the session is still valid.- Specified by:
isValidin interfaceSession- Overrides:
isValidin classStandardSession- Returns:
trueif the session is valid
-
endAccess
public void endAccess()
Description copied from interface:SessionEnd access to the session.- Specified by:
endAccessin interfaceSession- Overrides:
endAccessin classStandardSession
-
expire
public void expire(boolean notify)
Description copied from class:StandardSessionPerform the internal processing required to invalidate this session, without triggering an exception if the session has already expired.- Overrides:
expirein classStandardSession- Parameters:
notify- Should we notify listeners about the demise of this session?
-
expire
public void expire(boolean notify, boolean notifyCluster)Expire this session.- Parameters:
notify- Whether to notify session listenersnotifyCluster- Whether to notify the cluster of expiration
-
recycle
public void recycle()
Description copied from interface:SessionRelease all object references, and initialize instance variables, in preparation for reuse of this object.- Specified by:
recyclein interfaceSession- Overrides:
recyclein classStandardSession
-
toString
public java.lang.String toString()
- Overrides:
toStringin classStandardSession
-
addSessionListener
public void addSessionListener(SessionListener listener)
Description copied from interface:SessionAdd a session event listener to this component.- Specified by:
addSessionListenerin interfaceSession- Overrides:
addSessionListenerin classStandardSession- Parameters:
listener- the SessionListener instance that should be notified for session events
-
addSessionListener
public void addSessionListener(SessionListener listener, boolean addDeltaRequest)
Add a session listener.- Parameters:
listener- Session listener to addaddDeltaRequest- Whether to add a delta request entry
-
removeSessionListener
public void removeSessionListener(SessionListener listener)
Description copied from interface:SessionRemove a session event listener from this component.- Specified by:
removeSessionListenerin interfaceSession- Overrides:
removeSessionListenerin classStandardSession- Parameters:
listener- remove the session listener, which will no longer be notified
-
removeSessionListener
public void removeSessionListener(SessionListener listener, boolean addDeltaRequest)
Remove a session listener.- Parameters:
listener- Session listener to removeaddDeltaRequest- Whether to add a delta request entry
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
readObjectData
public void readObjectData(java.io.ObjectInputStream stream) throws java.lang.ClassNotFoundException, java.io.IOExceptionDescription copied from class:StandardSessionRead 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.- Overrides:
readObjectDatain classStandardSession- Parameters:
stream- The object input stream to read from- Throws:
java.lang.ClassNotFoundException- if an unknown class is specifiedjava.io.IOException- if an input/output error occurs
-
readObjectData
public void readObjectData(java.io.ObjectInput stream) throws java.lang.ClassNotFoundException, java.io.IOExceptionRead object data from the given input stream.- Parameters:
stream- Input stream to read from- Throws:
java.lang.ClassNotFoundException- If a class is not foundjava.io.IOException- If an I/O error occurs
-
writeObjectData
public void writeObjectData(java.io.ObjectOutputStream stream) throws java.io.IOExceptionDescription copied from class:StandardSessionWrite 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.- Overrides:
writeObjectDatain classStandardSession- Parameters:
stream- The object output stream to write to- Throws:
java.io.IOException- if an input/output error occurs
-
writeObjectData
public void writeObjectData(java.io.ObjectOutput stream) throws java.io.IOExceptionWrite object data to the given output stream.- Parameters:
stream- Output stream to write to- Throws:
java.io.IOException- If an I/O error occurs
-
resetDeltaRequest
public void resetDeltaRequest()
Reset the delta request, clearing all recorded actions.
-
getDeltaRequest
@Deprecated public DeltaRequest getDeltaRequest()
Deprecated.Unused. This method will be removed in Tomcat 12.Get the request.- Returns:
- the request
-
deserializeAndExecuteDeltaRequest
protected void deserializeAndExecuteDeltaRequest(byte[] delta) throws java.io.IOException, java.lang.ClassNotFoundExceptionDeserialize a delta request and execute its actions on this session.- Parameters:
delta- Serialized delta request data- Throws:
java.io.IOException- If an I/O error occursjava.lang.ClassNotFoundException- If a class is not found
-
removeAttribute
public void removeAttribute(java.lang.String name, boolean notify)Description copied from class:StandardSessionRemove the object bound with the specified name from this session. If the session does not have an object bound with this name, this method does nothing.After this method executes, and if the object implements
HttpSessionBindingListener, the container callsvalueUnbound()on the object.- Overrides:
removeAttributein classStandardSession- Parameters:
name- Name of the object to remove from this session.notify- Should we notify interested listeners that this attribute is being removed?
-
removeAttribute
public void removeAttribute(java.lang.String name, boolean notify, boolean addDeltaRequest)Remove an attribute from this session.- Parameters:
name- Attribute namenotify- Whether to notify listenersaddDeltaRequest- Whether to add a delta request entry- Throws:
java.lang.IllegalStateException- If this session is no longer valid
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value)Description copied from interface:jakarta.servlet.http.HttpSessionBinds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.After this method executes, and if the new object implements
HttpSessionBindingListener, the container callsHttpSessionBindingListener.valueBound. The container then notifies anyHttpSessionAttributeListeners in the web application.If an object was already bound to this session of this name that implements
HttpSessionBindingListener, itsHttpSessionBindingListener.valueUnboundmethod is called.If the value passed in is null, this has the same effect as calling
removeAttribute().- Specified by:
setAttributein interfaceHttpSession- Overrides:
setAttributein classStandardSession- Parameters:
name- the name to which the object is bound; cannot be nullvalue- the object to be bound
-
setAttribute
public void setAttribute(java.lang.String name, java.lang.Object value, boolean notify, boolean addDeltaRequest)Set an attribute on this session.- Parameters:
name- Attribute namevalue- Attribute valuenotify- Whether to notify listenersaddDeltaRequest- Whether to add a delta request entry- Throws:
java.lang.IllegalArgumentException- If name is null
-
removeNote
public void removeNote(java.lang.String name)
Description copied from interface:SessionRemove any object bound to the specified name in the internal notes for this session.- Specified by:
removeNotein interfaceSession- Overrides:
removeNotein classStandardSession- Parameters:
name- Name of the note to be removed
-
removeNote
public void removeNote(java.lang.String name, boolean addDeltaRequest)Remove a note from this session.- Parameters:
name- Note nameaddDeltaRequest- Whether to add a delta request entry
-
setNote
public void setNote(java.lang.String name, java.lang.Object value)Description copied from interface:SessionBind an object to a specified name in the internal notes associated with this session, replacing any existing binding for this name.- Specified by:
setNotein interfaceSession- Overrides:
setNotein classStandardSession- Parameters:
name- Name to which the object should be boundvalue- Object to be bound to the specified name
-
setNote
public void setNote(java.lang.String name, java.lang.Object value, boolean addDeltaRequest)Set a note on this session.- Parameters:
name- Note namevalue- Note valueaddDeltaRequest- Whether to add a delta request entry
-
doReadObject
protected void doReadObject(java.io.ObjectInputStream stream) throws java.lang.ClassNotFoundException, java.io.IOExceptionDescription copied from class:StandardSessionRead a serialized version of this session object from the specified object input stream.IMPLEMENTATION NOTE: The reference to the owning Manager is not restored by this method, and must be set explicitly.
- Overrides:
doReadObjectin classStandardSession- Parameters:
stream- The input stream to read from- Throws:
java.lang.ClassNotFoundException- if an unknown class is specifiedjava.io.IOException- if an input/output error occurs
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
doWriteObject
protected void doWriteObject(java.io.ObjectOutputStream stream) throws java.io.IOExceptionDescription copied from class:StandardSessionWrite a serialized version of this session object to the specified object output stream.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
distributableproperty of the associated Manager is set totrue.- Overrides:
doWriteObjectin classStandardSession- Parameters:
stream- The output stream to write to- Throws:
java.io.IOException- if an input/output error occurs
-
removeAttributeInternal
protected void removeAttributeInternal(java.lang.String name, boolean notify, boolean addDeltaRequest)Remove an attribute from this session without additional validation.- Parameters:
name- Attribute namenotify- Whether to notify listenersaddDeltaRequest- Whether to add a delta request entry
-
getLastTimeReplicated
public long getLastTimeReplicated()
Description copied from interface:ReplicatedMapEntryReturns the last replicate time.- Specified by:
getLastTimeReplicatedin interfaceReplicatedMapEntry- Returns:
- the last replicate time
-
getVersion
public long getVersion()
Description copied from interface:ReplicatedMapEntryFor accuracy checking, a serialized attribute can contain a version number This number increases as modifications are made to the data. The replicated map can use this to ensure accuracy on a periodic basis- Specified by:
getVersionin interfaceReplicatedMapEntry- Returns:
- long - the version number or -1 if the data is not versioned
-
setLastTimeReplicated
public void setLastTimeReplicated(long lastTimeReplicated)
Description copied from interface:ReplicatedMapEntrySet the last replicate time.- Specified by:
setLastTimeReplicatedin interfaceReplicatedMapEntry- Parameters:
lastTimeReplicated- New timestamp
-
setVersion
public void setVersion(long version)
Description copied from interface:ReplicatedMapEntryForces a certain version to a replicated map entry- Specified by:
setVersionin interfaceReplicatedMapEntry- Parameters:
version- long
-
setAccessCount
protected void setAccessCount(int count)
Set the access count for this session.- Parameters:
count- Access count value
-
-