public class ConfigurationManager extends Object implements org.osgi.framework.BundleActivator, org.osgi.framework.BundleListener
ConfigurationManager is the central class in this
implementation of the Configuration Admin Service Specification. As such it
has the following tasks:
BundleActivator which is called when the bundle
is started and stopped.
BundleListener which gets informed when the
states of bundles change. Mostly this is needed to unbind any bound
configuration in case a bundle is uninstalled.
ServiceListener which gets informed when
ManagedService and ManagedServiceFactory
services are registered and unregistered. This is used to provide
configuration to these services. As a service listener it also listens for
PersistenceManager instances being registered to support different
configuration persistence layers.
ConfigurationAdminFactory instance is registered as the
ConfigurationAdmin service.
FilePersistenceManager instance is registered as a default
PersistenceManager.
The default FilePersistenceManager is configured with a configuration
location taken from the felix.cm.dir framework property. If
this property is not set the config directory in the current
working directory as specified in the user.dir system property
is used.
| Modifier and Type | Field and Description |
|---|---|
static String |
CM_CONFIG_DIR
The name of the bundle context property defining the location for the
configuration files (value is "felix.cm.dir").
|
static String |
CM_LOG_LEVEL
The name of the bundle context property defining the maximum log level
(value is "felix.cm.loglevel").
|
| Constructor and Description |
|---|
ConfigurationManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
bundleChanged(org.osgi.framework.BundleEvent event) |
void |
start(org.osgi.framework.BundleContext bundleContext) |
void |
stop(org.osgi.framework.BundleContext bundleContext) |
public static final String CM_CONFIG_DIR
start(BundleContext),
Constant Field Valuespublic static final String CM_LOG_LEVEL
This value of this property is expected to be an integer number corresponding to the log level values of the OSGi LogService. That is 1 for errors, 2 for warnings, 3 for informational messages and 4 for debug messages. The default value is 2, such that only warnings and errors are logged in the absence of a LogService.
public void start(org.osgi.framework.BundleContext bundleContext)
start in interface org.osgi.framework.BundleActivatorpublic void stop(org.osgi.framework.BundleContext bundleContext)
stop in interface org.osgi.framework.BundleActivatorpublic void bundleChanged(org.osgi.framework.BundleEvent event)
bundleChanged in interface org.osgi.framework.BundleListenerCopyright © 2006–2016 The Apache Software Foundation. All rights reserved.