org.datanucleus.jdo.connector
Class PersistenceManagerFactoryImpl

java.lang.Object
  extended by org.datanucleus.jdo.connector.PersistenceManagerFactoryImpl
All Implemented Interfaces:
java.io.Serializable, javax.jdo.PersistenceManagerFactory, javax.naming.Referenceable, javax.resource.cci.ConnectionFactory

public class PersistenceManagerFactoryImpl
extends java.lang.Object
implements javax.resource.cci.ConnectionFactory, javax.jdo.PersistenceManagerFactory

PersistenceManagerFactoryImpl for J2EE

Version:
$Revision: 1.1 $
See Also:
Serialized Form

Constructor Summary
PersistenceManagerFactoryImpl(ManagedConnectionFactoryImpl mcf, javax.resource.spi.ConnectionManager cm)
          Constructor
 
Method Summary
 void addFetchGroups(javax.jdo.FetchGroup[] groups)
           
 void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener, java.lang.Class[] classes)
          JDO 2.0 spec 12.15 "LifecycleListeners".
 void close()
           
 javax.resource.cci.Connection getConnection()
          This is invoked when the user asks for an instance of the PersistenceManager; If this method is invoked multiple times in a single transaction, it's invoked on the same instance of this PMF;
 javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionSpec cs)
           
 java.lang.String getConnectionDriverName()
           
 java.lang.Object getConnectionFactory()
           
 java.lang.Object getConnectionFactory2()
           
 java.lang.String getConnectionFactory2Name()
           
 java.lang.String getConnectionFactoryName()
           
 java.lang.String getConnectionURL()
          Accessor for the connection URL
 java.lang.String getConnectionUserName()
          Accessor for the username
 boolean getCopyOnAttach()
           
 javax.jdo.datastore.DataStoreCache getDataStoreCache()
          Accessor for the Datastore Cache
 boolean getDetachAllOnCommit()
          Accessor for whether to detach objects on commit of the txn.
 javax.jdo.FetchGroup getFetchGroup(java.lang.Class cls, java.lang.String name)
           
 java.util.Set getFetchGroups()
           
 boolean getIgnoreCache()
           
 java.lang.String getMapping()
          Accessor for the mapping name
 javax.resource.cci.ResourceAdapterMetaData getMetaData()
           
 boolean getMultithreaded()
           
 java.lang.String getName()
          Accessor for the name of the PMF.
 boolean getNontransactionalRead()
           
 boolean getNontransactionalWrite()
           
 boolean getOptimistic()
           
 javax.jdo.PersistenceManager getPersistenceManager()
           
 javax.jdo.PersistenceManager getPersistenceManager(java.lang.String user, java.lang.String pw)
           
 javax.jdo.PersistenceManager getPersistenceManagerProxy()
           
 java.lang.String getPersistenceUnitName()
          Accessor for the persistence-unit name.
 java.util.Properties getProperties()
           
 boolean getReadOnly()
           
 javax.resource.cci.RecordFactory getRecordFactory()
           
 javax.naming.Reference getReference()
           
 boolean getRestoreValues()
           
 boolean getRetainValues()
           
 java.lang.String getServerTimeZoneID()
          Accessor for the server timezone id.
 java.lang.String getTransactionIsolationLevel()
           
 java.lang.String getTransactionType()
          Accessor for the transaction type.
 boolean isClosed()
          Accessor for whether the PMF is closed.
 void removeAllFetchGroups()
           
 void removeFetchGroups(javax.jdo.FetchGroup[] groups)
           
 void removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
          JDO 2.0 spec 12.15 "LifecycleListeners".
 void setConnectionDriverName(java.lang.String drivername)
           
 void setConnectionFactory(java.lang.Object conn_factory)
           
 void setConnectionFactory2(java.lang.Object conn_factory)
           
 void setConnectionFactory2Name(java.lang.String conn_factory_name)
           
 void setConnectionFactoryName(java.lang.String conn_factory_name)
           
 void setConnectionPassword(java.lang.String password)
          Mutator for the Password
 void setConnectionURL(java.lang.String url)
          Mutator for the connection URL
 void setConnectionUserName(java.lang.String username)
          Mutator for the Username
 void setCopyOnAttach(boolean flag)
           
 void setDetachAllOnCommit(boolean detach)
          Mutator for whether to detach all objects on commit of the txn.
 void setIgnoreCache(boolean ignore)
           
 void setMapping(java.lang.String mapping)
          Mutator for the Mapping name
 void setMultithreaded(boolean multithreaded)
           
 void setName(java.lang.String name)
          Mutator for the name of the PMF.
 void setNontransactionalRead(boolean nontrans_read)
           
 void setNontransactionalWrite(boolean nontrans_write)
           
 void setOptimistic(boolean optimistic)
           
 void setPersistenceUnitName(java.lang.String name)
          Mutator for the persistence-unit name
 void setReadOnly(boolean readOnly)
           
 void setReference(javax.naming.Reference ref)
           
 void setRestoreValues(boolean restore_values)
           
 void setRetainValues(boolean retain_values)
           
 void setServerTimeZoneID(java.lang.String id)
          Mutator for the server timezone id.
 void setTransactionIsolationLevel(java.lang.String level)
           
 void setTransactionType(java.lang.String type)
          Mutator for the transaction type.
 java.util.Collection supportedOptions()
          Accessor for the supported options
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceManagerFactoryImpl

