Class ForwardingManager

  • All Implemented Interfaces:
    AutoCloseable, BundleActivator

    public class ForwardingManager
    extends de.mnl.osgi.coreutils.ServiceResolver
    This class provides the activator for this service. It registers (respectively unregisters) the LogWriter as LogListener for for all log reader services and forwards any already existing log entries to it.
    • Method Detail

      • configure

        public void configure()
        Open the log service tracker. The tracker is customized to attach a LogWriter to all registered log reader services (and detach it on un-registration, of course). Already existing log entries are forwarded to the LogWriter as well. No provisions have been taken to avoid the duplicate output that can occur if a message is logged between registering the LogWriter and forwarding stored log entries.
        Overrides:
        configure in class de.mnl.osgi.coreutils.ServiceResolver
      • onResolved

        protected void onResolved()
        Overrides:
        onResolved in class de.mnl.osgi.coreutils.ServiceResolver
      • onRebound

        protected void onRebound​(String dependency)
        Overrides:
        onRebound in class de.mnl.osgi.coreutils.ServiceResolver
      • onDissolving

        protected void onDissolving()
        Overrides:
        onDissolving in class de.mnl.osgi.coreutils.ServiceResolver
      • publish

        public void publish​(LogEntry entry,
                            LogRecord record)
        Send the record to all handlers.
        Parameters:
        entry - the original OSGi log entry
        record - the prepared JUL record