SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.impl.jdbc
Class JDBCPersistenceManagerFactory

java.lang.Object
  |
  +--com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl
        |
        +--com.solarmetric.kodo.impl.jdbc.JDBCPersistenceManagerFactory
All Implemented Interfaces:
PersistenceManagerFactory, Serializable
Direct Known Subclasses:
EEPersistenceManagerFactory

public class JDBCPersistenceManagerFactory
extends PersistenceManagerFactoryImpl

PersistenceManagerFactory type for use with the JDBC runtime.

See Also:
Serialized Form

Constructor Summary
JDBCPersistenceManagerFactory()
          Default constructor.
JDBCPersistenceManagerFactory(InputStream propertyStream)
          Create a factory that will access the data store with a Properties instantiated from the specified InputStream.
JDBCPersistenceManagerFactory(JDBCConfiguration conf)
          Construct the factory with the given option settings.
JDBCPersistenceManagerFactory(Properties props)
          Create a factory that will access the data store with the specified Properties.
 
Method Summary
 void close()
          API extension.
protected  void configurePersistenceManager(PersistenceManagerImpl pm)
          Register the PersistenceManagerImpl as being opened from this factory, and flush any pending class registrations if necessary.
 int countDeferredRegistrations()
           
static Object createConnectionFactory(JDBCConfiguration conf)
           
static Object createConnectionFactory(JDBCConfiguration conf, boolean connectionFactory2)
           
static Object createConnectionFactory(JDBCConfiguration conf, ClassResolver resolver, boolean connectionFactory2)
           
protected  void finalize()
           
(package private)  boolean flushDeferredRegistrations()
          Flush the cache of registrations that we have deferred until later.
 Collection getDeferredRegistrations()
           
protected  JDBCConfiguration getJDBCConfiguration()
           
static PersistenceManagerFactory getPersistenceManagerFactory(Properties p)
          Factory method for constructing a PersistenceManagerFactory from properties.
 Set getRegisteredClasses()
           
 org.apache.commons.logging.Log getRuntimeLog()
           
 String getVersionInformation()
          Return a string describing this factory version, such as "JDBC Enterprise".
protected  Object newConnectionFactory(boolean connectionFactory2)
          Instantiate a connection factory from the current configuration.
 StoreManager newStoreManager()
          Return a new StoreManager for this runtime.
protected  boolean registerClass(Class clazz)
          Register a new persistent class.
protected  boolean registerClassInternal(Class clazz)
           
protected  void removeUnsupportedOptions(Collection options)
          Remove the options not supported by this runtime from the given collection.
protected  void setup()
          Setup transient state used by this factory based on the current configuration, which will subsequenty be locked down.
protected  void setupImplHelper()
           
 
Methods inherited from class com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl
addDataCache, close, closeAll, findPersistenceManager, freeze, getConfiguration, getConnectionDriverName, getConnectionFactory, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionPassword, getConnectionURL, getConnectionUserName, getDataCaches, getIgnoreCache, getMaxPool, getMinPool, getMsWait, getMultithreaded, getNontransactionalRead, getNontransactionalWrite, getOpenPersistenceManager, getOptimistic, getPersistenceManager, getPersistenceManager, getProperties, getRestoreValues, getRetainValues, lock, newConnectionFactory, newPersistenceManager, notifyRemoteCommitListeners, readObject, registerRemoteCommitListener, removeRemoteCommitListener, setConnectionDriverName, setConnectionFactory, setConnectionFactory2, setConnectionFactory2Name, setConnectionFactoryName, setConnectionPassword, setConnectionURL, setConnectionUserName, setIgnoreCache, setMaxPool, setMinPool, setMsWait, setMultithreaded, setNontransactionalRead, setNontransactionalWrite, setOptimistic, setRestoreValues, setRetainValues, setUpRemoteCommitProvider, supportedOptions, unlock
 
Methods inherited from class java.lang.Object
, clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCPersistenceManagerFactory

public JDBCPersistenceManagerFactory()
Default constructor.

JDBCPersistenceManagerFactory

public JDBCPersistenceManagerFactory(JDBCConfiguration conf)
Construct the factory with the given option settings.

JDBCPersistenceManagerFactory

public JDBCPersistenceManagerFactory(Properties props)
                              throws IOException
Create a factory that will access the data store with the specified Properties.

JDBCPersistenceManagerFactory

public JDBCPersistenceManagerFactory(InputStream propertyStream)
                              throws IOException
Create a factory that will access the data store with a Properties instantiated from the specified InputStream.
Method Detail

getPersistenceManagerFactory

