public abstract class AbstractConnectionFactory extends Object implements ConnectionFactory
| Modifier and Type | Field and Description |
|---|---|
static String |
RESOURCE_NAME_NONTX |
static String |
RESOURCE_NAME_TX |
protected String |
resourceName
Name of this resource ("tx", "non-tx" etc).
|
protected String |
resourceType
Type of resource represented by this ConnectionFactory.
|
protected StoreManager |
storeMgr |
DATANUCLEUS_CONNECTION_RESOURCE_TYPE, DATANUCLEUS_CONNECTION2_RESOURCE_TYPE| Constructor and Description |
|---|
AbstractConnectionFactory(StoreManager storeMgr,
String resourceName)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release any resources that have been allocated.
|
ManagedConnection |
getConnection(ExecutionContext ec,
Transaction txn,
Map options)
Obtain a connection from the Factory.
|
String |
getResourceName() |
String |
getResourceType()
Type of resource that this ConnectionFactory represents.
|
String |
toString()
Method to return a string form of this object for convenience debug.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateManagedConnectionprotected StoreManager storeMgr
protected String resourceType
protected String resourceName
public static final String RESOURCE_NAME_TX
public static final String RESOURCE_NAME_NONTX
public AbstractConnectionFactory(StoreManager storeMgr, String resourceName)
storeMgr - The store manager needing the connectionresourceName - Name of resource (tx, nontx)public String getResourceName()
public String getResourceType()
ConnectionFactorygetResourceType in interface ConnectionFactorypublic ManagedConnection getConnection(ExecutionContext ec, Transaction txn, Map options)
ConnectionFactorygetConnection in interface ConnectionFactoryec - ExecutionContext that the connection is bound to during its lifecycle (or null)txn - The transaction to enlist withoptions - Any options for then creating the connectionManagedConnectionpublic void close()
ConnectionFactoryclose in interface ConnectionFactoryCopyright © 2017. All rights reserved.