org.codehaus.wadi.tomcat55
Class TomcatSession

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
                  extended byorg.codehaus.wadi.impl.DistributableSession
                      extended byorg.codehaus.wadi.impl.AbstractReplicableSession
                          extended byorg.codehaus.wadi.impl.AtomicallyReplicableSession
                              extended byorg.codehaus.wadi.tomcat55.TomcatSession
All Implemented Interfaces:
org.codehaus.wadi.AttributesConfig, org.codehaus.wadi.Config, org.codehaus.wadi.Context, org.codehaus.wadi.DistributableAttributesConfig, org.codehaus.wadi.Evictable, org.codehaus.wadi.Motable, org.codehaus.wadi.RWLockListener, Serializable, org.codehaus.wadi.SerializableContent, org.codehaus.wadi.Session, org.apache.catalina.Session, org.codehaus.wadi.WADIHttpSession

public class TomcatSession
extends org.codehaus.wadi.impl.AtomicallyReplicableSession
implements org.apache.catalina.Session

Interestingly, in Tomcat a Session is a facade (for internal use) over an HttpSession (for external use), but in WADI we have a Session (rich implementation for internal use) which is facaded by an HttpSession (constrains available API for external use). Thus, our implementation is Tomcat's facade and vice versa ! Confused ? I was... This is bad news, because it makes it awkward to combine Tomcat and WADI functionality dynamically. For the moment all Tomcat sessions are ReplicableSessions. I will come up with a solution to this later.

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

Field Summary
protected  String _authType
           
protected  List _listeners
           
protected static Log _log
           
protected  Map _notes
           
protected  Principal _principal
           
 
Fields inherited from class org.codehaus.wadi.impl.AtomicallyReplicableSession
_dirty, _replicater, _semantics
 
Fields inherited from class org.codehaus.wadi.impl.StandardSession
_attributes, _config, _emptyEnumeration, _emptyStringArray, _httpSessionEvent, _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
 
Fields inherited from interface org.apache.catalina.Session
SESSION_ACTIVATED_EVENT, SESSION_CREATED_EVENT, SESSION_DESTROYED_EVENT, SESSION_PASSIVATED_EVENT
 
Constructor Summary
TomcatSession(org.codehaus.wadi.ReplicableSessionConfig config)
           
 
Method Summary
 void access()
           
 void addSessionListener(org.apache.catalina.SessionListener listener)
           
 void destroy()
           
 void endAccess()
           
 void expire()
           
 String getAuthType()
           
 String getIdInternal()
           
 String getInfo()
           
 long getLastAccessedTime()
           
 long getLastAccessedTimeInternal()
           
 org.apache.catalina.Manager getManager()
           
 Object getNote(String name)
           
 Iterator getNoteNames()
           
 Principal getPrincipal()
           
 HttpSession getSession()
           
 List getSessionListeners()
           
 boolean isValid()
           
 void recycle()
           
 void removeNote(String name)
           
 void removeSessionListener(org.apache.catalina.SessionListener listener)
           
 void setAuthType(String authType)
           
 void setCreationTime(long creationTime)
           
 void setId(String id)
           
 void setManager(org.apache.catalina.Manager manager)
           
 void setNew(boolean isNew)
           
 void setNote(String name, Object value)
           
 void setPrincipal(Principal principal)
           
 void setValid(boolean isValid)
           
 
Methods inherited from class org.codehaus.wadi.impl.AtomicallyReplicableSession
getAttribute, readEnded, removeAttribute, setAttribute, setMaxInactiveInterval
 
Methods inherited from class org.codehaus.wadi.impl.AbstractReplicableSession
copy, destroy, init, init2, mote
 
Methods inherited from class org.codehaus.wadi.impl.DistributableSession
findHelper, getBodyAsByteArray, getHttpSessionAttributeListenersRegistered, getListenerNames, getStreamer, readContent, setBodyAsByteArray, writeContent
 
Methods inherited from class org.codehaus.wadi.impl.StandardSession
getAttributeNameEnumeration, getAttributeNameSet, getAttributeNameStringArray, getConfig, getHttpSessionEvent, getId, getValuePool, getWrapper, notifyAttributeListeners, notifyBindingListeners, setLastAccessedTime
 
Methods inherited from class org.codehaus.wadi.impl.AbstractContext
getBodyAsByteBuffer, getExclusiveLock, getSharedLock, setBodyAsByteBuffer
 
