de.nava.informa.utils.manager
Class PersistenceManagerConfig

java.lang.Object
  extended by de.nava.informa.utils.manager.PersistenceManagerConfig

public final class PersistenceManagerConfig
extends Object

Persistence manager configuration class. At application start it reads the value of JVM property informa.persistencemanager and instantiates class with given name as persistence manager. Class, mentioned in property should implement PersistenceManagerIF interface.

Client application can get instance of persistence manager using getPersistenceManager() method. Single instance of persistence manager is shared.

Author:
Aleksey Gureev (spyromus@noizeramp.com)

Method Summary
static PersistenceManagerIF getPersistenceManager()
          Returns instance of persistence manager chosen by application.
static void setPersistenceManagerClassName(String className)
          Sets the name of PersistenceManagerIF interface implementation class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setPersistenceManagerClassName

public static void setPersistenceManagerClassName(String className)
                                           throws ClassNotFoundException,
                                                  IllegalAccessException,
                                                  InstantiationException
Sets the name of PersistenceManagerIF interface implementation class. If class is successfully located instance can be taken with getPersistenceManager() method.

Parameters:
className - name of implemenation class.
Throws:
ClassNotFoundException - if class not found.
IllegalAccessException - if the class or its nullary constructor is not accessible.
InstantiationException - if this Class represents an abstract class, an interface, an array class, a primitive type, or void; or if the class has no nullary constructor; or if the instantiation fails for some other reason.

getPersistenceManager

public static PersistenceManagerIF getPersistenceManager()
Returns instance of persistence manager chosen by application.

Returns:
instance or NULL if manager is not instantiated.


Copyright © 2002-2007 Niko Schmuck. All Rights Reserved.