C
- The kind of Connection
to manage.public class ManagedDataSource<C extends Connection> extends PoolingDataSource<C>
Constructor and Description |
---|
ManagedDataSource(ObjectPool<C> pool,
TransactionRegistry transactionRegistry)
Creates a ManagedDataSource which obtains connections from the specified pool and manages them using the
specified transaction registry.
|
Modifier and Type | Method and Description |
---|---|
Connection |
getConnection()
Returns a
Connection from my pool, according to the contract specified by
ObjectPool.borrowObject() . |
void |
setTransactionRegistry(TransactionRegistry transactionRegistry)
Sets the transaction registry from the XAConnectionFactory used to create the pool.
|
close, getConnection, getLoginTimeout, getLogWriter, getParentLogger, getPool, isAccessToUnderlyingConnectionAllowed, isWrapperFor, setAccessToUnderlyingConnectionAllowed, setLoginTimeout, setLogWriter, unwrap
public ManagedDataSource(ObjectPool<C> pool, TransactionRegistry transactionRegistry)
pool
- the connection pooltransactionRegistry
- the transaction registry obtained from the XAConnectionFactory used to create the connection pool
object factorypublic void setTransactionRegistry(TransactionRegistry transactionRegistry)
transactionRegistry
- the transaction registry acquired from the XAConnectionFactory used to create the poolpublic Connection getConnection() throws SQLException
PoolingDataSource
Connection
from my pool, according to the contract specified by
ObjectPool.borrowObject()
.getConnection
in interface DataSource
getConnection
in class PoolingDataSource<C extends Connection>
SQLException
Copyright © 2001–2018 The Apache Software Foundation. All rights reserved.