org.openorb.ots.xa
Class XAVirtualConnection

java.lang.Object
  extended by org.openorb.ots.xa.XAVirtualConnection
All Implemented Interfaces:
javax.sql.PooledConnection, javax.sql.XAConnection

public class XAVirtualConnection
extends java.lang.Object
implements javax.sql.XAConnection

This class provides a virtual XA connection to manage an XA session without a jdbc driver that includes optional packages of JDBC 2.0

Author:
Jerome Daniel

Constructor Summary
XAVirtualConnection(java.sql.Connection connection, XAVirtualDataSource xa_datasource)
          Constructor
 
Method Summary
 void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
          Add an event listener
 void close()
          Close an XA connection
 void closeEvent()
          This operation is called to notify to all registered listener a close event.
 void errorEvent(java.sql.SQLException ex)
          This operation is called to notify to all registered listener an error event.
 java.sql.Connection getConnection()
          Return the connection for SQL statements
 java.lang.String getDataSourceMetaData()
          Return the DataSource meta data
 javax.transaction.xa.XAResource getXAResource()
          This operation is called by the SessionManager to get an XA Resource on the database.
 void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
          Remove an event listener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XAVirtualConnection

public XAVirtualConnection(java.sql.Connection connection,
                           XAVirtualDataSource xa_datasource)
Constructor

Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Return the connection for SQL statements

Specified by:
getConnection in interface javax.sql.PooledConnection
Throws:
java.sql.SQLException

close

public void close()
           throws java.sql.SQLException
Close an XA connection

Specified by:
close in interface javax.sql.PooledConnection
Throws:
java.sql.SQLException

addConnectionEventListener

public void addConnectionEventListener(javax.sql.ConnectionEventListener listener)
Add an event listener

Specified by:
addConnectionEventListener in interface javax.sql.PooledConnection

removeConnectionEventListener

public void removeConnectionEventListener(javax.sql.ConnectionEventListener listener)
Remove an event listener

Specified by:
removeConnectionEventListener in interface javax.sql.PooledConnection

getXAResource

public javax.transaction.xa.XAResource getXAResource()
                                              throws java.sql.SQLException
This operation is called by the SessionManager to get an XA Resource on the database.

Specified by:
getXAResource in interface javax.sql.XAConnection
Throws:
java.sql.SQLException

closeEvent

public void closeEvent()
This operation is called to notify to all registered listener a close event.


errorEvent

public void errorEvent(java.sql.SQLException ex)
This operation is called to notify to all registered listener an error event.


getDataSourceMetaData

public java.lang.String getDataSourceMetaData()
Return the DataSource meta data