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 |
---|---|
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.
|
static String |
getPrintableExtensionInformation(String installPath,
String instancePath)
Returns a string representing all information about extensions.
|
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. |
void |
reload()
Reloads the configuration framework.
|
ConfigurationFramework |
setIsClient(boolean isClient)
Specifies whether the configuration framework is being used within
a client application.
|
public static ConfigurationFramework getInstance()
public static String getPrintableExtensionInformation(String installPath, String instancePath)
installPath
- The path where application binaries are located.instancePath
- The path where application data are located.null
if there is no information available.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 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 2010-2017 ForgeRock AS.