|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.config.ServiceConfigFactory
public final class ServiceConfigFactory
This factory class is designed to be the main interface between the service
configuration information and the users of the information. When initialized
the factory loads the configuration from the file system, allowing access to
the information by others. The init method may be called by more
than one thread, but MUST be called by at least one thread before
the factory can be used.
The factory supports the singleton design pattern, and thus the configuration
is loaded only once. All callers get the same reference unless a call to
reload is made. After than any saved instances of the factory can still
be referenced. Old references will not reflect any changes in the file if the
factory is reloaded.
| Constructor Summary | |
|---|---|
ServiceConfigFactory(Reader rdr)
|
|
| Method Summary | |
|---|---|
static ServiceConfigFactory |
getInstance()
Returns the currently defined singleton instance of the factory. |
Service[] |
getServices()
Returns an array of all the defined configuration information for the Services. |
static void |
init()
Load the config from the default config file and create the singleton instance of this factory. |
static void |
reload()
Reload the config from the default config file |
static void |
setInstance(ServiceConfigFactory instance)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ServiceConfigFactory(Reader rdr)
throws org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException| Method Detail |
|---|
public static void init()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
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.
public static void reload()
throws IOException,
org.exolab.castor.xml.MarshalException,
org.exolab.castor.xml.ValidationException
IOException - Thrown if the specified config file cannot be read/loaded
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.public static ServiceConfigFactory getInstance()
reload method is called.
IllegalStateException - Thrown if the factory has not yet been initialized.public static void setInstance(ServiceConfigFactory instance)
public Service[] getServices()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||