com.sptci.jdo
Class PersistenceManagerFactory

java.lang.Object
  extended by com.sptci.jdo.PersistenceManagerFactory

public final class PersistenceManagerFactory
extends java.lang.Object

A factory for accessing instances of a JDO Persistence Manager that are necessary for interacting with the JDO data store.

Version:
$Id: PersistenceManagerFactory.java,v 1.2 2006/02/14 22:41:41 rakesh Exp $
Author:
Rakesh Vidyadharan 05th February, 2006

Copyright 2006, Sans Pareil Technologies, Inc.


Field Summary
private static java.lang.String JDO_DATASTORE_PROPERTIES
          The name of the system property used to specify the location of the JDO DataStore connection properties.
private static java.util.logging.Logger logger
          The logger used to log messages to.
private static javax.jdo.PersistenceManager persistenceManager
          The single application wide instanace that is used to manage read only objects.
 
Constructor Summary
private PersistenceManagerFactory()
          Default constructor.
 
Method Summary
private static java.util.Properties fetchProperties()
          Open the properties file and read the properties from it.
static javax.jdo.PersistenceManager getPersistenceManager()
          Return an instance of a PersistenceManager for interacting with the JDO data store.
private static void initPersistenceManager()
          Initialise the persistenceManager if it has not already been initialised, or has been closed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final java.util.logging.Logger logger
The logger used to log messages to.


JDO_DATASTORE_PROPERTIES

private static final java.lang.String JDO_DATASTORE_PROPERTIES
The name of the system property used to specify the location of the JDO DataStore connection properties.

See Also:
Constant Field Values

persistenceManager

private static javax.jdo.PersistenceManager persistenceManager
The single application wide instanace that is used to manage read only objects.

Constructor Detail

PersistenceManagerFactory

private PersistenceManagerFactory()
Default constructor. Cannot be initialsed.

Method Detail

getPersistenceManager

public static final javax.jdo.PersistenceManager getPersistenceManager()
                                                                throws java.lang.RuntimeException
Return an instance of a PersistenceManager for interacting with the JDO data store.

Throws:
java.lang.RuntimeException - If errors are encountered while reading the properties file
See Also:
initPersistenceManager()

initPersistenceManager

private static final void initPersistenceManager()
                                          throws java.lang.RuntimeException
Initialise the persistenceManager if it has not already been initialised, or has been closed.

Throws:
java.lang.RuntimeException - If errors are encountered while reading the properties file while initialising the persistence manager.
See Also:
fetchProperties()

fetchProperties

private static final java.util.Properties fetchProperties()
                                                   throws java.lang.RuntimeException
Open the properties file and read the properties from it. The full path to the properties file must be specified as a system property with name ObjectDBProperties

Returns:
Properties - The initialised properties object.
Throws:
java.lang.RuntimeException - If errors are encountered while reading the properties file
See Also:
JDO_DATASTORE_PROPERTIES


Copyright © 2006 Sans Pareil Technologies, Inc. All Rights Reserved.