Package africa.absa.inception.test
Class XADataSourceProxy
java.lang.Object
africa.absa.inception.test.XADataSourceProxy
- All Implemented Interfaces:
CommonDataSource,XADataSource
The DataSourceProxy class provides a proxy that tracks the JDBC connections associated
with the current thread and managed by a javax.sql.XADataSource implementation.
- Author:
- Marcus Portmann
-
Constructor Summary
ConstructorsConstructorDescriptionXADataSourceProxy(XADataSource xaDataSource) Constructs a new XADataSourceProxy. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddActiveXADatabaseConnection(XAConnection connection) Add the XA database connection to the tracked active XA database connections associated with the current thread.static Map<XAConnection,StackTraceElement[]> Returns the active XA database connections for all Data Sources associated with the tracker.intgetXAConnection(String user, String password) voidsetLoginTimeout(int seconds) voidsetLogWriter(PrintWriter out)
-
Constructor Details
-
XADataSourceProxy
Constructs a new XADataSourceProxy.- Parameters:
xaDataSource- the XA data source
-
-
Method Details
-
addActiveXADatabaseConnection
Add the XA database connection to the tracked active XA database connections associated with the current thread.- Parameters:
connection- the connection
-
getActiveXADatabaseConnections
Returns the active XA database connections for all Data Sources associated with the tracker.- Returns:
- the active XA database connections for all Data Sources associated with the tracker
-
createShardingKeyBuilder
- Specified by:
createShardingKeyBuilderin interfaceCommonDataSource- Throws:
SQLException
-
createXAConnectionBuilder
- Specified by:
createXAConnectionBuilderin interfaceXADataSource- Throws:
SQLException
-
getLogWriter
- Specified by:
getLogWriterin interfaceCommonDataSource- Specified by:
getLogWriterin interfaceXADataSource- Throws:
SQLException
-
getLoginTimeout
- Specified by:
getLoginTimeoutin interfaceCommonDataSource- Specified by:
getLoginTimeoutin interfaceXADataSource- Throws:
SQLException
-
getParentLogger
- Specified by:
getParentLoggerin interfaceCommonDataSource- Throws:
SQLFeatureNotSupportedException
-
getXAConnection
- Specified by:
getXAConnectionin interfaceXADataSource- Throws:
SQLException
-
getXAConnection
- Specified by:
getXAConnectionin interfaceXADataSource- Throws:
SQLException
-
setLogWriter
- Specified by:
setLogWriterin interfaceCommonDataSource- Specified by:
setLogWriterin interfaceXADataSource- Throws:
SQLException
-
setLoginTimeout
- Specified by:
setLoginTimeoutin interfaceCommonDataSource- Specified by:
setLoginTimeoutin interfaceXADataSource- Throws:
SQLException
-