org.jpox.resource
Class PersistenceManagerFactoryImpl

java.lang.Object
  extended byorg.jpox.resource.PersistenceManagerFactoryImpl
All Implemented Interfaces:
javax.resource.cci.ConnectionFactory, javax.jdo.PersistenceManagerFactory, javax.naming.Referenceable, javax.resource.Referenceable, java.io.Serializable

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

PersistenceManagerFactoryImpl for J2EE

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

Constructor Summary
PersistenceManagerFactoryImpl(ManagedConnectionFactoryImpl mcf, javax.resource.spi.ConnectionManager cm)
          Constructor
 
Method Summary
 void addInstanceLifecycleListener(javax.jdo.listener.InstanceLifecycleListener listener, java.lang.Class[] classes)
          JDO 2.0 spec 12.15 "LifecycleListeners".
 void close()
           
 AbstractPersistenceManagerFactory getAbstractPersistenceManagerFactory()
          Accessor to the AbstractPersistenceManagerFactory
 javax.resource.cci.Connection getConnection()
           
 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
 javax.jdo.datastore.DataStoreCache getDataStoreCache()
          Accessor for the Datastore Cache
 boolean getDetachAllOnCommit()
          Accessor for whether to detach objects on commit of the txn.
 boolean getDetachOnClose()
          Accessor for whether to detach objects on close of the PM's
 boolean getIgnoreCache()
           
 java.lang.String getMapping()
          Accessor for the mapping name
 javax.resource.cci.ResourceAdapterMetaData getMetaData()
           
 boolean getMultithreaded()
           
 boolean getNontransactionalRead()
           
 boolean getNontransactionalWrite()
           
 boolean getOptimistic()
           
 javax.jdo.PersistenceManager getPersistenceManager()
           
 javax.jdo.PersistenceManager getPersistenceManager(java.lang.String user, java.lang.String pw)
           
 java.util.Properties getProperties()
           
 javax.resource.cci.RecordFactory getRecordFactory()
           
 javax.naming.Reference getReference()
           
 boolean getRestoreValues()
           
 boolean getRetainValues()
           
 boolean isClosed()
          Accessor for whether the PMF is closed.
 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 setDetachAllOnCommit(boolean detach)
          Mutator for whether to detach all objects on commit of the txn.
 void setDetachOnClose(boolean detach)
          Mutator for whether to detach objects on close of the PM's
 void setIgnoreCache(boolean ignore)
           
 void setMapping(java.lang.String mapping)
          Mutator for the Mapping name
 void setMultithreaded(boolean multithreaded)
           
 void setNontransactionalRead(boolean nontrans_read)
           
 void setNontransactionalWrite(boolean nontrans_write)
           
 void setOptimistic(boolean optimistic)
           
 void setReference(javax.naming.Reference ref)
           
 void setRestoreValues(boolean restore_values)
           
 void setRetainValues(boolean retain_values)
           
 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

getAbstractPersistenceManagerFactory

public AbstractPersistenceManagerFactory getAbstractPersistenceManagerFactory()
Accessor to the AbstractPersistenceManagerFactory

Returns:
the AbstractPersistenceManagerFactory

setReference

public void setReference(javax.naming.Reference ref)
Specified by:
setReference in interface javax.resource.Referenceable
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
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:

setDetachOnClose

public void setDetachOnClose(boolean detach)
Mutator for whether to detach objects on close of the PM's

Parameters:
detach - Whether to detach objects on close of the PM.

getDetachOnClose

public boolean getDetachOnClose()
Accessor for whether to detach objects on close of the PM's

Returns:
Whether to detach objects on close of the PM's

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


Copyright © -2007 . All Rights Reserved.