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 | Class and Description |
---|---|
static interface |
ConfigurationFramework.InitParameters
Represents parameters used for initializing a
ConfigurationFramework . |
Modifier and Type | Method and Description |
---|---|
void |
forceInitialize(ConfigurationFramework.InitParameters initParameters)
Initializes the configuration framework using the application's class loader
as the parent class loader, and the provided install and instance paths.
|
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.
|
com.forgerock.opendj.util.Version |
getVersion()
Returns the version of this configuration framework.
|
void |
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.
|
void |
initialize(ConfigurationFramework.InitParameters initParameters)
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.
|
void |
initializeSilently()
Silently initialize the configuration framework.
|
boolean |
isClient()
Returns
true if 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 void initialize() throws ConfigException
ConfigException
- If the configuration framework could not initialize successfully.IllegalStateException
- If the configuration framework has already been initialized.public void initialize(ConfigurationFramework.InitParameters initParameters) throws ConfigException
initParameters
- The parameters
used for initializing this configuration framework.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 void forceInitialize(ConfigurationFramework.InitParameters initParameters) throws ConfigException
initParameters
- The parameters
used for initializing this configuration framework.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 String getInstallPath()
public String getInstancePath()
public com.forgerock.opendj.util.Version getVersion()
Version
object representing the version of this ConfigurationFramework
Copyright 2010-2022 ForgeRock AS.