public static PersistenceManagerFactory getPersistenceManagerFactory(Properties p)
Factory method for constructing a PersistenceManagerFactory from properties. Invoked from JDOHelper.getPersistenceManagerFactory(java.util.Properties).

getRuntimeLog

public org.apache.commons.logging.Log getRuntimeLog()

getVersionInformation

public String getVersionInformation()
Description copied from class: PersistenceManagerFactoryImpl
Return a string describing this factory version, such as "JDBC Enterprise".
Overrides:
getVersionInformation in class PersistenceManagerFactoryImpl

newStoreManager

public StoreManager newStoreManager()
Description copied from class: PersistenceManagerFactoryImpl
Return a new StoreManager for this runtime. Note that the instance returned here may be wrapped before being passed to the PersistenceManagerFactoryImpl.newPersistenceManager(java.lang.String, java.lang.String, com.solarmetric.kodo.runtime.StoreManager) method. However, the PersistenceManagerImpl.getStoreManager() method will return the original native store manager.
Overrides:
newStoreManager in class PersistenceManagerFactoryImpl

getJDBCConfiguration

protected JDBCConfiguration getJDBCConfiguration()

newConnectionFactory

protected Object newConnectionFactory(boolean connectionFactory2)
Description copied from class: PersistenceManagerFactoryImpl
Instantiate a connection factory from the current configuration. This method returns null by default.
Overrides:
newConnectionFactory in class PersistenceManagerFactoryImpl
Following copied from class: com.solarmetric.kodo.runtime.PersistenceManagerFactoryImpl
Parameters:
connectionFactory2 - if false, use the normal connection factory. If true, the use connection factory 2, which is the non-transactional connection factory.

createConnectionFactory

public static Object createConnectionFactory(JDBCConfiguration conf)

createConnectionFactory

public static Object createConnectionFactory(JDBCConfiguration conf,
                                             boolean connectionFactory2)

createConnectionFactory

public static Object createConnectionFactory(JDBCConfiguration conf,
                                             ClassResolver resolver,
                                             boolean connectionFactory2)

setup

protected void setup()
Description copied from class: PersistenceManagerFactoryImpl
Setup transient state used by this factory based on the current configuration, which will subsequenty be locked down. This method will be called before the first PersistenceManager is requested, and will be re-called each time the factory is deserialized into a JVM that has no configuration for this data store.
Overrides:
setup in class PersistenceManagerFactoryImpl

setupImplHelper

protected void setupImplHelper()

getDeferredRegistrations

public Collection getDeferredRegistrations()

registerClass

protected boolean registerClass(Class clazz)
Register a new persistent class. This will create mappings for the classes, and optionally refresh the schema (if the SynchronizeSchema attribute is true).

Special consideration needs to be taken to prevent recursive registrations, since parsing the metadata can result in new classes being loaded, and thus firing the JDOImplHelper's register class listeners, and thus referencing a partially parsed class metadata file. In order to prevent this, if we are currently in the process of registering classes, any invocation of registerClass will defer the registration of those classes until later. The flushDeferredRegistrations method will be called to flush any classes that have been deferred.

Furthermore, special considerations need to be taken for performance, since paring metadata files can be a slow process. If classes are loaded in multiple separate ClassLoader's, excessive metadata parsing can occur. Thus, we defer registration in the following cases:

Since:
2.4

registerClassInternal

protected boolean registerClassInternal(Class clazz)

countDeferredRegistrations

public int countDeferredRegistrations()

flushDeferredRegistrations

boolean flushDeferredRegistrations()
Flush the cache of registrations that we have deferred until later.
Since:
2.4

removeUnsupportedOptions

protected void removeUnsupportedOptions(Collection options)
Description copied from class: PersistenceManagerFactoryImpl
Remove the options not supported by this runtime from the given collection. The Collection will initially consist of the following options:
Overrides:
removeUnsupportedOptions in class PersistenceManagerFactoryImpl

close

public void close()
Description copied from class: PersistenceManagerFactoryImpl
API extension. Closes the PersistenceManagerFactory, freeing any resources needed by this factory. After this method is invoked, the factory and associated PersistenceManagers should no longer be used.
Overrides:
close in class PersistenceManagerFactoryImpl

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object

configurePersistenceManager

protected final void configurePersistenceManager(PersistenceManagerImpl pm)
Register the PersistenceManagerImpl as being opened from this factory, and flush any pending class registrations if necessary.
Overrides:
configurePersistenceManager in class PersistenceManagerFactoryImpl
Since:
2.4
See Also:
PersistenceManagerFactoryImpl#configurePersistenceManager(PersistenceManager)

getRegisteredClasses

public Set getRegisteredClasses()

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.