org.datanucleus.store.connection
Interface ConnectionFactory

All Known Implementing Classes:
AbstractConnectionFactory

public interface ConnectionFactory

Factory for connections to the datastore. To be implemented by all StoreManagers.


Field Summary
static java.lang.String DATANUCLEUS_CONNECTION_RESOURCE_TYPE
          User-visible configuration property name
static java.lang.String DATANUCLEUS_CONNECTION2_RESOURCE_TYPE
          User-visible configuration property name
static java.lang.String RESOURCE_TYPE_OPTION
          Internal property name used on ConnectionFactory instances, range of Values: JTA | RESOURCE_LOCAL
 
Method Summary
 ManagedConnection createManagedConnection(java.lang.Object poolKey, java.util.Map transactionOptions)
          Create the ManagedConnection.
 ManagedConnection getConnection(java.lang.Object poolKey, Transaction transaction, java.util.Map options)
          Obtain a connection from the Factory.
 

Field Detail

DATANUCLEUS_CONNECTION_RESOURCE_TYPE

static final java.lang.String DATANUCLEUS_CONNECTION_RESOURCE_TYPE
User-visible configuration property name

See Also:
Constant Field Values

DATANUCLEUS_CONNECTION2_RESOURCE_TYPE

static final java.lang.String DATANUCLEUS_CONNECTION2_RESOURCE_TYPE
User-visible configuration property name

See Also:
Constant Field Values

RESOURCE_TYPE_OPTION

static final java.lang.String RESOURCE_TYPE_OPTION
Internal property name used on ConnectionFactory instances, range of Values: JTA | RESOURCE_LOCAL

See Also:
DATANUCLEUS_CONNECTION_RESOURCE_TYPE, DATANUCLEUS_CONNECTION2_RESOURCE_TYPE, Constant Field Values
Method Detail

getConnection

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

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

createManagedConnection

ManagedConnection createManagedConnection(java.lang.Object poolKey,
                                          java.util.Map transactionOptions)
Create the ManagedConnection. Only used by ConnectionManager so do not call this.

Parameters:
poolKey - the pool that is bound the connection during its lifecycle (if any)
transactionOptions - the Transaction options this connection will be enlisted to, null if non existent
Returns:
The ManagedConnection.


Copyright © 2010. All Rights Reserved.