Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Commons Log 2.0.6
-
None
Description
Currently the Commons Log module exports the OSGi Configuration Admin package to be able to register ManagedService[Factory] services. This is probably very bad style but has been done to have the Log mechanism configurable as soon as the Configuration Admin service is registered.
There is a better solution to this problem though:
- The OSGi Configuration Admin package is imported using DynamicImport-Package. This allows for
dynamic wiring only when the API is used. - The ManagedService[Factory] services are registered as ServiceFactory services. This means,
that the actual Configuration Admin API (ManagedService[Factory] interfaces and ConfigurationException)
need only be wired, when these services are actually accessed – which in turn is the case only
when the ConfigurationAdmin service is registered and starts working.
Thus we solve the exact problem: Commons Log can be active and will be Configuration Admin configurable as soon as the ConfigurationAdmin service is active.