org.datanucleus.store.rdbms
Class ConnectionFactoryImpl

java.lang.Object
  extended by org.datanucleus.store.rdbms.ConnectionFactoryImpl
All Implemented Interfaces:
org.datanucleus.ConnectionFactory

public class ConnectionFactoryImpl
extends java.lang.Object
implements org.datanucleus.ConnectionFactory

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 interface org.datanucleus.ConnectionFactory
DATANUCLEUS_CONNECTION_RESOURCE_TYPE, DATANUCLEUS_CONNECTION2_RESOURCE_TYPE, RESOURCE_TYPE_OPTION
 
Constructor Summary
ConnectionFactoryImpl(org.datanucleus.OMFContext omfContext, java.lang.String resourceType)
          Constructor.
 
Method Summary
 org.datanucleus.ManagedConnection createManagedConnection(org.datanucleus.ObjectManager om, java.util.Map transactionOptions)
          Method to create a new ManagedConnection.
 org.datanucleus.ManagedConnection getConnection(org.datanucleus.ObjectManager om, java.util.Map options)
          Method to return a connection (either already existing from cache, or newly allocated) enlisting it in any transaction.
 java.lang.String getPoolingType()
          Accessor for the pooling type (if any).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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.OMFContext omfContext,
                             java.lang.String resourceType)
Constructor.

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

getPoolingType

public java.lang.String getPoolingType()
Accessor for the pooling type (if any). If set to a value will use that, otherwise (if unset) will check if any supported pooling capabilities are present and available. Currently checks DBCP, C3P0, Proxool.

Returns:
Pooling type to use (name of a pool type, or "default")

getConnection

public org.datanucleus.ManagedConnection getConnection(org.datanucleus.ObjectManager om,
                                                       java.util.Map options)
Method to return a connection (either already existing from cache, or newly allocated) enlisting it in any transaction.

Specified by:
getConnection in interface org.datanucleus.ConnectionFactory
Parameters:
om - The ObjectManager (or null)
options - Options for when creating the connection
Returns:
The ManagedConnection

createManagedConnection

public org.datanucleus.ManagedConnection createManagedConnection(org.datanucleus.ObjectManager om,
                                                                 java.util.Map transactionOptions)
Method to create a new ManagedConnection.

Specified by:
createManagedConnection in interface org.datanucleus.ConnectionFactory
Parameters:
om - ObjectManager (if any)
transactionOptions - Transaction options
Returns:
The ManagedConnection


Copyright © 2009. All Rights Reserved.