public PersistenceManagerFactoryImpl(ManagedConnectionFactoryImpl mcf,
                                     javax.resource.spi.ConnectionManager cm)
Constructor

Parameters:
mcf - the ManagedConnectionFactory
cm - the ConnectionManager
Method Detail

setReference

public void setReference(javax.naming.Reference ref)
Parameters:
ref -

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Specified by:
getReference in interface javax.naming.Referenceable
Returns:
Throws:
javax.naming.NamingException -

getConnection

public javax.resource.cci.Connection getConnection()
                                            throws javax.resource.ResourceException
This is invoked when the user asks for an instance of the PersistenceManager; If this method is invoked multiple times in a single transaction, it's invoked on the same instance of this PMF;

Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory
Returns:
Throws:
javax.resource.ResourceException -

getConnection

public javax.resource.cci.Connection getConnection(javax.resource.cci.ConnectionSpec cs)
                                            throws javax.resource.ResourceException
Specified by:
getConnection in interface javax.resource.cci.ConnectionFactory
Parameters:
cs -
Returns:
Throws:
javax.resource.ResourceException -

getMetaData

public javax.resource.cci.ResourceAdapterMetaData getMetaData()
                                                       throws javax.resource.ResourceException
Specified by:
getMetaData in interface javax.resource.cci.ConnectionFactory
Returns:
Throws:
javax.resource.ResourceException -

getRecordFactory

public javax.resource.cci.RecordFactory getRecordFactory()
                                                  throws javax.resource.ResourceException
Specified by:
getRecordFactory in interface javax.resource.cci.ConnectionFactory
Returns:
Throws:
javax.resource.ResourceException -

getProperties

public java.util.Properties getProperties()
Specified by:
getProperties in interface javax.jdo.PersistenceManagerFactory
Returns:

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()
Specified by:
getPersistenceManager in interface javax.jdo.PersistenceManagerFactory
Returns:

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager(java.lang.String user,
                                                          java.lang.String pw)
Specified by:
getPersistenceManager in interface javax.jdo.PersistenceManagerFactory
Parameters:
user - Username
pw - password
Returns:
PersistenceManager

setConnectionUserName

public void setConnectionUserName(java.lang.String username)
Mutator for the Username

Specified by:
setConnectionUserName in interface javax.jdo.PersistenceManagerFactory
Parameters:
username - Username

getConnectionUserName

public java.lang.String getConnectionUserName()
Accessor for the username

