com.squeakysand.osgi.framework
Class LoggingBundleListener

java.lang.Object
  extended by com.squeakysand.osgi.framework.LoggingBundleListener
All Implemented Interfaces:
EventListener, org.osgi.framework.BundleListener

public class LoggingBundleListener
extends Object
implements org.osgi.framework.BundleListener

BundleListener implementation that will listen for events based on the supplied event filter and will log them using SLF4J.

Author:
Craig S. Dickson

Constructor Summary
LoggingBundleListener()
          Creates a LoggingBundleListener that logs with its own logger.
LoggingBundleListener(Logger logger)
          Creates a LoggingBundleListener that logs with the supplied Logger instance.
 
Method Summary
 void bundleChanged(org.osgi.framework.BundleEvent event)
           
 void setEventFilter(Predicate<? super org.osgi.framework.BundleEvent> eventFilter)
          Sets the filter to use to determine which BundleEvents should be logged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LoggingBundleListener

public LoggingBundleListener()
Creates a LoggingBundleListener that logs with its own logger.


LoggingBundleListener

public LoggingBundleListener(Logger logger)
Creates a LoggingBundleListener that logs with the supplied Logger instance.

Parameters:
logger - the Logger instance ot use.
Method Detail

setEventFilter

public void setEventFilter(Predicate<? super org.osgi.framework.BundleEvent> eventFilter)
Sets the filter to use to determine which BundleEvents should be logged.

Parameters:
eventFilter - the filter to use.

bundleChanged

public void bundleChanged(org.osgi.framework.BundleEvent event)
Specified by:
bundleChanged in interface org.osgi.framework.BundleListener


Copyright 2010-2012 Craig S. Dickson (http://craigsdickson.com)