public interface PersistenceManagerFactory
extends java.io.Serializable
PersistenceManagerFactory
is the interface to use to obtain
PersistenceManager
instances. All PersistenceManager
instances obtained
from the same PersistenceManagerFactory
will have the same default
properties.
PersistenceManagerFactory
instances may be configured and
serialized for later use. They may be stored via JNDI and looked up
and used later. Any properties configured will be saved and restored.
Once the first PersistenceManager
is obtained from the
PersistenceManagerFactory
, the factory can no longer be configured.
If the ConnectionFactory
property is set (non-null
) then
all other Connection properties including ConnectionFactoryName
are ignored;
otherwise, if ConnectionFactoryName
is set (non-null
) then
all other Connection properties are ignored.
Similarly, if the ConnectionFactory2
property is set (non-null
) then
ConnectionFactory2Name
is ignored.
Operational state (PersistenceManager
pooling, connection pooling,
operational parameters) must not be serialized.
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this PersistenceManagerFactory.
|
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. |
boolean |
getMultithreaded()
Get the default Multithreaded setting for all
PersistenceManager instances
obtained from this factory. |
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. |
PersistenceManager |
getPersistenceManager()
Get an instance of
PersistenceManager from this factory. |
PersistenceManager |
getPersistenceManager(java.lang.String userid,
java.lang.String password)
Get an instance of
PersistenceManager from this factory. |
java.util.Properties |
getProperties()
Return non-configurable properties of this
PersistenceManagerFactory . |
boolean |
getRestoreValues()
Get the default value for the RestoreValues property.
|
boolean |
getRetainValues()
Get the default RetainValues 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 connectionFactory)
Set the second data store connection factory.
|
void |
setConnectionFactory2Name(java.lang.String connectionFactoryName)
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 |
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 restoreValues)
Set the default value for the RestoreValues property.
|
void |
setRetainValues(boolean flag)
Set the default RetainValues 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.
|
void close()
If the authorization check succeeds, check to see that all PersistenceManager instances obtained from this PersistenceManagerFactory have no active transactions. If any PersistenceManager instances have an active transaction, throw a JDOUserException, with one nested JDOUserException for each PersistenceManager with an active Transaction.
If there are no active transactions, then close all PersistenceManager instances obtained from this PersistenceManagerFactory, mark this PersistenceManagerFactory as closed, disallow getPersistenceManager methods, and allow all other get methods. If a set method or getPersistenceManager method is called after close, then JDOUserException is thrown.
PersistenceManager getPersistenceManager()
PersistenceManager
from this factory. The instance has
default values for options.
After the first use of getPersistenceManager
, no "set" methods will
succeed.
PersistenceManager
instance with default options.PersistenceManager getPersistenceManager(java.lang.String userid, java.lang.String password)
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.
userid
- the userid for the connectionpassword
- the password for the connectionPersistenceManager
instance with default options.void setConnectionUserName(java.lang.String userName)
userName
- the user name for the data store connection.java.lang.String getConnectionUserName()
void setConnectionPassword(java.lang.String password)
password
- the password for the data store connection.void setConnectionURL(java.lang.String URL)
URL
- the URL for the data store connection.java.lang.String getConnectionURL()
void setConnectionDriverName(java.lang.String driverName)
driverName
- the driver name for the data store connection.java.lang.String getConnectionDriverName()
void setConnectionFactoryName(java.lang.String connectionFactoryName)
connectionFactoryName
- the name of the data store connection factory.java.lang.String getConnectionFactoryName()
void setConnectionFactory(java.lang.Object connectionFactory)
connectionFactory
- the data store connection factory.java.lang.Object getConnectionFactory()
void setConnectionFactory2Name(java.lang.String connectionFactoryName)
connectionFactoryName
- the name of the data store connection factory.java.lang.String getConnectionFactory2Name()
void setConnectionFactory2(java.lang.Object connectionFactory)
connectionFactory
- the data store connection factory.java.lang.Object getConnectionFactory2()
void setMultithreaded(boolean flag)
PersistenceManager
instances
obtained from this factory.flag
- the default Multithreaded setting.boolean getMultithreaded()
PersistenceManager
instances
obtained from this factory.void setOptimistic(boolean flag)
PersistenceManager
instances
obtained from this factory.flag
- the default Optimistic setting.boolean getOptimistic()
PersistenceManager
instances
obtained from this factory.void setRetainValues(boolean flag)
PersistenceManager
instances
obtained from this factory.flag
- the default RetainValues setting.boolean getRetainValues()
PersistenceManager
instances
obtained from this factory.void setRestoreValues(boolean restoreValues)
true
, at rollback, fields of newly persistent instances
are restored to
their values as of the beginning of the transaction, and the instances
revert to transient. Additionally, fields of modified
instances of primitive types and immutable reference types
are restored to their values as of the beginning of the
transaction.
If false
, at rollback, the values of fields of
newly persistent instances are unchanged and the instances revert to
transient. Additionally, dirty instances transition to hollow.
If an implementation does not support this option, a
JDOUnsupportedOptionException
is thrown.
restoreValues
- the value of the restoreValues propertyboolean getRestoreValues()
void setNontransactionalRead(boolean flag)
PersistenceManager
instances
obtained from this factory.flag
- the default NontransactionalRead setting.boolean getNontransactionalRead()
PersistenceManager
instances
obtained from this factory.void setNontransactionalWrite(boolean flag)
PersistenceManager
instances
obtained from this factory.flag
- the default NontransactionalWrite setting.boolean getNontransactionalWrite()
PersistenceManager
instances
obtained from this factory.void setIgnoreCache(boolean flag)
PersistenceManager
instances
obtained from this factory.flag
- the default IgnoreCache setting.boolean getIgnoreCache()
PersistenceManager
instances
obtained from this factory.java.util.Properties getProperties()
PersistenceManagerFactory
.
Properties with keys VendorName
and VersionNumber
are required. Other
keys are optional.PersistenceManagerFactory
.java.util.Collection supportedOptions()
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
Collection
of String
s representing the supported options.Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.