|
OpenNMS API 1.2.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.config.DatabaseConnectionFactory
This is the singleton class used to load the OpenNMS database configuration from the opennms-database.xml. This provides convenience methods to create database connections to the database configured in this default xml
Note: Users of this class should make sure the init() is called before calling any other method to ensure the config is loaded before accessing other convenience methods
Field Summary | |
private static boolean |
m_legacy
Use the old Legacy code or the C3P0 based classes |
private static boolean |
m_loaded
This member is set to true if the configuration file has been loaded. |
private static DbConnectionFactory |
m_singleton
The singleton instance of this factory |
Constructor Summary | |
DatabaseConnectionFactory()
|
Method Summary | |
static DbConnectionFactory |
getInstance()
Return the singleton instance of this factory. |
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
static void |
setInstance(DbConnectionFactory singleton)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static DbConnectionFactory m_singleton
private static boolean m_loaded
private static boolean m_legacy
Constructor Detail |
public DatabaseConnectionFactory()
Method Detail |
public static void init() throws java.io.IOException, org.exolab.castor.xml.MarshalException, org.exolab.castor.xml.ValidationException, java.lang.ClassNotFoundException
java.io.IOException
- Thrown if the specified config file cannot be read
org.exolab.castor.xml.MarshalException
- Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException
- Thrown if the contents do not match the required schema.
java.lang.ClassNotFoundException
public static DbConnectionFactory getInstance()
Return the singleton instance of this factory. This is the instance of
the factory that was last created when the
init
or
reload
method was invoked. The instance will not change
unless a reload
method is invoked.
java.lang.IllegalStateException
- Thrown if the factory has not yet been initialized.public static void setInstance(DbConnectionFactory singleton)
|
OpenNMS API 1.2.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |