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
           
protected  java.lang.String resourceType
           
 
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 poolKey, Transaction transaction, java.util.Map options)
          Obtain a connection from the Factory.
 java.lang.String toString()
          Method to return a string form of this object for convenience debug.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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

resourceType

protected java.lang.String resourceType
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 poolKey,
                                       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:
poolKey - the pool that is bound the connection during its lifecycle (or null)
options - Any options for then creating the connection
Returns:
the ManagedConnection

toString

public java.lang.String toString()
Method to return a string form of this object for convenience debug.

Overrides:
toString in class java.lang.Object
Returns:
The String form


Copyright © 2011. All Rights Reserved.