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 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.
|
void |
initializeSilently()
Silently initialize the configuration framework.
|
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. |
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 void initializeSilently()
Do not log anything during the initialization.
Catch ConfigException
which may occurs and convert it to a RuntimeException
.
This method should be used by client tools who need to initialize the framework.
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 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 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-2018 ForgeRock AS.