Package org.opennms.netmgt.config
Class ServiceConfigFactory
- java.lang.Object
-
- org.opennms.netmgt.config.ServiceConfigFactory
-
- All Implemented Interfaces:
ServiceConfigFactory
public final class ServiceConfigFactory extends Object implements ServiceConfigFactory
This 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.
- Author:
- Weave
-
-
Constructor Summary
Constructors Constructor Description ServiceConfigFactory()
Private constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Service[]
getServices()
Returns an array of all the defined configuration information for the Services.void
reload()
Reload the config from the default config file
-
-
-
Constructor Detail
-
ServiceConfigFactory
public ServiceConfigFactory()
Private constructor. This constructor used to load the specified configuration file and initialized an instance of the class.- Parameters:
configFile
- The name of the configuration file.- Throws:
IOException
- Thrown if the specified config file cannot be read
-
-
Method Detail
-
reload
public void reload()
Reload the config from the default config file- Specified by:
reload
in interfaceServiceConfigFactory
- Throws:
IOException
- Thrown if the specified config file cannot be read/loadedIOException
- if any.
-
getServices
public Service[] getServices()
Returns an array of all the defined configuration information for the Services. If there are no defined services an array of length zero is returned to the caller.- Specified by:
getServices
in interfaceServiceConfigFactory
- Returns:
- An array holding a reference to all the Service configuration instances.
-
-