
public class DefaultSettingsRepository extends Object implements Settings4jRepository
The casual user does not have to deal with this class directly.
The structure of the settings hierarchy is maintained by the getSettings() method. The hierarchy is such that
children link to their parent but parents do not have any pointers to their children. Moreover, settings can be
instantiated in any order, in particular descendant before ancestor.
In case a descendant is created before a particular ancestor, then it creates a provision node for the ancestor and adds itself to the provision node. Other descendants of the same ancestor add themselves to the previously created provision node.
| Constructor and Description |
|---|
DefaultSettingsRepository() |
| Modifier and Type | Method and Description |
|---|---|
int |
getConnectorCount()
Return the Connector Count.
|
Settings4jInstance |
getSettings()
Retrieve the appropriate
Settings4j instance. |
Settings4jInstance |
getSettings(Settings4jFactory factory)
Retrieve the appropriate
Settings4j instance or create it with the give factory if doesn'r already exist. |
void |
resetConfiguration()
Remove the Settings, Connectors and other Objects from the Repository.
|
public Settings4jInstance getSettings()
Settings4jRepositorySettings4j instance.getSettings in interface Settings4jRepositorySettings4jInstancepublic Settings4jInstance getSettings(Settings4jFactory factory)
Settings4j instance or create it with the give factory if doesn'r already exist.getSettings in interface Settings4jRepositoryfactory - The factory to create a Settings4jInstance.Settings4jInstancepublic int getConnectorCount()
SettingsManager.getSettings()getConnectorCount in interface Settings4jRepositorypublic void resetConfiguration()
Remove the Settings, Connectors and other Objects from the Repository.
Make it ready to fill it with a new Configuration.
Example (maybe in an init()-Method of your Application):
// clear Settings from "settings4j.xml"
SettingsRepository settingsRepository = SettingsManager.getSettingsRepository();
settingsRepository.resetConfiguration();
// read XML Custome to configure the repository
URL url = ClasspathContentResolver.getResource("customizedSettings4j.xml");
DOMConfigurator domConfigurator = new DOMConfigurator(settingsRepository);
domConfigurator.doConfigure(url);
resetConfiguration in interface Settings4jRepositoryCopyright © 2008–2014. All rights reserved.