org.exolab.core.database.recman
Class PMDSessionManager

java.lang.Object
  extended by org.exolab.core.database.recman.PMDSessionManager
All Implemented Interfaces:
SessionManagerIfc

public class PMDSessionManager
extends java.lang.Object
implements SessionManagerIfc

Implements the SessionManagerIfc for the page managed database and is responsible for managing the lifecycle all sessions. A session-per-thread restriction is enforced, meaning that a session belongs to one and only one session and that threads cannot share sessions.

This class conforms to the singleton design pattern and is accessible through PMDSessionManager.instance(). for a number of interfaces and i

Version:
$Revision: 1.2 $ $Date: 2003/06/09 06:28:39 $
Author:
Jim Alateras
See Also:
SessionManagerIfc, org,exolab.core.foundation.SessionIfc

Method Summary
 void destroySession()
          Destroy the session associated with thew current thread.
 SessionIfc getSession()
          Return the session associated with the current thread.
static void init(PageManagedDatabase database)
          This static method must be called to initialise the session manager with a database.
static PMDSessionManager instance()
          This method returns the sxingleton instance of the PMDSessionManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

init

public static void init(PageManagedDatabase database)
This static method must be called to initialise the session manager with a database. The SessionManager can only manage one database per virtual machine.

Although not programmatically enforced this method must be called before accessing any other class or instance method

Parameters:
database -

instance

public static PMDSessionManager instance()
This method returns the sxingleton instance of the PMDSessionManager. If such an instance does not yet exist then create it before returning.

Returns:
PMDSessionManager singleton instance

getSession

public SessionIfc getSession()
                      throws FailedToCreateSessionException
Description copied from interface: SessionManagerIfc
Return the session associated with the current thread. If one does not exist then create one. If it cannot create a session then throw FailedToCreatedSessionException exception. If one already exists then simply return a reference to it.

Specified by:
getSession in interface SessionManagerIfc
Returns:
SessionIfc
Throws:
FailedToCreateSessionException

destroySession

public void destroySession()
                    throws FailedToDestroySessionException
Description copied from interface: SessionManagerIfc
Destroy the session associated with thew current thread. If one does not exist then do nothing. If it cannot destroy the session then throw FailedToDestroySessionException exception.

Specified by:
destroySession in interface SessionManagerIfc
Throws:
FailedToDestroySessionException


Copyright © 1999-2012 The Exolab Group. All Rights Reserved.