org.datanucleus.store.rdbms
Class ConnectionFactoryImpl

java.lang.Object
  extended by org.datanucleus.store.connection.AbstractConnectionFactory
      extended by 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
 
Constructor Summary
ConnectionFactoryImpl(org.datanucleus.store.StoreManager storeMgr, String resourceType)
          Constructor.
 
Method Summary
protected  boolean bonecpPresent(org.datanucleus.ClassLoaderResolver clr)
           
protected  boolean c3p0Present(org.datanucleus.ClassLoaderResolver clr)
           
protected  String calculatePoolingType(String requiredPoolingType)
          Method to set the connection pooling type (if any).
 org.datanucleus.store.connection.ManagedConnection createManagedConnection(Object poolKey, Map transactionOptions)
          Method to create a new ManagedConnection.
protected  boolean dbcpPresent(org.datanucleus.ClassLoaderResolver clr)
           
 String getPoolingType()
          Accessor for the pooling type (if any).
protected  boolean proxoolPresent(org.datanucleus.ClassLoaderResolver clr)
           
 
Methods inherited from class org.datanucleus.store.connection.AbstractConnectionFactory
close, getConnection, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALISER_RDBMS

protected static final org.datanucleus.util.Localiser LOCALISER_RDBMS
Localiser for messages.

Constructor Detail

ConnectionFactoryImpl

public ConnectionFactoryImpl(org.datanucleus.store.StoreManager storeMgr,
                             String resourceType)
Constructor.

Parameters:
storeMgr - The context
resourceType - either tx or nontx
Method Detail

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.