com.triactive.jdo
Class PersistenceManagerFactoryImpl

java.lang.Object
  extended bycom.triactive.jdo.PersistenceManagerFactoryImpl
All Implemented Interfaces:
javax.jdo.PersistenceManagerFactory, java.io.Serializable

public class PersistenceManagerFactoryImpl
extends java.lang.Object
implements javax.jdo.PersistenceManagerFactory

A factory used to obtain PersistenceManager instances.

Author:
Mike Martin
See Also:
Serialized Form

Nested Class Summary
static interface PersistenceManagerFactoryImpl.PropertySetter
          This is an interface that allows setting properties on a PersistenceManagerFactory with Strings.
 
Field Summary
static java.lang.String AUTO_CREATE_TABLES_PROPERTY
          The system property that selects the default value for the AutoCreateTables setting.
static java.lang.String TRANSACTION_ISOLATION_PROPERTY
          The system property that selects the default value for the transaction isolation level.
static java.lang.String VALIDATE_CONSTRAINTS_PROPERTY
          The system property that selects the default value for the ValidateConstraints setting.
static java.lang.String VALIDATE_TABLES_PROPERTY
          The system property that selects the default value for the ValidateTables setting.
 
Constructor Summary
PersistenceManagerFactoryImpl()
          Constructs a new PersistenceManagerFactoryImpl.
 
Method Summary
 void close()
           
 boolean equals(java.lang.Object obj)
           
 boolean getAutoCreateTables()
          Get the default AutoCreateTables setting for all PersistenceManager instances obtained from this factory.
 java.lang.String getConnectionDriverName()
          Get the driver name for the data store connection.
 java.lang.Object getConnectionFactory()
          Get the data store connection factory.
 java.lang.Object getConnectionFactory2()
          Get the second data store connection factory.
 java.lang.String getConnectionFactory2Name()
          Get the name for the second data store connection factory.
 java.lang.String getConnectionFactoryName()
          Get the name for the data store connection factory.
 java.lang.String getConnectionURL()
          Get the URL for the data store connection.
 java.lang.String getConnectionUserName()
          Get the user name for the data store connection.
 boolean getIgnoreCache()
          Get the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.
 int getMaxPool()
          Get the MaxPool setting for the PersistenceManager pool for this factory.
 int getMinPool()
          Get the MinPool setting for the PersistenceManager pool for this factory.
 int getMsWait()
          Get the MsWait setting for the PersistenceManager pool for this factory.
 boolean getMultithreaded()
          Get the default Multithreaded setting for all PersistenceManager instances obtained from this factory.
 javax.sql.DataSource getNontransactionalDataSource()
          Returns the data source to be used for non-transactional access.
 boolean getNontransactionalRead()
          Get the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.
 boolean getNontransactionalWrite()
          Get the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.
 boolean getOptimistic()
          Get the default Optimistic setting for all PersistenceManager instances obtained from this factory.
 javax.jdo.PersistenceManager getPersistenceManager()
          Get an instance of PersistenceManager from this factory.
 javax.jdo.PersistenceManager getPersistenceManager(java.lang.String userName, java.lang.String password)
          Get an instance of PersistenceManager from this factory.
static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.util.Properties props)
          Return a new PersistenceManagerFactoryImpl with options set according to the given Properties.
 java.util.Properties getProperties()
          Return non-configurable properties of this PersistenceManagerFactory.
 boolean getRestoreValues()
          Get the default RestoreValues setting for all PersistenceManager instances obtained from this factory.
 boolean getRetainValues()
          Get the default RetainValues setting for all PersistenceManager instances obtained from this factory.
 javax.sql.DataSource getTransactionalDataSource()
          Returns the data source to be used for transactional access.
 int getTransactionIsolation()
          Get the default transaction isolation level for all PersistenceManager instances obtained from this factory.
 boolean getValidateConstraints()
          Get the default ValidateConstraints setting for all PersistenceManager instances obtained from this factory.
 boolean getValidateTables()
          Get the default ValidateTables setting for all PersistenceManager instances obtained from this factory.
 int hashCode()
           
