org.objectweb.telosys.dal.dao
Class CurrentDatabaseSession

java.lang.Object
  extended byorg.objectweb.telosys.dal.dao.CurrentDatabaseSession

public class CurrentDatabaseSession
extends java.lang.Object

This class gives access to the current DatabaseSession associated with the current thread
The DatabaseSession is stored as a "thread-local variable" ( see ThreadLocal for more details )

Since:
v 1.0.2

Constructor Summary
CurrentDatabaseSession()
           
 
Method Summary
static DatabaseSession get()
          Returns the DatabaseSession instance associated with the current thread.
protected static DatabaseSession getInternal()
          Returns the DatabaseSession instance associated with the current thread.
protected static void remove()
          Removes the DatabaseSession instance associated with the current thread.
protected static boolean removeIfStored(DatabaseSession dbSession)
          Removes the DatabaseSession instance associated with the current thread if it's the same instance as the given DatabaseSession.
protected static void set(DatabaseSession dbSession)
          Sets the DatabaseSession instance associated with the current thread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CurrentDatabaseSession

public CurrentDatabaseSession()
Method Detail

get

public static final DatabaseSession get()
Returns the DatabaseSession instance associated with the current thread.

Returns:
Throws:
TelosysRuntimeException - if no current DatabaseSession

getInternal

protected static final DatabaseSession getInternal()
Returns the DatabaseSession instance associated with the current thread.
or null if there's no current DatabaseSession for the thread. Method reserved for framework internal use.

Returns:

set

protected static final void set(DatabaseSession dbSession)
Sets the DatabaseSession instance associated with the current thread. Method reserved for framework internal use.

Parameters:
dbSession -

removeIfStored

protected static final boolean removeIfStored(DatabaseSession dbSession)
Removes the DatabaseSession instance associated with the current thread if it's the same instance as the given DatabaseSession. Method reserved for framework internal use.

Parameters:
dbSession -
Returns:

remove

protected static final void remove()
Removes the DatabaseSession instance associated with the current thread. Method reserved for framework internal use.