org.openorb.ots.xa
Class SessionManager

java.lang.Object
  extended by org.omg.CORBA.LocalObject
      extended by org.openorb.ots.xa.SessionManager
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.sql.ConnectionEventListener, org.apache.avalon.framework.logger.LogEnabled, org.omg.CORBA.Object, org.omg.CORBA.portable.IDLEntity, SessionManager, SessionManagerOperations

public class SessionManager
extends org.omg.CORBA.LocalObject
implements SessionManager, javax.sql.ConnectionEventListener, org.apache.avalon.framework.logger.LogEnabled

This class is a session manager that provides a connection to a user for SQL statements. The same connection will be used for XA.

Author:
Jerome Daniel
See Also:
Serialized Form

Constructor Summary
SessionManager(org.omg.PortableInterceptor.ORBInitInfo info)
          Constructor
 
Method Summary
 void connectionClosed(javax.sql.ConnectionEvent event)
          This operation is called by the application when it invokes the 'close' operation on the connection.
 void connectionErrorOccurred(javax.sql.ConnectionEvent event)
          This operation is called when an error occured.
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
           
 void freeConnections(Coordinator coordinator)
          This operation is used to free connections.
 java.sql.Connection getConnection(java.lang.String name, java.lang.String password, java.lang.String profile)
          Return a new database connection for the user
 org.apache.avalon.framework.logger.Logger getLogger()
           
 void updateConnection(javax.sql.XAConnection xa_connection, Coordinator coordinator)
          This operation is used to update a connection coordinator
 
Methods inherited from class org.omg.CORBA.LocalObject
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_interface, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_policy_override, validate_connection
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.omg.CORBA.Object
_create_request, _create_request, _duplicate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _is_a, _is_equivalent, _non_existent, _release, _request, _set_policy_override
 

Constructor Detail

SessionManager

public SessionManager(org.omg.PortableInterceptor.ORBInitInfo info)
Constructor

Method Detail

getConnection

public java.sql.Connection getConnection(java.lang.String name,
                                         java.lang.String password,
                                         java.lang.String profile)
Return a new database connection for the user

Specified by:
getConnection in interface SessionManagerOperations
Parameters:
name - the user name to get a connection to the database.
password - the user password to get a connection to the database.
profile - the database profile ( this profile name is used to get information from the openORB OTS configuration file, i.e. JDBC driver and so on... )
Returns:
a connection handle to access to the database

freeConnections

public void freeConnections(Coordinator coordinator)
This operation is used to free connections.

Specified by:
freeConnections in interface SessionManagerOperations

updateConnection

public void updateConnection(javax.sql.XAConnection xa_connection,
                             Coordinator coordinator)
This operation is used to update a connection coordinator

Specified by:
updateConnection in interface SessionManagerOperations

connectionClosed

public void connectionClosed(javax.sql.ConnectionEvent event)
This operation is called by the application when it invokes the 'close' operation on the connection.

Specified by:
connectionClosed in interface javax.sql.ConnectionEventListener

connectionErrorOccurred

public void connectionErrorOccurred(javax.sql.ConnectionEvent event)
This operation is called when an error occured.

Specified by:
connectionErrorOccurred in interface javax.sql.ConnectionEventListener

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled

getLogger

public org.apache.avalon.framework.logger.Logger getLogger()