org.apache.felix.cm.impl
Class ConfigurationManager
java.lang.Object
org.apache.felix.cm.impl.ConfigurationManager
- All Implemented Interfaces:
- EventListener, org.osgi.framework.BundleActivator, org.osgi.framework.BundleListener
public class ConfigurationManager
- extends Object
- implements org.osgi.framework.BundleActivator, org.osgi.framework.BundleListener
The ConfigurationManager
is the central class in this
implementation of the Configuration Admin Service Specification. As such it
has the following tasks:
- It is a
BundleActivator
which is called when the bundle
is started and stopped.
- It is a
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.
- It is a
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.
- A
ConfigurationAdminFactory
instance is registered as the
ConfigurationAdmin
service.
- A
FilePersistenceManager
instance is registered as a default
PersistenceManager
.
- Last but not least this instance manages all tasks laid out in the
specification such as maintaining configuration, taking care of configuration
events, etc.
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.
Field Summary |
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"). |
Method Summary |
void |
bundleChanged(org.osgi.framework.BundleEvent event)
|
void |
start(org.osgi.framework.BundleContext bundleContext)
|
void |
stop(org.osgi.framework.BundleContext bundleContext)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CM_CONFIG_DIR
public static final String CM_CONFIG_DIR
- The name of the bundle context property defining the location for the
configuration files (value is "felix.cm.dir").
- See Also:
start(BundleContext)
,
Constant Field Values
CM_LOG_LEVEL
public static final String CM_LOG_LEVEL
- The name of the bundle context property defining the maximum log level
(value is "felix.cm.loglevel"). The log level setting is only used if
there is no OSGi LogService available. Otherwise this setting is ignored.
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.
- See Also:
- Constant Field Values
ConfigurationManager
public ConfigurationManager()
start
public void start(org.osgi.framework.BundleContext bundleContext)
- Specified by:
start
in interface org.osgi.framework.BundleActivator
stop
public void stop(org.osgi.framework.BundleContext bundleContext)
- Specified by:
stop
in interface org.osgi.framework.BundleActivator
bundleChanged
public void bundleChanged(org.osgi.framework.BundleEvent event)
- Specified by:
bundleChanged
in interface org.osgi.framework.BundleListener
Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.