public class EventServiceConfigurationFactory extends Object
EventServiceConfiguration
. There a
various ConfigurationLoader
strategies to initilize the configuration.
DefaultConfigurationLoader
is used at last, when no configuration could
be found.
ConfigLevelFactory.DEFAULT
(5000) - PropertyConfigurationLoader
ConfigLevelFactory.DEFAULT
(5000) - WebDescriptorConfigurationLoader
ConfigLevelFactory.HIGHEST
(10000) - DefaultConfigurationLoader
addConfigurationLoader(de.novanic.eventservice.config.level.ConfigLevel, de.novanic.eventservice.config.loader.ConfigurationLoader)
and other modifier methods of that class can be used.Modifier and Type | Method and Description |
---|---|
void |
addConfigurationLoader(ConfigLevel aLevel,
ConfigurationLoader aConfigurationLoader)
Adds a
ConfigurationLoader (in the queue before the default
configuration loaders). |
void |
addCustomConfigurationLoader(ConfigurationLoader aConfigurationLoader)
Adds a custom
ConfigurationLoader (in the queue before the default
configuration loaders). |
static EventServiceConfigurationFactory |
getInstance()
This method should be used to create an instance of EventServiceConfigurationFactory.
|
EventServiceConfiguration |
loadEventServiceConfiguration()
Loads the
EventServiceConfiguration with various
ConfigurationLoader strategies. |
EventServiceConfiguration |
loadEventServiceConfiguration(String aPropertyName)
Loads the
EventServiceConfiguration with various
ConfigurationLoader strategies. |
void |
removeConfigurationLoader(ConfigurationLoader aConfigurationLoader)
Removes a
ConfigurationLoader . |
void |
replaceConfigurationLoader(ConfigLevel aLevel,
ConfigurationLoader aConfigurationLoader)
Replaces a configuration loader at the specified configuration level.
|
public static EventServiceConfigurationFactory getInstance()
public EventServiceConfiguration loadEventServiceConfiguration(String aPropertyName)
EventServiceConfiguration
with various
ConfigurationLoader
strategies.aPropertyName
- properties file if another properties file is preferred as the default properties file"
(see description of PropertyConfigurationLoader
).
The returned configurations get enriched with default values when the parameters / options aren't configured.EventServiceConfiguration
)ConfigurationException
- thrown when a configuration is available, but can't be loadedpublic EventServiceConfiguration loadEventServiceConfiguration()
EventServiceConfiguration
with various
ConfigurationLoader
strategies. The returned configurations
get enriched with default values when the parameters / options aren't configured.EventServiceConfiguration
)ConfigurationException
- thrown when a configuration is available, but can't be loadedpublic void addCustomConfigurationLoader(ConfigurationLoader aConfigurationLoader)
ConfigurationLoader
(in the queue before the default
configuration loaders).aConfigurationLoader
- custom ConfigurationLoader
public void addConfigurationLoader(ConfigLevel aLevel, ConfigurationLoader aConfigurationLoader)
ConfigurationLoader
(in the queue before the default
configuration loaders).aLevel
- ConfigLevel
to specify the priority/level for the ConfigurationLoader
aConfigurationLoader
- custom ConfigurationLoader
public void removeConfigurationLoader(ConfigurationLoader aConfigurationLoader)
ConfigurationLoader
.aConfigurationLoader
- ConfigurationLoader
to remove from the queuepublic void replaceConfigurationLoader(ConfigLevel aLevel, ConfigurationLoader aConfigurationLoader)
aLevel
- configuration level to search the ConfigurationLoader
aConfigurationLoader
- ConfigurationLoader
to addCopyright © 2012. All Rights Reserved.