(package private)  void pmClosed(PersistenceManagerImpl pm)
           
 void setAutoCreateTables(boolean flag)
          Set the default AutoCreateTables setting for all PersistenceManager instances obtained from this factory.
 void setConnectionDriverName(java.lang.String driverName)
          Set the driver name for the data store connection.
 void setConnectionFactory(java.lang.Object connectionFactory)
          Set the data store connection factory.
 void setConnectionFactory2(java.lang.Object connectionFactory2)
          Set the second data store connection factory.
 void setConnectionFactory2Name(java.lang.String connectionFactory2Name)
          Set the name for the second data store connection factory.
 void setConnectionFactoryName(java.lang.String connectionFactoryName)
          Set the name for the data store connection factory.
 void setConnectionPassword(java.lang.String password)
          Set the password for the data store connection.
 void setConnectionURL(java.lang.String URL)
          Set the URL for the data store connection.
 void setConnectionUserName(java.lang.String userName)
          Set the user name for the data store connection.
 void setIgnoreCache(boolean flag)
          Set the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.
 void setMaxPool(int maxPool)
          Set the MaxPool setting for the PersistenceManager pool for this factory.
 void setMinPool(int minPool)
          Set the MinPool setting for the PersistenceManager pool for this factory.
 void setMsWait(int msWait)
          Set the MsWait setting for the PersistenceManager pool for this factory.
 void setMultithreaded(boolean flag)
          Set the default Multithreaded setting for all PersistenceManager instances obtained from this factory.
 void setNontransactionalRead(boolean flag)
          Set the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.
 void setNontransactionalWrite(boolean flag)
          Set the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.
 void setOptimistic(boolean flag)
          Set the default Optimistic setting for all PersistenceManager instances obtained from this factory.
 void setRestoreValues(boolean flag)
          Set the default RestoreValues setting for all PersistenceManager instances obtained from this factory.
 void setRetainValues(boolean flag)
          Set the default RetainValues setting for all PersistenceManager instances obtained from this factory.
 void setTransactionIsolation(int isolationLevel)
          Set the default transaction isolation level for all PersistenceManager instances obtained from this factory.
 void setValidateConstraints(boolean flag)
          Set the default ValidateConstraints setting for all PersistenceManager instances obtained from this factory.
 void setValidateTables(boolean flag)
          Set the default ValidateTables setting for all PersistenceManager instances obtained from this factory.
 java.util.Collection supportedOptions()
          The application can determine from the results of this method which optional features, and which query languages are supported by the JDO implementation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATE_TABLES_PROPERTY

public static final java.lang.String VALIDATE_TABLES_PROPERTY
The system property that selects the default value for the ValidateTables setting. This is the string "com.triactive.jdo.validateTables".

See Also:
Constant Field Values

VALIDATE_CONSTRAINTS_PROPERTY

public static final java.lang.String VALIDATE_CONSTRAINTS_PROPERTY
The system property that selects the default value for the ValidateConstraints setting. This is the string "com.triactive.jdo.validateConstraints".

See Also:
Constant Field Values

AUTO_CREATE_TABLES_PROPERTY

public static final java.lang.String AUTO_CREATE_TABLES_PROPERTY
The system property that selects the default value for the AutoCreateTables setting. This is the string "com.triactive.jdo.autoCreateTables".

See Also:
Constant Field Values

TRANSACTION_ISOLATION_PROPERTY

public static final java.lang.String TRANSACTION_ISOLATION_PROPERTY
The system property that selects the default value for the transaction isolation level. This is the string "com.triactive.jdo.transactionIsolation".

See Also:
Constant Field Values
Constructor Detail

PersistenceManagerFactoryImpl

public PersistenceManagerFactoryImpl()
Constructs a new PersistenceManagerFactoryImpl.

Method Detail

getPersistenceManagerFactory

public static javax.jdo.PersistenceManagerFactory getPersistenceManagerFactory(java.util.Properties props)
Return a new PersistenceManagerFactoryImpl with options set according to the given Properties.

Parameters:
props - The Properties to initialize the PersistenceManagerFactory with.
Returns:
A PersistenceManagerFactoryImpl with options set according to the given Properties.
See Also:
JDOHelper.getPersistenceManagerFactory(java.util.Properties)