Specified by:
getConnectionUserName in interface javax.jdo.PersistenceManagerFactory
Returns:
Username

setConnectionPassword

public void setConnectionPassword(java.lang.String password)
Mutator for the Password

Specified by:
setConnectionPassword in interface javax.jdo.PersistenceManagerFactory
Parameters:
password - Password

setConnectionURL

public void setConnectionURL(java.lang.String url)
Mutator for the connection URL

Specified by:
setConnectionURL in interface javax.jdo.PersistenceManagerFactory
Parameters:
url - Connection URL for the datasource

getConnectionURL

public java.lang.String getConnectionURL()
Accessor for the connection URL

Specified by:
getConnectionURL in interface javax.jdo.PersistenceManagerFactory
Returns:
The connection URL

setConnectionDriverName

public void setConnectionDriverName(java.lang.String drivername)
Specified by:
setConnectionDriverName in interface javax.jdo.PersistenceManagerFactory
Parameters:
drivername - Driver name

getConnectionDriverName

public java.lang.String getConnectionDriverName()
Specified by:
getConnectionDriverName in interface javax.jdo.PersistenceManagerFactory
Returns:
The connection driver name

setConnectionFactoryName

public void setConnectionFactoryName(java.lang.String conn_factory_name)
Specified by:
setConnectionFactoryName in interface javax.jdo.PersistenceManagerFactory
Parameters:
conn_factory_name -

getConnectionFactoryName

public java.lang.String getConnectionFactoryName()
Specified by:
getConnectionFactoryName in interface javax.jdo.PersistenceManagerFactory
Returns:
Connection Factory name

setConnectionFactory

public void setConnectionFactory(java.lang.Object conn_factory)
Specified by:
setConnectionFactory in interface javax.jdo.PersistenceManagerFactory
Parameters:
conn_factory - Connection factory

getConnectionFactory

public java.lang.Object getConnectionFactory()
Specified by:
getConnectionFactory in interface javax.jdo.PersistenceManagerFactory
Returns:
The connection factory

setConnectionFactory2Name

public void setConnectionFactory2Name(java.lang.String conn_factory_name)
Specified by:
setConnectionFactory2Name in interface javax.jdo.PersistenceManagerFactory
Parameters:
conn_factory_name - Connection factory name

getConnectionFactory2Name

public java.lang.String getConnectionFactory2Name()
Specified by:
getConnectionFactory2Name in interface javax.jdo.PersistenceManagerFactory
Returns:
Connection factory name

setConnectionFactory2

public void setConnectionFactory2(java.lang.Object conn_factory)
Specified by:
setConnectionFactory2 in interface javax.jdo.PersistenceManagerFactory
Parameters:
conn_factory - Connection Factory

getConnectionFactory2

public java.lang.Object getConnectionFactory2()
Specified by:
getConnectionFactory2 in interface javax.jdo.PersistenceManagerFactory
Returns:

setMultithreaded

public void setMultithreaded(boolean multithreaded)
Specified by:
setMultithreaded in interface javax.jdo.PersistenceManagerFactory
Parameters:
multithreaded - Whether is multithreaded or not

getMultithreaded

public boolean getMultithreaded()
Specified by:
getMultithreaded in interface javax.jdo.PersistenceManagerFactory
Returns:

setOptimistic

public void setOptimistic(boolean optimistic)
Specified by:
setOptimistic in interface javax.jdo.PersistenceManagerFactory
Parameters:
optimistic -

getOptimistic

public boolean getOptimistic()
Specified by:
getOptimistic in interface javax.jdo.PersistenceManagerFactory
Returns:

setRetainValues

public void setRetainValues(boolean retain_values)
Specified by:
setRetainValues in interface javax.jdo.PersistenceManagerFactory
Parameters:
retain_values -

getRetainValues

public boolean getRetainValues()
Specified by:
getRetainValues in interface javax.jdo.PersistenceManagerFactory
Returns:

setRestoreValues

