org.codehaus.wadi.impl
Class StandardSession

java.lang.Object
  extended byorg.codehaus.wadi.impl.SimpleEvictable
      extended byorg.codehaus.wadi.impl.AbstractMotable
          extended byorg.codehaus.wadi.impl.AbstractContext
              extended byorg.codehaus.wadi.impl.StandardSession
All Implemented Interfaces:
AttributesConfig, Config, Context, Evictable, Motable, Serializable, SerializableContent, Session, WADIHttpSession
Direct Known Subclasses:
DistributableSession

public class StandardSession
extends AbstractContext
implements WADIHttpSession, AttributesConfig

Our internal representation of any Web Session

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

Field Summary
protected  Attributes _attributes
           
protected  SessionConfig _config
           
protected static Enumeration _emptyEnumeration
           
protected static String[] _emptyStringArray
           
protected  HttpSessionEvent _httpSessionEvent
           
protected static Log _log
           
protected  HttpSession _wrapper
           
 
Fields inherited from class org.codehaus.wadi.impl.AbstractContext
_lock
 
Fields inherited from class org.codehaus.wadi.impl.AbstractMotable
_name
 
Fields inherited from class org.codehaus.wadi.impl.SimpleEvictable
_creationTime, _lastAccessedTime, _maxInactiveInterval
 
Constructor Summary
StandardSession(SessionConfig config)
           
 
Method Summary
 void destroy()
           
 Object getAttribute(String name)
           
 Enumeration getAttributeNameEnumeration()
           
 Set getAttributeNameSet()
           
 String[] getAttributeNameStringArray()
           
 byte[] getBodyAsByteArray()
           
 SessionConfig getConfig()
           
 HttpSessionEvent getHttpSessionEvent()
           
 String getId()
           
 ValuePool getValuePool()
           
 HttpSession getWrapper()
           
protected  void notifyAttributeListeners(String name, Object oldValue, Object newValue)
           
protected  void notifyBindingListeners(String name, Object oldValue, Object newValue)
           
 Object removeAttribute(String name)
           
 Object setAttribute(String name, Object newValue)
           
 void setBodyAsByteArray(byte[] bytes)
           
 void setLastAccessedTime(long newLastAccessedTime)
           
 void setMaxInactiveInterval(int newMaxInactiveInterval)
           
 
Methods inherited from class org.codehaus.wadi.impl.AbstractContext
getBodyAsByteBuffer, getExclusiveLock, getSharedLock, setBodyAsByteBuffer
 
Methods inherited from class org.codehaus.wadi.impl.AbstractMotable
copy, getName, init, mote, readContent, writeContent
 
Methods inherited from class org.codehaus.wadi.impl.SimpleEvictable
checkTimeframe, copy, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, isNew, mote
 
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.Context
getExclusiveLock, getSharedLock
 
Methods inherited from interface org.codehaus.wadi.Motable
copy, getBodyAsByteBuffer, getName, init, mote, setBodyAsByteBuffer
 
Methods inherited from interface org.codehaus.wadi.Evictable
checkTimeframe, copy, getCreationTime, getLastAccessedTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, isNew, mote
 
Methods inherited from interface org.codehaus.wadi.SerializableContent
readContent, writeContent
 

Field Detail

_log

protected static final Log _log

_config

protected final SessionConfig _config

_attributes

protected final Attributes _attributes

_wrapper

protected final HttpSession _wrapper

_httpSessionEvent

protected final HttpSessionEvent _httpSessionEvent

_emptyStringArray

protected static final String[] _emptyStringArray

_emptyEnumeration

protected static final Enumeration _emptyEnumeration
Constructor Detail

StandardSession

public StandardSession(SessionConfig config)
Method Detail

destroy

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

getBodyAsByteArray

public byte[] getBodyAsByteArray()
                          throws Exception
Specified by:
getBodyAsByteArray in interface Motable
Overrides:
getBodyAsByteArray in class AbstractContext
Throws:
Exception

setBodyAsByteArray

public void setBodyAsByteArray(byte[] bytes)
                        throws IOException,
                               ClassNotFoundException
Specified by:
setBodyAsByteArray in interface Motable
Overrides:
setBodyAsByteArray in class AbstractContext
Throws:
IOException
ClassNotFoundException

getWrapper

public HttpSession getWrapper()
Specified by:
getWrapper in interface WADIHttpSession

getHttpSessionEvent

public HttpSessionEvent getHttpSessionEvent()
Specified by:
getHttpSessionEvent in interface WADIHttpSession

getAttribute

public Object getAttribute(String name)
Specified by:
getAttribute in interface Session

getAttributeNameSet

public Set getAttributeNameSet()
Specified by:
getAttributeNameSet in interface Session

getAttributeNameEnumeration

public Enumeration getAttributeNameEnumeration()
Specified by:
getAttributeNameEnumeration in interface Session

getAttributeNameStringArray

public String[] getAttributeNameStringArray()
Specified by:
getAttributeNameStringArray in interface Session

notifyBindingListeners

protected void notifyBindingListeners(String name,
                                      Object oldValue,
                                      Object newValue)

notifyAttributeListeners

protected void notifyAttributeListeners(String name,
                                        Object oldValue,
                                        Object newValue)

setAttribute

public Object setAttribute(String name,
                           Object newValue)
Specified by:
setAttribute in interface Session

removeAttribute

public Object removeAttribute(String name)
Specified by:
removeAttribute in interface Session

getConfig

public SessionConfig getConfig()
Specified by:
getConfig in interface Session

getValuePool

public ValuePool getValuePool()
Specified by:
getValuePool in interface AttributesConfig

setLastAccessedTime

public void setLastAccessedTime(long newLastAccessedTime)
Specified by:
setLastAccessedTime in interface Evictable
Overrides:
setLastAccessedTime in class SimpleEvictable

setMaxInactiveInterval

public void setMaxInactiveInterval(int newMaxInactiveInterval)
Specified by:
setMaxInactiveInterval in interface Evictable
Overrides:
setMaxInactiveInterval in class SimpleEvictable

getId

public String getId()
Specified by:
getId in interface Session


Copyright © 2004-2008 Core Developers Network Ltd.. All Rights Reserved.