close

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

equals

public boolean equals(java.lang.Object obj)

hashCode

public int hashCode()

getTransactionalDataSource

public javax.sql.DataSource getTransactionalDataSource()
Returns the data source to be used for transactional access.

Returns:
The data source to be used for transactional access.

getNontransactionalDataSource

public javax.sql.DataSource getNontransactionalDataSource()
Returns the data source to be used for non-transactional access.

Returns:
The data source to be used for non-transactional access.

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()
Get an instance of PersistenceManager from this factory. The instance has default values for options.

After the first use of getPersistenceManager, no "set" methods will succeed.

Specified by:
getPersistenceManager in interface javax.jdo.PersistenceManagerFactory
Returns:
a PersistenceManager instance with default options.

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager(java.lang.String userName,
                                                          java.lang.String password)
Get an instance of PersistenceManager from this factory. The instance has default values for options. The parameters userid and password are used when obtaining datastore connections from the connection pool.

After the first use of getPersistenceManager, no "set" methods will succeed.

Specified by:
getPersistenceManager in interface javax.jdo.PersistenceManagerFactory
Parameters:
userName - the user name for the connection
password - the password for the connection
Returns:
a PersistenceManager instance with default options.

pmClosed

void pmClosed(PersistenceManagerImpl pm)

setConnectionUserName

public void setConnectionUserName(java.lang.String userName)
Set the user name for the data store connection.

Specified by:
setConnectionUserName in interface javax.jdo.PersistenceManagerFactory
Parameters:
userName - the user name for the data store connection.

getConnectionUserName

public java.lang.String getConnectionUserName()
Get the user name for the data store connection.

Specified by:
getConnectionUserName in interface javax.jdo.PersistenceManagerFactory
Returns:
the user name for the data store connection.

setConnectionPassword

public void setConnectionPassword(java.lang.String password)
Set the password for the data store connection.

Specified by:
setConnectionPassword in interface javax.jdo.PersistenceManagerFactory
Parameters:
password - the password for the data store connection.

setConnectionURL

public void setConnectionURL(java.lang.String URL)
Set the URL for the data store connection.

Specified by:
setConnectionURL in interface javax.jdo.PersistenceManagerFactory
Parameters:
URL - the URL for the data store connection.

getConnectionURL

public java.lang.String getConnectionURL()
Get the URL for the data store connection.

Specified by:
getConnectionURL in interface javax.jdo.PersistenceManagerFactory
Returns:
the URL for the data store connection.

setConnectionDriverName

public void setConnectionDriverName(java.lang.String driverName)
Set the driver name for the data store connection.

Specified by:
setConnectionDriverName in interface javax.jdo.PersistenceManagerFactory
Parameters:
driverName - the driver name for the data store connection.

getConnectionDriverName

public java.lang.String getConnectionDriverName()
Get the driver name for the data store connection.

Specified by:
getConnectionDriverName in interface javax.jdo.PersistenceManagerFactory
Returns:
the driver name for the data store connection.

setConnectionFactoryName

public void setConnectionFactoryName(java.lang.String connectionFactoryName)
Set the name for the data store connection factory.

Specified by:
setConnectionFactoryName in interface javax.jdo.PersistenceManagerFactory
Parameters:
connectionFactoryName - the name of the data store connection factory.

getConnectionFactoryName

public java.lang.String getConnectionFactoryName()
Get the name for the data store connection factory.

Specified by:
getConnectionFactoryName in interface javax.jdo.PersistenceManagerFactory
Returns:
the name of the data store connection factory.

setConnectionFactory

public void setConnectionFactory(java.lang.Object connectionFactory)
Set the data store connection factory. JDO implementations will support specific connection factories. The connection factory interfaces are not part of the JDO specification.

Specified by:
setConnectionFactory in interface javax.jdo.PersistenceManagerFactory
Parameters:
connectionFactory - the data store connection factory.

getConnectionFactory

public java.lang.Object getConnectionFactory()
Get the data store connection factory.

Specified by:
getConnectionFactory in interface javax.jdo.PersistenceManagerFactory
Returns:
the data store connection factory.

setConnectionFactory2Name

