SolarMetric Kodo JDO 2.4.3 generated on March 27 2003

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(PersistenceManager 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, ClassResolver resolver)
           
protected  void finalize()
           
 Collection getDeferredRegistrations()
           
protected  JDBCConfiguration getJDBCConfiguration()
           
protected  PersistenceManagerImpl getOpenPersistenceManager()
          Returns any open PersistenceManagerImpl for this factory.
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()
          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
findPersistenceManager, freeze, getConfiguration, getConnectionDriverName, getConnectionFactory, getConnectionFactory2, getConnectionFactory2Name, getConnectionFactoryName, getConnectionPassword, getConnectionURL, getConnectionUserName, getIgnoreCache, getMaxPool, getMinPool, getMsWait, getMultithreaded, getNontransactionalRead, getNontransactionalWrite, getOptimistic, getPersistenceManager, getPersistenceManager, getProperties, getRestoreValues, getRetainValues, lock, newPersistenceManager, readObject, setConnectionDriverName, setConnectionFactory, setConnectionFactory2, setConnectionFactory2Name, setConnectionFactoryName, setConnectionPassword, setConnectionURL, setConnectionUserName, setIgnoreCache, setMaxPool, setMinPool, setMsWait, setMultithreaded, setNontransactionalRead, setNontransactionalWrite, setOptimistic, setRestoreValues, setRetainValues, 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.

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()
Description copied from class: PersistenceManagerFactoryImpl
Instantiate a connection factory from the current configuration. This method returns null by default.
Overrides:
newConnectionFactory in class PersistenceManagerFactoryImpl

createConnectionFactory

public static Object createConnectionFactory(JDBCConfiguration conf)

createConnectionFactory

public static Object createConnectionFactory(JDBCConfiguration conf,
                                             ClassResolver resolver)

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()

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

getOpenPersistenceManager

protected PersistenceManagerImpl getOpenPersistenceManager()
Returns any open PersistenceManagerImpl for this factory. This is used to create a Connector object for interacting with the data store during class registration.

configurePersistenceManager

protected final void configurePersistenceManager(PersistenceManager 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.4.3 generated on March 27 2003

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