- java.lang.Object
-
- org.datanucleus.store.connection.AbstractConnectionFactory
-
- All Implemented Interfaces:
ConnectionFactory
public abstract class AbstractConnectionFactory extends Object implements ConnectionFactory
Abstract implementation of a ConnectionFactory for a DataNucleus-supported datastore.
-
-
Field Summary
Fields Modifier and Type Field 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
-
Fields inherited from interface org.datanucleus.store.connection.ConnectionFactory
DATANUCLEUS_CONNECTION_RESOURCE_TYPE, DATANUCLEUS_CONNECTION2_RESOURCE_TYPE
-
-
Constructor Summary
Constructors Constructor Description AbstractConnectionFactory(StoreManager storeMgr, String resourceName)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Release any resources that have been allocated.String
getResourceName()
Accessor for the resource name (e.g "jdbc/tx").String
getResourceType()
Type of resource that this ConnectionFactory represents.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
-
storeMgr
protected StoreManager storeMgr
-
resourceType
protected final String resourceType
Type of resource represented by this ConnectionFactory. See ConnectionResourceType.
-
resourceName
protected final String resourceName
Name of this resource ("tx", "non-tx" etc).
-
RESOURCE_NAME_TX
public static final String RESOURCE_NAME_TX
- See Also:
- Constant Field Values
-
RESOURCE_NAME_NONTX
public static final String RESOURCE_NAME_NONTX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractConnectionFactory
public AbstractConnectionFactory(StoreManager storeMgr, String resourceName)
Constructor.- Parameters:
storeMgr
- The store manager needing the connectionresourceName
- Name of resource (tx, nontx)
-
-
Method Detail
-
getResourceName
public String getResourceName()
Description copied from interface:ConnectionFactory
Accessor for the resource name (e.g "jdbc/tx").- Specified by:
getResourceName
in interfaceConnectionFactory
- Returns:
- The resource name
-
getResourceType
public String getResourceType()
Description copied from interface:ConnectionFactory
Type of resource that this ConnectionFactory represents. See ConnectionResourceType.- Specified by:
getResourceType
in interfaceConnectionFactory
- Returns:
- Resource type ("JTA", "RESOURCE_LOCAL")
-
close
public void close()
Description copied from interface:ConnectionFactory
Release any resources that have been allocated.- Specified by:
close
in interfaceConnectionFactory
-
-