public void setRestoreValues(boolean restore_values)
Specified by:
setRestoreValues in interface javax.jdo.PersistenceManagerFactory
Parameters:
restore_values -

getRestoreValues

public boolean getRestoreValues()
Specified by:
getRestoreValues in interface javax.jdo.PersistenceManagerFactory
Returns:

setNontransactionalRead

public void setNontransactionalRead(boolean nontrans_read)
Specified by:
setNontransactionalRead in interface javax.jdo.PersistenceManagerFactory
Parameters:
nontrans_read -

getNontransactionalRead

public boolean getNontransactionalRead()
Specified by:
getNontransactionalRead in interface javax.jdo.PersistenceManagerFactory
Returns:

setNontransactionalWrite

public void setNontransactionalWrite(boolean nontrans_write)
Specified by:
setNontransactionalWrite in interface javax.jdo.PersistenceManagerFactory
Parameters:
nontrans_write -

getNontransactionalWrite

public boolean getNontransactionalWrite()
Specified by:
getNontransactionalWrite in interface javax.jdo.PersistenceManagerFactory
Returns:

setIgnoreCache

public void setIgnoreCache(boolean ignore)
Specified by:
setIgnoreCache in interface javax.jdo.PersistenceManagerFactory
Parameters:
ignore -

getIgnoreCache

public boolean getIgnoreCache()
Specified by:
getIgnoreCache in interface javax.jdo.PersistenceManagerFactory
Returns:

setDetachAllOnCommit

public void setDetachAllOnCommit(boolean detach)
Mutator for whether to detach all objects on commit of the txn.

Specified by:
setDetachAllOnCommit in interface javax.jdo.PersistenceManagerFactory
Parameters:
detach - Whether to detach objects on commit of the txn.

getDetachAllOnCommit

public boolean getDetachAllOnCommit()
Accessor for whether to detach objects on commit of the txn.

Specified by:
getDetachAllOnCommit in interface javax.jdo.PersistenceManagerFactory
Returns:
Whether to detach objects on commit of the txn.

setMapping

public void setMapping(java.lang.String mapping)
Mutator for the Mapping name

Specified by:
setMapping in interface javax.jdo.PersistenceManagerFactory
Parameters:
mapping - mapping name

getMapping

public java.lang.String getMapping()
Accessor for the mapping name

Specified by:
getMapping in interface javax.jdo.PersistenceManagerFactory
Returns:
mapping name

supportedOptions

public java.util.Collection supportedOptions()
Accessor for the supported options

Specified by:
supportedOptions in interface javax.jdo.PersistenceManagerFactory
Returns:
Collection of supported options

getDataStoreCache

public javax.jdo.datastore.DataStoreCache getDataStoreCache()
Accessor for the Datastore Cache

Specified by:
getDataStoreCache in interface javax.jdo.PersistenceManagerFactory
Returns:
The datastore cache

close

public void close()
Specified by:
close in interface javax.jdo.PersistenceManagerFactory
See Also:
PersistenceManagerFactory.close()

isClosed

public boolean isClosed()
Accessor for whether the PMF is closed.

Specified by:
isClosed in interface javax.jdo.PersistenceManagerFactory
Returns:
Whether it is closed.

addInstanceLifecycleListener

public void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener,
                                         java.lang.Class[] classes)
JDO 2.0 spec 12.15 "LifecycleListeners".

Specified by:
addInstanceLifecycleListener in interface javax.jdo.PersistenceManagerFactory
Parameters:
listener - The instance lifecycle listener to sends events to
classes - The classes that it is interested in
Since:
1.1

removeInstanceLifecycleListener

public void removeInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener)
JDO 2.0 spec 12.15 "LifecycleListeners".

Specified by:
removeInstanceLifecycleListener in interface javax.jdo.PersistenceManagerFactory
Parameters:
listener - The instance lifecycle listener to remove.
Since:
1.1

getPersistenceManagerProxy

