jodd.petite.scope
Class SessionScope

java.lang.Object
  extended by jodd.petite.scope.SessionScope
All Implemented Interfaces:
Scope

public class SessionScope
extends java.lang.Object
implements Scope

Session scope stores unique object instances per single http session. Upon creation, new session listener is registered (dynamically) that will keep track on active sessions.RequestContextListener is used for accessing the request.


Field Summary
protected  java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> sessionInstances
           
protected  jodd.servlet.HttpSessionListenerBroadcaster sessionListeners
           
 
Constructor Summary
SessionScope()
           
 
Method Summary
protected  java.lang.String getHttpSessionId()
          Returns request from current thread.
 java.lang.Object lookup(java.lang.String name)
          Lookups for bean name.
 void register(java.lang.String name, java.lang.Object object)
          Registers the bean within the current scope.
 void remove(java.lang.String name)
          Removes the bean from the scope entirely.
 void replaceIn(java.lang.String name, ScopeReplacer scopeReplacer)
          Replaces the bean in current scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sessionInstances

protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> sessionInstances

sessionListeners

protected final jodd.servlet.HttpSessionListenerBroadcaster sessionListeners
Constructor Detail

SessionScope

public SessionScope()
Method Detail

lookup

public java.lang.Object lookup(java.lang.String name)
Description copied from interface: Scope
Lookups for bean name.

Specified by:
lookup in interface Scope

register

public void register(java.lang.String name,
                     java.lang.Object object)
Description copied from interface: Scope
Registers the bean within the current scope.

Specified by:
register in interface Scope

remove

public void remove(java.lang.String name)
Description copied from interface: Scope
Removes the bean from the scope entirely.

Specified by:
remove in interface Scope

replaceIn

public void replaceIn(java.lang.String name,
                      ScopeReplacer scopeReplacer)
Description copied from interface: Scope
Replaces the bean in current scope. Second parameter is provided by container.

Specified by:
replaceIn in interface Scope

getHttpSessionId

protected java.lang.String getHttpSessionId()
Returns request from current thread.



Copyright ©2008 Jodd Team