public void setConnectionFactory2Name(java.lang.String connectionFactory2Name)
Set the name for the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.

Specified by:
setConnectionFactory2Name in interface javax.jdo.PersistenceManagerFactory

getConnectionFactory2Name

public java.lang.String getConnectionFactory2Name()
Get the name for the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.

Specified by:
getConnectionFactory2Name in interface javax.jdo.PersistenceManagerFactory
Returns:
the name of the data store connection factory.

setConnectionFactory2

public void setConnectionFactory2(java.lang.Object connectionFactory2)
Set the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions. JDO implementations will support specific connection factories. The connection factory interfaces are not part of the JDO specification.

Specified by:
setConnectionFactory2 in interface javax.jdo.PersistenceManagerFactory

getConnectionFactory2

public java.lang.Object getConnectionFactory2()
Get the second data store connection factory. This is needed for managed environments to get nontransactional connections for optimistic transactions.

Specified by:
getConnectionFactory2 in interface javax.jdo.PersistenceManagerFactory
Returns:
the data store connection factory.

setMultithreaded

public void setMultithreaded(boolean flag)
Set the default Multithreaded setting for all PersistenceManager instances obtained from this factory.

Specified by:
setMultithreaded in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default Multithreaded setting.

getMultithreaded

public boolean getMultithreaded()
Get the default Multithreaded setting for all PersistenceManager instances obtained from this factory.

Specified by:
getMultithreaded in interface javax.jdo.PersistenceManagerFactory
Returns:
the default Multithreaded setting.

setOptimistic

public void setOptimistic(boolean flag)
Set the default Optimistic setting for all PersistenceManager instances obtained from this factory.

Specified by:
setOptimistic in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default Optimistic setting.

getOptimistic

public boolean getOptimistic()
Get the default Optimistic setting for all PersistenceManager instances obtained from this factory.

Specified by:
getOptimistic in interface javax.jdo.PersistenceManagerFactory
Returns:
the default Optimistic setting.

setRetainValues

public void setRetainValues(boolean flag)
Set the default RetainValues setting for all PersistenceManager instances obtained from this factory.

Specified by:
setRetainValues in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default RetainValues setting.

getRetainValues

public boolean getRetainValues()
Get the default RetainValues setting for all PersistenceManager instances obtained from this factory.

Specified by:
getRetainValues in interface javax.jdo.PersistenceManagerFactory
Returns:
the default RetainValues setting.

setRestoreValues

public void setRestoreValues(boolean flag)
Set the default RestoreValues setting for all PersistenceManager instances obtained from this factory.

Specified by:
setRestoreValues in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default RestoreValues setting.

getRestoreValues

public boolean getRestoreValues()
Get the default RestoreValues setting for all PersistenceManager instances obtained from this factory.

Specified by:
getRestoreValues in interface javax.jdo.PersistenceManagerFactory
Returns:
the default RestoreValues setting.

setNontransactionalRead

public void setNontransactionalRead(boolean flag)
Set the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.

Specified by:
setNontransactionalRead in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default NontransactionalRead setting.

getNontransactionalRead

public boolean getNontransactionalRead()
Get the default NontransactionalRead setting for all PersistenceManager instances obtained from this factory.

Specified by:
getNontransactionalRead in interface javax.jdo.PersistenceManagerFactory
Returns:
the default NontransactionalRead setting.

setNontransactionalWrite

public void setNontransactionalWrite(boolean flag)
Set the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.

Specified by:
setNontransactionalWrite in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default NontransactionalWrite setting.

getNontransactionalWrite

public boolean getNontransactionalWrite()
Get the default NontransactionalWrite setting for all PersistenceManager instances obtained from this factory.

Specified by:
getNontransactionalWrite in interface javax.jdo.PersistenceManagerFactory
Returns:
the default NontransactionalWrite setting.

setIgnoreCache

public void setIgnoreCache(boolean flag)
Set the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.

Specified by:
setIgnoreCache in interface javax.jdo.PersistenceManagerFactory
Parameters:
flag - the default IgnoreCache setting.

getIgnoreCache

public boolean getIgnoreCache()
Get the default IgnoreCache setting for all PersistenceManager instances obtained from this factory.

