org.objectweb.speedo.runtime
Class SpeedoPersistenceManagerFactory

org.objectweb.speedo.runtime.SpeedoPersistenceManagerFactory

public class SpeedoPersistenceManagerFactory

Author:
S.Chassande-Barrioz

Field Summary
static java.lang.String COMPONENT_IDENTITY_BINDING
           
static java.lang.String LOGGER_FACTORY_BINDING
           
static java.lang.String LOGGER_NAME
           
static java.lang.String MAPPER_BINDING
           
static java.lang.String PERSISTENCE_MANAGER_TEMPLATE_BINDING
           
static java.lang.String PM_POOL_BINDING
           
static java.lang.String PROXY_MANAGER_SWITCH_BINDING
           
 
Constructor Summary
SpeedoPersistenceManagerFactory()
           
 
Method Summary
 void addFcBinding(java.lang.String s, java.lang.Object o)
           
 org.objectweb.perseus.pool.api.PoolResource createResource(java.lang.Object o)
          Creates a new PoolResource.
 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.
protected  java.lang.String getConnectionPassword()
          Get the password for the data store connection.
 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.
 java.lang.Object getFcBindings(java.lang.String s)
           
 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.
 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.Object cs)
           
 javax.jdo.PersistenceManager getPersistenceManager(java.lang.String userid, java.lang.String password)
          Get an instance of PersistenceManager from this factory.
 org.objectweb.perseus.pool.api.Pool getPool()
           
 java.util.Properties getProperties()
          Return non-configurable properties of this PersistenceManagerFactory.
 boolean getRestoreValues()
           
 boolean getRetainValues()
          Get the default RetainValues setting for all PersistenceManager instances obtained from this factory.
 boolean matchResource(org.objectweb.perseus.pool.api.PoolResource resource, java.lang.Object o)
          Tests wether a PoolResource can be managed by the current Pool.
 void removeFcBinding(java.lang.String s, java.lang.Object serverItf)
           
 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 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 b)
           
 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.
 

Field Detail

PERSISTENCE_MANAGER_TEMPLATE_BINDING

public static final java.lang.String PERSISTENCE_MANAGER_TEMPLATE_BINDING

MAPPER_BINDING

public static final java.lang.String MAPPER_BINDING

PM_POOL_BINDING

public static final java.lang.String PM_POOL_BINDING

PROXY_MANAGER_SWITCH_BINDING

public static final java.lang.String PROXY_MANAGER_SWITCH_BINDING

LOGGER_FACTORY_BINDING

public static final java.lang.String LOGGER_FACTORY_BINDING

COMPONENT_IDENTITY_BINDING

public static final java.lang.String COMPONENT_IDENTITY_BINDING

LOGGER_NAME

public static final java.lang.String LOGGER_NAME
Constructor Detail

SpeedoPersistenceManagerFactory

public SpeedoPersistenceManagerFactory()
Method Detail

getFcBindings

public java.lang.Object getFcBindings(java.lang.String s)

addFcBinding

public void addFcBinding(java.lang.String s,
                         java.lang.Object o)

removeFcBinding

public void removeFcBinding(java.lang.String s,
                            java.lang.Object serverItf)

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager()
Get an instance of PersistenceManager from this factory. The instance has default values for options. Invokes init at the first call.
Returns:
a PersistenceManager instance with default options.

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager(java.lang.String userid,
                                                          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. Invokes init at the first call.
Parameters:
userid - the userid for the connection
password - the password for the connection
Returns:
a PersistenceManager instance with default options.

getPersistenceManager

public javax.jdo.PersistenceManager getPersistenceManager(java.lang.Object cs)

setConnectionUserName

public void setConnectionUserName(java.lang.String userName)
Set the user name for the data store connection.
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.
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.
Parameters:
password - the password for the data store connection.

getConnectionPassword

protected java.lang.String getConnectionPassword()
Get the password for the data store connection.
Returns:
password the password for the data store connection.

setConnectionURL

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

getConnectionURL

public java.lang.String getConnectionURL()
Get the URL for the data store connection.
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.
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.
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.
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.
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.
Parameters:
connectionFactory - the data store connection factory.

getConnectionFactory

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

setConnectionFactory2Name

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

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.
Returns:
the name of the data store connection factory.

setConnectionFactory2

public void setConnectionFactory2(java.lang.Object connectionfactory)
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.
Parameters:
connectionfactory - the data store connection factory.

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.
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.
Parameters:
flag - the default Multithreaded setting.

getMultithreaded

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

setOptimistic

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

getOptimistic

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

setRetainValues

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

getRetainValues

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

setNontransactionalRead

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

getNontransactionalRead

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

setNontransactionalWrite

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

getNontransactionalWrite

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

setIgnoreCache

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

getIgnoreCache

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

getMaxPool

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

setMaxPool

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

getMinPool

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

setMinPool

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

getMsWait

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

setMsWait

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

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.
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

Returns:
the List of String representing the supported Options

setRestoreValues

public void setRestoreValues(boolean b)

getRestoreValues

public boolean getRestoreValues()

createResource

public org.objectweb.perseus.pool.api.PoolResource createResource(java.lang.Object o)
                                                           throws java.lang.Exception
Creates a new PoolResource. This methos is invoked by the owned Pool.
Parameters:
o - params used to build a new PoolResource
Returns:
the build SpeedoPersistenceManager

matchResource

public boolean matchResource(org.objectweb.perseus.pool.api.PoolResource resource,
                             java.lang.Object o)
Tests wether a PoolResource can be managed by the current Pool. This methos is invoked by the owned Pool.
Parameters:
resource - the PoolResource to be tested
o - o params used to build a new PoolResource
Returns:
true if the resource is an instance of PersistenceManagerImml

getPool

public org.objectweb.perseus.pool.api.Pool getPool()
Returns:
the owned Pool