public final class ConfigurationFramework extends Object
Initially the configuration framework is disabled, and calls to the
getClassLoader()
will return the system default class loader.
Applications MUST NOT maintain persistent references to the class loader as it can change at run-time.
Modifier and Type | Method and Description |
---|---|
void |
addExtension(String... extensions)
Loads the named extensions into the configuration framework.
|
ClassLoader |
getClassLoader()
Returns the class loader which should be used for loading classes and
resources.
|
String |
getInstallPath()
Returns the installation path.
|
static ConfigurationFramework |
getInstance()
Returns the single application wide configuration framework instance.
|
String |
getInstancePath()
Returns the instance path.
|
ConfigurationFramework |
initialize()
Initializes the configuration framework using the application's class
loader as the parent class loader, and the current working directory as
the install and instance path.
|
ConfigurationFramework |
initialize(String installAndInstancePath)
Initializes the configuration framework using the application's class
loader as the parent class loader, and the provided install/instance
path.
|
ConfigurationFramework |
initialize(String installPath,
String instancePath)
Initializes the configuration framework using the application's class
loader as the parent class loader, and the provided install and instance
paths.
|
ConfigurationFramework |
initialize(String installPath,
String instancePath,
ClassLoader parent)
Initializes the configuration framework using the provided parent class
loader and install and instance paths.
|
boolean |
isClient()
Returns
true if the configuration framework is being used within
a client application. |
boolean |
isInitialized()
Returns
true if the configuration framework has been initialized. |
String |
printExtensionInformation()
Prints out all information about extensions.
|
void |
reload()
Reloads the configuration framework.
|
ConfigurationFramework |
setIsClient(boolean isClient)
Specifies whether or not the configuration framework is being used within
a client application.
|
public static ConfigurationFramework getInstance()
public void addExtension(String... extensions) throws ConfigException
extensions
- The names of the extensions to be loaded. The names should not
contain any path elements and must be located within the
extensions folder.ConfigException
- If one of the extensions could not be loaded and initialized.IllegalStateException
- If the configuration framework has not yet been initialized.IllegalArgumentException
- If one of the extension names was not a single relative path
name element or was an absolute path.public ClassLoader getClassLoader()
Applications MUST NOT maintain persistent references to the class loader as it can change at run-time.
public ConfigurationFramework initialize() throws ConfigException
ConfigException
- If the configuration framework could not initialize
successfully.IllegalStateException
- If the configuration framework has already been initialized.public ConfigurationFramework initialize(String installAndInstancePath) throws ConfigException
installAndInstancePath
- The path where application binaries and data are located.ConfigException
- If the configuration framework could not initialize
successfully.IllegalStateException
- If the configuration framework has already been initialized.public ConfigurationFramework initialize(String installPath, String instancePath) throws ConfigException
installPath
- The path where application binaries are located.instancePath
- The path where application data are located.ConfigException
- If the configuration framework could not initialize
successfully.IllegalStateException
- If the configuration framework has already been initialized.public ConfigurationFramework initialize(String installPath, String instancePath, ClassLoader parent) throws ConfigException
installPath
- The path where application binaries are located.instancePath
- The path where application data are located.parent
- The parent class loader.ConfigException
- If the configuration framework could not initialize
successfully.IllegalStateException
- If the configuration framework has already been initialized.public boolean isClient()
true
if the configuration framework is being used within
a client application. Client applications will perform less property
value validation than server applications because they do not have
resources available such as the server schema.true
if the configuration framework is being used within
a client application.public boolean isInitialized()
true
if the configuration framework has been initialized.true
if the configuration framework has been initialized.public String printExtensionInformation()
null
if there is no information available.public void reload() throws ConfigException
ConfigException
- If the configuration framework could not initialize
successfully.IllegalStateException
- If the configuration framework has not yet been initialized.public ConfigurationFramework setIsClient(boolean isClient)
isClient
- true
if the configuration framework is being used
within a client application.public String getInstallPath()
public String getInstancePath()
Copyright © 2011-2015 ForgeRock AS. All Rights Reserved.