org.datanucleus.store.connection
Class AbstractConnectionFactory

java.lang.Object
  extended by org.datanucleus.store.connection.AbstractConnectionFactory
All Implemented Interfaces:
ConnectionFactory

public abstract class AbstractConnectionFactory
extends java.lang.Object
implements ConnectionFactory

Abstract implementation of a ConnectionFactory for a DataNucleus supported datastore.


Field Summary
protected  OMFContext omfContext
          The underlying ObjectManagerFactory context.
protected  java.util.Map options
           
 
Fields inherited from interface org.datanucleus.store.connection.ConnectionFactory
DATANUCLEUS_CONNECTION_RESOURCE_TYPE, DATANUCLEUS_CONNECTION2_RESOURCE_TYPE, RESOURCE_TYPE_OPTION
 
Constructor Summary
AbstractConnectionFactory(OMFContext omfContext, java.lang.String resourceType)
          Constructor.
 
Method Summary
 ManagedConnection getConnection(java.lang.Object boundto, Transaction transaction, java.util.Map options)
          Obtain a connection from the Factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.datanucleus.store.connection.ConnectionFactory
createManagedConnection
 

Field Detail

omfContext

protected OMFContext omfContext
The underlying ObjectManagerFactory context.


options

protected java.util.Map options
Constructor Detail

AbstractConnectionFactory

public AbstractConnectionFactory(OMFContext omfContext,
                                 java.lang.String resourceType)
Constructor.

Parameters:
omfContext - The OMF context
resourceType - Type of resource (tx, nontx)
Method Detail

getConnection

public ManagedConnection getConnection(java.lang.Object boundto,
                                       Transaction transaction,
                                       java.util.Map options)
Description copied from interface: ConnectionFactory
Obtain a connection from the Factory. The connection will be enlisted within the Transaction associated to the poolKey if "enlist" is set to true.

Specified by:
getConnection in interface ConnectionFactory
Parameters:
boundto - the pool that is bound the connection during its lifecycle (or null)
options - Any options for then creating the connection
Returns:
the ManagedConnection


Copyright © 2010. All Rights Reserved.