Specified by:
getIgnoreCache in interface javax.jdo.PersistenceManagerFactory
Returns:
the default IngoreCache setting.

setMaxPool

public void setMaxPool(int maxPool)
Set the MaxPool setting for the PersistenceManager pool for this factory.

Parameters:
maxPool - the MaxPool setting.

getMaxPool

public int getMaxPool()
Get the MaxPool setting for the PersistenceManager pool for this factory.

Returns:
the MaxPool setting.

setMinPool

public void setMinPool(int minPool)
Set the MinPool setting for the PersistenceManager pool for this factory.

Parameters:
minPool - the MinPool setting.

getMinPool

public int getMinPool()
Get the MinPool setting for the PersistenceManager pool for this factory.

Returns:
the MinPool setting.

setMsWait

public void setMsWait(int msWait)
Set the MsWait setting for the PersistenceManager pool for this factory.

Parameters:
msWait - the MsWait setting.

getMsWait

public int getMsWait()
Get the MsWait setting for the PersistenceManager pool for this factory.

Returns:
the MsWait setting.

setValidateTables

public void setValidateTables(boolean flag)
Set the default ValidateTables setting for all PersistenceManager instances obtained from this factory.

Parameters:
flag - the default ValidateTables setting.

getValidateTables

public boolean getValidateTables()
Get the default ValidateTables setting for all PersistenceManager instances obtained from this factory.

Returns:
the default ValidateTables setting.

setValidateConstraints

public void setValidateConstraints(boolean flag)
Set the default ValidateConstraints setting for all PersistenceManager instances obtained from this factory.

Parameters:
flag - the default ValidateConstraints setting.

getValidateConstraints

public boolean getValidateConstraints()
Get the default ValidateConstraints setting for all PersistenceManager instances obtained from this factory.

Returns:
the default ValidateConstraints setting.

setAutoCreateTables

public void setAutoCreateTables(boolean flag)
Set the default AutoCreateTables setting for all PersistenceManager instances obtained from this factory.

Parameters:
flag - the default AutoCreateTables setting.

getAutoCreateTables

public boolean getAutoCreateTables()
Get the default AutoCreateTables setting for all PersistenceManager instances obtained from this factory.

Returns:
the default AutoCreateTables setting.

setTransactionIsolation

public void setTransactionIsolation(int isolationLevel)
Set the default transaction isolation level for all PersistenceManager instances obtained from this factory.

Parameters:
isolationLevel - the default transaction isolation level.

getTransactionIsolation

public int getTransactionIsolation()
Get the default transaction isolation level for all PersistenceManager instances obtained from this factory.

Returns:
the default transaction isolation level.

getProperties

public java.util.Properties getProperties()
Return non-configurable properties of this PersistenceManagerFactory. Properties with keys VendorName and VersionNumber are required. Other keys are optional.

Specified by:
getProperties in interface javax.jdo.PersistenceManagerFactory
Returns:
the non-configurable properties of this PersistenceManagerFactory.

supportedOptions

public java.util.Collection supportedOptions()
The application can determine from the results of this method which optional features, and which query languages are supported by the JDO implementation.

Each supported JDO optional feature is represented by a String with one of the following values:

javax.jdo.option.TransientTransactional javax.jdo.option.NontransactionalRead javax.jdo.option.NontransactionalWrite javax.jdo.option.RetainValues javax.jdo.option.Optimistic javax.jdo.option.ApplicationIdentity javax.jdo.option.DatastoreIdentity javax.jdo.option.NonDatastoreIdentity javax.jdo.option.ArrayList javax.jdo.option.HashMap javax.jdo.option.Hashtable javax.jdo.option.LinkedList javax.jdo.option.TreeMap javax.jdo.option.TreeSet javax.jdo.option.Vector javax.jdo.option.Map javax.jdo.option.List javax.jdo.option.Array javax.jdo.option.NullCollection
The standard JDO query language is represented by a String:
javax.jdo.query.JDOQL

Specified by:
supportedOptions in interface javax.jdo.PersistenceManagerFactory
Returns:
A Collection of String representing the supported options.


Copyright © 2001 TriActive, Inc. All Rights Reserved.