it.amattioli.dominate.sessions
Class SessionManagerRegistry

Show UML class diagram
java.lang.Object
  extended by it.amattioli.dominate.sessions.SessionManagerRegistry

public class SessionManagerRegistry
extends Object

This singleton can be used to manage a stack of SessionManager for the current thread. This allow us to have a different session for each context of a thread

Every time we enter a context that needs its own session we can call useSessionManager(SessionManager) passing the SessionManager containing the needed session. After this, every time we will call currentSessionManager(), this SessionManager will be returned. To exit the context we have to call releaseSessionManager() to return to the previous situation. If we call currentSessionManager() and useSessionManager(SessionManager) has never been called, a new SessionManager will be created with thread local life-cycle.

Author:
andrea

Constructor Summary
SessionManagerRegistry()
           
 
Method Summary
 boolean containsSessionManager()
           
 SessionManager currentSessionManager()
           
 void releaseSessionManager()
           
 void useSessionManager(SessionManager newMgr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionManagerRegistry

public SessionManagerRegistry()
Method Detail

containsSessionManager

public boolean containsSessionManager()

currentSessionManager

public SessionManager currentSessionManager()

useSessionManager

public void useSessionManager(SessionManager newMgr)

releaseSessionManager

public void releaseSessionManager()


Copyright © 2011. All Rights Reserved.