Methods inherited from class org.codehaus.wadi.impl.AbstractMotable
getName
 
Methods inherited from class org.codehaus.wadi.impl.SimpleEvictable
checkTimeframe, copy, getCreationTime, 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.apache.catalina.Session
getCreationTime, getId, getMaxInactiveInterval, setMaxInactiveInterval
 
Methods inherited from interface org.codehaus.wadi.DistributableAttributesConfig
getHttpSessionEvent
 
Methods inherited from interface org.codehaus.wadi.AttributesConfig
getValuePool
 
Methods inherited from interface org.codehaus.wadi.Context
getExclusiveLock, getSharedLock
 
Methods inherited from interface org.codehaus.wadi.Motable
getBodyAsByteBuffer, getName, setBodyAsByteBuffer
 
Methods inherited from interface org.codehaus.wadi.Evictable
checkTimeframe, copy, getCreationTime, getMaxInactiveInterval, getTimedOut, getTimeToLive, init, isNew, mote
 

Field Detail

_log

protected static final Log _log

_authType

protected transient String _authType

_principal

protected transient Principal _principal

_notes

protected final transient Map _notes

_listeners

protected List _listeners
Constructor Detail

TomcatSession

public TomcatSession(org.codehaus.wadi.ReplicableSessionConfig config)
Method Detail

destroy

public void destroy()
Specified by:
destroy in interface org.codehaus.wadi.Evictable

setId

public void setId(String id)
Specified by:
setId in interface org.apache.catalina.Session

setCreationTime

public void setCreationTime(long creationTime)
Specified by:
setCreationTime in interface org.apache.catalina.Session

getInfo

public String getInfo()
Specified by:
getInfo in interface org.apache.catalina.Session

getSession

public HttpSession getSession()
Specified by:
getSession in interface org.apache.catalina.Session

getManager

public org.apache.catalina.Manager getManager()
Specified by:
getManager in interface org.apache.catalina.Session

setManager

public void setManager(org.apache.catalina.Manager manager)
Specified by:
setManager in interface org.apache.catalina.Session

getAuthType

public String getAuthType()
Specified by:
getAuthType in interface org.apache.catalina.Session

setAuthType

public void setAuthType(String authType)
Specified by:
setAuthType in interface org.apache.catalina.Session

getPrincipal

public Principal getPrincipal()
Specified by:
getPrincipal in interface org.apache.catalina.Session

setPrincipal

public void setPrincipal(Principal principal)
Specified by:
setPrincipal in interface org.apache.catalina.Session

setNote

public void setNote(String name,
                    Object value)
Specified by:
setNote in interface org.apache.catalina.Session

getNote

public Object getNote(String name)
Specified by:
getNote in interface org.apache.catalina.Session

removeNote

public void removeNote(String name)
Specified by:
removeNote in interface org.apache.catalina.Session

getNoteNames

public Iterator getNoteNames()
Specified by:
getNoteNames in interface org.apache.catalina.Session

getSessionListeners

public List getSessionListeners()

addSessionListener

public void addSessionListener(org.apache.catalina.SessionListener listener)
Specified by:
addSessionListener in interface org.apache.catalina.Session

removeSessionListener

public void removeSessionListener(org.apache.catalina.SessionListener listener)
Specified by:
removeSessionListener in interface org.apache.catalina.Session

setValid

public void setValid(boolean isValid)
Specified by:
setValid in interface org.apache.catalina.Session

isValid

public boolean isValid()
Specified by:
isValid in interface org.apache.catalina.Session

setNew

public void setNew(boolean isNew)
Specified by:
setNew in interface org.apache.catalina.Session

access

public void access()
Specified by:
access in interface org.apache.catalina.Session

endAccess

public void endAccess()
Specified by:
endAccess in interface org.apache.catalina.Session

recycle

public void recycle()
Specified by:
recycle in interface org.apache.catalina.Session

expire

public void expire()
Specified by:
expire in interface org.apache.catalina.Session

getIdInternal

public String getIdInternal()
Specified by:
getIdInternal in interface org.apache.catalina.Session

getLastAccessedTime

public long getLastAccessedTime()
Specified by:
getLastAccessedTime in interface org.apache.catalina.Session

getLastAccessedTimeInternal

public long getLastAccessedTimeInternal()
Specified by:
getLastAccessedTimeInternal in interface org.apache.catalina.Session


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