org.codehaus.wadi.core.session
Class StandardSession

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
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Evictable, Motable, Session
Direct Known Subclasses:
DistributableSession

public class StandardSession
extends AbstractMotable
implements Session

Our internal representation of any Web Session

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

Nested Class Summary
protected  class StandardSession.StateMap
           
 
Field Summary
protected  StandardAttributes attributes
           
protected  java.util.Map<java.lang.Object,java.lang.Object> localStateMap
           
protected  Manager 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
StandardSession(StandardAttributes attributes, Manager manager)
           
 
Method Summary
 java.lang.Object addState(java.lang.Object key, java.lang.Object value)
          Map like contract to manipulate state information.
 void destroy()
           
protected  void destroyForMotion()
           
 byte[] getBodyAsByteArray()
           
 java.util.Map<java.lang.Object,java.lang.Object> getLocalStateMap()
           
protected  StandardSessionMemento getStandardSessionMemento()
           
 java.util.Map getState()
           
 java.lang.Object getState(java.lang.Object key)
          Map like contract to manipulate state information.
protected  SimpleEvictableMemento newMemento()
           
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)
           
 java.lang.Object removeState(java.lang.Object key)
          Map like contract to manipulate state information.
 void setBodyAsByteArray(byte[] bytes)
           
 
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, setMaxInactiveInterval, 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, setMaxInactiveInterval
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Field Detail

manager

protected final Manager manager

attributes

protected final StandardAttributes attributes

localStateMap

protected final java.util.Map<java.lang.Object,java.lang.Object> localStateMap
Constructor Detail

StandardSession

public StandardSession(StandardAttributes attributes,
                       Manager manager)
Method Detail

newMemento

protected SimpleEvictableMemento newMemento()
Overrides:
newMemento in class AbstractMotable

getStandardSessionMemento

protected StandardSessionMemento getStandardSessionMemento()

destroy

public void destroy()
             throws java.lang.Exception
Specified by:
destroy in interface Evictable
Overrides:
destroy in class AbstractMotable
Throws:
java.lang.Exception

destroyForMotion

protected void destroyForMotion()
                         throws java.lang.Exception
Overrides:
destroyForMotion in class AbstractMotable
Throws:
java.lang.Exception

onEndProcessing

public void onEndProcessing()
Specified by:
onEndProcessing in interface Session

getBodyAsByteArray

public byte[] getBodyAsByteArray()
                          throws java.lang.Exception
Specified by:
getBodyAsByteArray in interface Motable
Throws:
java.lang.Exception

setBodyAsByteArray

public void setBodyAsByteArray(byte[] bytes)
                        throws java.io.IOException,
                               java.lang.ClassNotFoundException
Specified by:
setBodyAsByteArray in interface Motable
Throws:
java.io.IOException
java.lang.ClassNotFoundException

addState

public java.lang.Object addState(java.lang.Object key,
                                 java.lang.Object value)
Description copied from interface: Session
Map like contract to manipulate state information.

Specified by:
addState in interface Session

getState

public java.lang.Object getState(java.lang.Object key)
Description copied from interface: Session
Map like contract to manipulate state information.

Specified by:
getState in interface Session

removeState

public java.lang.Object removeState(java.lang.Object key)
Description copied from interface: Session
Map like contract to manipulate state information.

Specified by:
removeState in interface Session

getState

public java.util.Map getState()
Specified by:
getState in interface Session

getLocalStateMap

public java.util.Map<java.lang.Object,java.lang.Object> getLocalStateMap()
Specified by:
getLocalStateMap in interface Session

onAddSate

protected void onAddSate(java.lang.Object key,
                         java.lang.Object oldValue,
                         java.lang.Object newValue)

onRemoveState

protected void onRemoveState(java.lang.Object key,
                             java.lang.Object oldValue)

onDestroy

protected void onDestroy()


Copyright © 2011. All Rights Reserved.