org.jpox
Class ObjectManagerFactoryImpl

java.lang.Object
  extended by org.jpox.PersistenceConfiguration
      extended by org.jpox.ObjectManagerFactoryImpl
Direct Known Subclasses:
AbstractPersistenceManagerFactory

public class ObjectManagerFactoryImpl
extends PersistenceConfiguration

ObjectManagerFactory responsible for creation of ObjectManagers for persistence of objects to datastores. Will typically be either extended or utilised by PersistenceManagerFactory (JDO) or EntityManagerFactory (JPA).

Version:
$Revision: 1.15 $

Field Summary
protected  Level2Cache cache
          Level 2 Cache, caching across ObjectManagers.
protected  OMFContext omfContext
          The context that this ObjectManagerFactory uses.
 
Fields inherited from class org.jpox.PersistenceConfiguration
configurable, LOCALISER
 
Constructor Summary
ObjectManagerFactoryImpl()
          Constructor.
 
Method Summary
 void addFetchGroup(FetchGroup group)
          Method to add a fetch group for use by this PMF.
protected  void assertIsOpen()
          Asserts that the factory is open.
 void clearFetchGroups()
          Clear all dynamic FetchGroups from use.
 void close()
          Close the ObjectManagerFactory.
 FetchGroup createFetchGroup(java.lang.String name, java.lang.Class cls)
          Method to create a (dynamic) fetch group.
 FetchGroup getFetchGroup(java.lang.String name, java.lang.Class cls)
          Accessor for a fetch group for the specified class.
 FetchGroup[] getFetchGroups(java.lang.String name)
          Accessor for the fetch groups for the specified name.
 Level2Cache getLevel2Cache()
          Accessor for the DataStore (level 2) Cache
 OMFContext getOMFContext()
          Gets the context for this ObjectManagerFactory
 PersistenceConfiguration getPersistenceConfiguration()
          Accessor for the PersistenceConfiguration.
static java.lang.String getVendorName()
          Utility to get the vendor of JPOX.
static java.lang.String getVersionNumber()
          Utility to get the version of JPOX.
protected  void initialiseLevel2Cache()
          Method to initialise the L2 cache.
protected  void initialiseOMFContext()
          Method to initialise the OMFContext.
protected  void initialiseStoreManager(ClassLoaderResolver clr)
          Method to initialise the StoreManager used by this factory.
 boolean isClosed()
          Utility to return whether the factory is closed or not.
protected  void logConfiguration()
          Method to log the configuration of this factory.
 void removeFetchGroup(java.lang.String name, java.lang.Class cls)
          Method to remove a dynamic FetchGroup from use by this PMF.
 
Methods inherited from class org.jpox.PersistenceConfiguration
assertConfigurable, equals, getBooleanObjectProperty, getBooleanProperty, getCalendarForDateTimezone, getIntProperty, getLongProperty, getOptions, getPrimaryClassLoader, getProperty, getStringProperty, hasProperty, isJcaMode, setDefaultProperties, setJCAMode, setOptions, setPrimaryClassLoader, setPropertiesFile, setProperty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

omfContext

protected OMFContext omfContext
The context that this ObjectManagerFactory uses.


cache

protected Level2Cache cache
Level 2 Cache, caching across ObjectManagers.

Constructor Detail

ObjectManagerFactoryImpl

public ObjectManagerFactoryImpl()
Constructor.

Method Detail

assertIsOpen

protected void assertIsOpen()
Asserts that the factory is open.

Throws:
JPOXUserException - if it is already closed

logConfiguration

protected void logConfiguration()
Method to log the configuration of this factory.


initialiseOMFContext

protected void initialiseOMFContext()
Method to initialise the OMFContext. This should be performed after setting any persistence properties that affect the content of the OMFContext (e.g PluginRegistry, ClassLoaderResolver, etc).


initialiseStoreManager

protected void initialiseStoreManager(ClassLoaderResolver clr)
Method to initialise the StoreManager used by this factory.

Parameters:
clr - ClassLoaderResolver to use for class loading issues

initialiseLevel2Cache

protected void initialiseLevel2Cache()
Method to initialise the L2 cache.


close

public void close()
Close the ObjectManagerFactory. Cleans out all objects in the Level2 cache and closes the context, marking the factory as closed.


isClosed

public boolean isClosed()
Utility to return whether the factory is closed or not.

Returns:
Whether it is closed.

getOMFContext

public OMFContext getOMFContext()
Gets the context for this ObjectManagerFactory

Returns:
Returns the context.

getPersistenceConfiguration

public PersistenceConfiguration getPersistenceConfiguration()
Accessor for the PersistenceConfiguration.

Returns:
Returns the persistence config.

getLevel2Cache

public Level2Cache getLevel2Cache()
Accessor for the DataStore (level 2) Cache

Returns:
The datastore cache
Since:
1.1

getVersionNumber

public static java.lang.String getVersionNumber()
Utility to get the version of JPOX.

Returns:
Version number for JPOX.

getVendorName

public static java.lang.String getVendorName()
Utility to get the vendor of JPOX.

Returns:
Vendor name for JPOX.

createFetchGroup

public FetchGroup createFetchGroup(java.lang.String name,
                                   java.lang.Class cls)
Method to create a (dynamic) fetch group.

Parameters:
name - Name of the group
cls - Class being represented.

addFetchGroup

public void addFetchGroup(FetchGroup group)
Method to add a fetch group for use by this PMF.

Parameters:
group - The FetchGroup

getFetchGroup

public FetchGroup getFetchGroup(java.lang.String name,
                                java.lang.Class cls)
Accessor for a fetch group for the specified class.

Parameters:
name - Name of the group
cls - The class
Returns:
The FetchGroup

getFetchGroups

public FetchGroup[] getFetchGroups(java.lang.String name)
Accessor for the fetch groups for the specified name.

Parameters:
name - Name of the group
Returns:
The FetchGroup

removeFetchGroup

public void removeFetchGroup(java.lang.String name,
                             java.lang.Class cls)
Method to remove a dynamic FetchGroup from use by this PMF.

Parameters:
name - Name of the group
cls - The class

clearFetchGroups

public void clearFetchGroups()
Clear all dynamic FetchGroups from use.



Copyright © -2008 . All Rights Reserved.