Package de.mnl.osgi.lf4osgi.core
Class LoggerFacadeManager
- java.lang.Object
-
- de.mnl.osgi.coreutils.ServiceResolver
-
- de.mnl.osgi.lf4osgi.core.LoggerFacadeManager
-
- All Implemented Interfaces:
AutoCloseable
,BundleActivator
public class LoggerFacadeManager extends de.mnl.osgi.coreutils.ServiceResolver
Tracks the availability of an OSGiLoggerFactory
service and keeps the logger facades up-to-date.
-
-
Constructor Summary
Constructors Constructor Description LoggerFacadeManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configure()
static void
contextOperation(Consumer<BundleContext> operation)
Execute an operation that depends on the availability of the bundle context.protected void
onDissolving()
protected void
onRebound(String dependency)
protected void
onResolved()
static void
registerFacade(LoggerFacade loggerFacade)
Register the given facade for receiving updates when the logger factory changes.void
start(BundleContext context)
void
stop(BundleContext context)
-
Methods inherited from class de.mnl.osgi.coreutils.ServiceResolver
addDependency, addDependency, addDependency, addDependency, addOptionalDependency, addOptionalDependency, addOptionalDependency, addOptionalDependency, close, get, get, isOpen, isResolved, open, optional, optional, setOnDissolving, setOnRebound, setOnResolved, with, with
-
-
-
-
Constructor Detail
-
LoggerFacadeManager
public LoggerFacadeManager()
-
-
Method Detail
-
registerFacade
public static void registerFacade(LoggerFacade loggerFacade)
Register the given facade for receiving updates when the logger factory changes.- Parameters:
loggerFacade
- the logger facade
-
start
public void start(BundleContext context) throws Exception
- Specified by:
start
in interfaceBundleActivator
- Overrides:
start
in classde.mnl.osgi.coreutils.ServiceResolver
- Throws:
Exception
-
configure
protected void configure()
- Overrides:
configure
in classde.mnl.osgi.coreutils.ServiceResolver
-
onResolved
protected void onResolved()
- Overrides:
onResolved
in classde.mnl.osgi.coreutils.ServiceResolver
-
onRebound
protected void onRebound(String dependency)
- Overrides:
onRebound
in classde.mnl.osgi.coreutils.ServiceResolver
-
stop
public void stop(BundleContext context) throws Exception
- Specified by:
stop
in interfaceBundleActivator
- Overrides:
stop
in classde.mnl.osgi.coreutils.ServiceResolver
- Throws:
Exception
-
contextOperation
public static void contextOperation(Consumer<BundleContext> operation)
Execute an operation that depends on the availability of the bundle context. If a context is available, the operation is executed at once. Else, it is delayed until the context becomes available.- Parameters:
operation
- the operation
-
onDissolving
protected void onDissolving()
- Overrides:
onDissolving
in classde.mnl.osgi.coreutils.ServiceResolver
-
-