sf logo

sf.qof.session
Class SessionContextFactory.DefaultSessionContext

java.lang.Object
  extended by sf.qof.session.SessionContextFactory.DefaultSessionContext
All Implemented Interfaces:
SessionContext
Enclosing class:
SessionContextFactory

protected static class SessionContextFactory.DefaultSessionContext
extends Object
implements SessionContext

Internal implementation of SessionContext. Uses a ThreadLocal field to handle sessions for different threads.


Field Summary
 
Fields inherited from interface sf.qof.session.SessionContext
DEFAULT_CONTEXT_NAME
 
Method Summary
 Connection getConnection()
          Returns the database connection of the session belonging to the calling thread.
 UserTransaction getUserTransaction()
          Returns the user transaction of the session belonging to the calling thread.
 void startSession()
          This method starts a session.
 void stopSession()
          This method stops a session.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConnection

public Connection getConnection()
Description copied from interface: SessionContext
Returns the database connection of the session belonging to the calling thread.

Specified by:
getConnection in interface SessionContext
Returns:
the current connection

getUserTransaction

public UserTransaction getUserTransaction()
Description copied from interface: SessionContext
Returns the user transaction of the session belonging to the calling thread.

Specified by:
getUserTransaction in interface SessionContext
Returns:
the current user transaction

startSession

public void startSession()
                  throws SystemException
Description copied from interface: SessionContext
This method starts a session. It creates a new session for the calling thread and assigns a database connection to it and it creates a new transaction. It must be called by the calling thread before any other method of this session context can be called.

Specified by:
startSession in interface SessionContext
Throws:
SystemException - Thrown if an unexpected error condition occurs

stopSession

public void stopSession()
                 throws SystemException
Description copied from interface: SessionContext
This method stops a session. It closes the database connection of the session owned by the calling thread.

Specified by:
stopSession in interface SessionContext
Throws:
SystemException - Thrown if an unexpected error condition occurs

sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.