org.datanucleus.store.rdbms
Class ConnectionFactoryImpl
java.lang.Object
org.datanucleus.store.connection.AbstractConnectionFactory
org.datanucleus.store.rdbms.ConnectionFactoryImpl
- All Implemented Interfaces:
- org.datanucleus.store.connection.ConnectionFactory
public class ConnectionFactoryImpl
- extends org.datanucleus.store.connection.AbstractConnectionFactory
ConnectionFactory for RDBMS datastores.
Each instance is a factory of Transactional connection or NonTransactional connection.
|
Field Summary |
protected static org.datanucleus.util.Localiser |
LOCALISER_RDBMS
Localiser for messages. |
| Fields inherited from class org.datanucleus.store.connection.AbstractConnectionFactory |
options, resourceType, storeMgr |
| Fields inherited from interface org.datanucleus.store.connection.ConnectionFactory |
DATANUCLEUS_CONNECTION_RESOURCE_TYPE, DATANUCLEUS_CONNECTION2_RESOURCE_TYPE, RESOURCE_TYPE_OPTION |
| Methods inherited from class org.datanucleus.store.connection.AbstractConnectionFactory |
close, getConnection, toString |
LOCALISER_RDBMS
protected static final org.datanucleus.util.Localiser LOCALISER_RDBMS
- Localiser for messages.
ConnectionFactoryImpl
public ConnectionFactoryImpl(org.datanucleus.store.StoreManager storeMgr,
String resourceType)
- Constructor.
- Parameters:
storeMgr - The contextresourceType - either tx or nontx
createManagedConnection
public org.datanucleus.store.connection.ManagedConnection createManagedConnection(Object poolKey,
Map transactionOptions)
- Method to create a new ManagedConnection.
- Parameters:
poolKey - the object that is bound the connection during its lifecycle (if any)transactionOptions - Transaction options
- Returns:
- The ManagedConnection
getPoolingType
public String getPoolingType()
- Accessor for the pooling type (if any).
- Returns:
- Pooling type to use (name of a pool type, or null)
calculatePoolingType
protected String calculatePoolingType(String requiredPoolingType)
- Method to set the connection pooling type (if any).
Tries to use any user-provided value if possible, otherwise will fallback to something
available in the CLASSPATH (if any), else use the builtin DBCP.
- Parameters:
requiredPoolingType - Pooling type requested by the user
- Returns:
- Pooling type to use (name of a pool type)
dbcpPresent
protected boolean dbcpPresent(org.datanucleus.ClassLoaderResolver clr)
c3p0Present
protected boolean c3p0Present(org.datanucleus.ClassLoaderResolver clr)
proxoolPresent
protected boolean proxoolPresent(org.datanucleus.ClassLoaderResolver clr)
bonecpPresent
protected boolean bonecpPresent(org.datanucleus.ClassLoaderResolver clr)
Copyright © 2012. All Rights Reserved.