public javax.jdo.PersistenceManager getPersistenceManagerProxy()
Specified by:
getPersistenceManagerProxy in interface javax.jdo.PersistenceManagerFactory

getPersistenceUnitName

public java.lang.String getPersistenceUnitName()
Accessor for the persistence-unit name.

Specified by:
getPersistenceUnitName in interface javax.jdo.PersistenceManagerFactory
Returns:
Name of the "persistence-unit"

getServerTimeZoneID

public java.lang.String getServerTimeZoneID()
Accessor for the server timezone id.

Specified by:
getServerTimeZoneID in interface javax.jdo.PersistenceManagerFactory
Returns:
Server timezone id

getTransactionType

public java.lang.String getTransactionType()
Accessor for the transaction type.

Specified by:
getTransactionType in interface javax.jdo.PersistenceManagerFactory
Returns:
Transaction type

setPersistenceUnitName

public void setPersistenceUnitName(java.lang.String name)
Mutator for the persistence-unit name

Specified by:
setPersistenceUnitName in interface javax.jdo.PersistenceManagerFactory
Parameters:
name - Name of the "persistence-unit"

setServerTimeZoneID

public void setServerTimeZoneID(java.lang.String id)
Mutator for the server timezone id.

Specified by:
setServerTimeZoneID in interface javax.jdo.PersistenceManagerFactory
Parameters:
id - Server timezone id

setTransactionType

public void setTransactionType(java.lang.String type)
Mutator for the transaction type.

Specified by:
setTransactionType in interface javax.jdo.PersistenceManagerFactory
Parameters:
type - Transaction type

setReadOnly

public void setReadOnly(boolean readOnly)
Specified by:
setReadOnly in interface javax.jdo.PersistenceManagerFactory
Parameters:
readOnly -

getReadOnly

public boolean getReadOnly()
Specified by:
getReadOnly in interface javax.jdo.PersistenceManagerFactory
Returns:

getName

public java.lang.String getName()
Accessor for the name of the PMF.

Specified by:
getName in interface javax.jdo.PersistenceManagerFactory
Returns:
Name of the PMF

setName

public void setName(java.lang.String name)
Mutator for the name of the PMF.

Specified by:
setName in interface javax.jdo.PersistenceManagerFactory
Parameters:
name - Name of the PMF

getCopyOnAttach

public boolean getCopyOnAttach()
Specified by:
getCopyOnAttach in interface javax.jdo.PersistenceManagerFactory

setCopyOnAttach

public void setCopyOnAttach(boolean flag)
Specified by:
setCopyOnAttach in interface javax.jdo.PersistenceManagerFactory

addFetchGroups

public void addFetchGroups(javax.jdo.FetchGroup[] groups)
Specified by:
addFetchGroups in interface javax.jdo.PersistenceManagerFactory

getFetchGroup

public javax.jdo.FetchGroup getFetchGroup(java.lang.Class cls,
                                          java.lang.String name)
Specified by:
getFetchGroup in interface javax.jdo.PersistenceManagerFactory

getFetchGroups

public java.util.Set getFetchGroups()
Specified by:
getFetchGroups in interface javax.jdo.PersistenceManagerFactory

removeAllFetchGroups

public void removeAllFetchGroups()
Specified by:
removeAllFetchGroups in interface javax.jdo.PersistenceManagerFactory

removeFetchGroups

public void removeFetchGroups(javax.jdo.FetchGroup[] groups)
Specified by:
removeFetchGroups in interface javax.jdo.PersistenceManagerFactory

getTransactionIsolationLevel

public java.lang.String getTransactionIsolationLevel()
Specified by:
getTransactionIsolationLevel in interface javax.jdo.PersistenceManagerFactory

setTransactionIsolationLevel

public void setTransactionIsolationLevel(java.lang.String level)
Specified by:
setTransactionIsolationLevel in interface javax.jdo.PersistenceManagerFactory


Copyright © 2009. All Rights Reserved.