org.codehaus.wadi.core.session
Class AtomicallyReplicableSession

java.lang.Object
  extended by org.codehaus.wadi.core.eviction.SimpleEvictable
      extended by org.codehaus.wadi.core.motable.AbstractMotable
          extended by org.codehaus.wadi.core.session.StandardSession
              extended by org.codehaus.wadi.core.session.DistributableSession
                  extended by org.codehaus.wadi.core.session.AbstractReplicableSession
                      extended by org.codehaus.wadi.core.session.AtomicallyReplicableSession
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Evictable, Motable, Session
Direct Known Subclasses:
BasicWebSession

public class AtomicallyReplicableSession
extends AbstractReplicableSession

Version:
$Revision: 1497 $
Author:
Jules Gosnell
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.codehaus.wadi.core.session.StandardSession
StandardSession.StateMap
 
Field Summary
protected  boolean dirty
           
protected  org.codehaus.wadi.core.session.AtomicallyReplicableSession.Semantics semantics
           
 
Fields inherited from class org.codehaus.wadi.core.session.AbstractReplicableSession
replicationManager
 
Fields inherited from class org.codehaus.wadi.core.session.DistributableSession
streamer
 
Fields inherited from class org.codehaus.wadi.core.session.StandardSession
attributes, localStateMap, manager
 
Fields inherited from class org.codehaus.wadi.core.motable.AbstractMotable
readWriteLock
 
Fields inherited from class org.codehaus.wadi.core.eviction.SimpleEvictable
memento
 
Constructor Summary
AtomicallyReplicableSession(DistributableAttributes attributes, Manager manager, Streamer streamer, ReplicationManager replicationManager)
           
 
Method Summary
 java.lang.Object getState(java.lang.Object key)
          this will sometimes dirty the session, since we are giving away a ref to something inside the session which may then be modified without our knowledge - strictly speaking, if we are using ByReference semantics, this dirties.
protected  boolean isDirty()
           
protected  void onAddSate(java.lang.Object key, java.lang.Object oldValue, java.lang.Object newValue)
           
protected  void onDestroy()
           
 void onEndProcessing()
           
protected  void onRemoveState(java.lang.Object key, java.lang.Object oldValue)
           
 void setMaxInactiveInterval(int maxInactiveInterval)
          if MII changes - dirties the session metadata - might this be distributed separately ? we could probably distribute this as a delta, since there are no object reference issues - it would be crazy to send the whole session to update this.
 
Methods inherited from class org.codehaus.wadi.core.session.AbstractReplicableSession
destroy
 
Methods inherited from class org.codehaus.wadi.core.session.DistributableSession
getBodyAsByteArray, getDistributableSessionMemento, newMemento, setBodyAsByteArray, setDistributableSessionMemento
 
Methods inherited from class org.codehaus.wadi.core.session.StandardSession
addState, destroyForMotion, getLocalStateMap, getStandardSessionMemento, getState, removeState
 
Methods inherited from class org.codehaus.wadi.core.motable.AbstractMotable
copy, getAbstractMotableMemento, getName, getReadWriteLock, init, initExisting, isNew, mote, newReadWriteLock, onDeserialization, rehydrate, restore
 
Methods inherited from class org.codehaus.wadi.core.eviction.SimpleEvictable
copy, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, mote, onSerialization, readExternal, setLastAccessedTime, writeExternal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.wadi.core.motable.Motable
copy, getName, getReadWriteLock, init, isNew, mote, rehydrate, restore
 
Methods inherited from interface org.codehaus.wadi.core.eviction.Evictable
copy, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, mote, setLastAccessedTime
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Field Detail

dirty

protected transient boolean dirty

semantics

protected transient org.codehaus.wadi.core.session.AtomicallyReplicableSession.Semantics semantics
Constructor Detail

AtomicallyReplicableSession

public AtomicallyReplicableSession(DistributableAttributes attributes,
                                   Manager manager,
                                   Streamer streamer,
                                   ReplicationManager replicationManager)
Method Detail

onEndProcessing

public void onEndProcessing()
Specified by:
onEndProcessing in interface Session
Overrides:
onEndProcessing in class AbstractReplicableSession

isDirty

protected boolean isDirty()
Overrides:
isDirty in class AbstractReplicableSession

setMaxInactiveInterval

public void setMaxInactiveInterval(int maxInactiveInterval)
if MII changes - dirties the session metadata - might this be distributed separately ? we could probably distribute this as a delta, since there are no object reference issues - it would be crazy to send the whole session to update this.

Specified by:
setMaxInactiveInterval in interface Evictable
Overrides:
setMaxInactiveInterval in class SimpleEvictable

getState

public java.lang.Object getState(java.lang.Object key)
this will sometimes dirty the session, since we are giving away a ref to something inside the session which may then be modified without our knowledge - strictly speaking, if we are using ByReference semantics, this dirties. If we are using ByValue semantics, it does not.

Specified by:
getState in interface Session
Overrides:
getState in class StandardSession

onAddSate

protected void onAddSate(java.lang.Object key,
                         java.lang.Object oldValue,
                         java.lang.Object newValue)
Overrides:
onAddSate in class StandardSession

onRemoveState

protected void onRemoveState(java.lang.Object key,
                             java.lang.Object oldValue)
Overrides:
onRemoveState in class StandardSession

onDestroy

protected void onDestroy()
Overrides:
onDestroy in class StandardSession


Copyright © 2008. All Rights Reserved.