Class SisuTracker

java.lang.Object
org.osgi.util.tracker.BundleTracker<Object>
org.eclipse.sisu.launch.SisuTracker
All Implemented Interfaces:
BundlePlan, org.osgi.util.tracker.BundleTrackerCustomizer<Object>

public class SisuTracker extends org.osgi.util.tracker.BundleTracker<Object> implements BundlePlan
OSGi BundleTracker that tracks component bundles and uses BundlePlans to publish them.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final MutableBeanLocator
    Shared locator of bound components.
    protected final List<BundlePlan>
    Custom plans; contributed by attaching fragments to the extender bundle.
    protected final int
    Mask of bundle states being tracked.

    Fields inherited from class org.osgi.util.tracker.BundleTracker

    context
  • Constructor Summary

    Constructors
    Constructor
    Description
    SisuTracker(org.osgi.framework.BundleContext context, int stateMask, MutableBeanLocator locator)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final Object
    addingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event)
     
    protected List<BundlePlan>
    Discovers plans listed locally under META-INF/services/org.eclipse.sisu.launch.BundlePlan ; implementations must have a public no-arg constructor or one that accepts a MutableBeanLocator.
    protected boolean
    evictBundle(org.osgi.framework.Bundle bundle)
    Determines whether we should remove the BindingPublisher associated with the given bundle.
    final void
     
    prepare(org.osgi.framework.Bundle bundle)
    Prepares a BindingPublisher of components for the given bundle.
    final void
    Purges any bundles that are no longer valid.
    final void
    removedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
     

    Methods inherited from class org.osgi.util.tracker.BundleTracker

    close, getBundles, getObject, getTracked, getTrackingCount, isEmpty, modifiedBundle, remove, size

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • stateMask

      protected final int stateMask
      Mask of bundle states being tracked.
    • locator

      protected final MutableBeanLocator locator
      Shared locator of bound components.
    • plans

      protected final List<BundlePlan> plans
      Custom plans; contributed by attaching fragments to the extender bundle.
  • Constructor Details

    • SisuTracker

      public SisuTracker(org.osgi.framework.BundleContext context, int stateMask, MutableBeanLocator locator)
  • Method Details

    • open

      public final void open()
      Overrides:
      open in class org.osgi.util.tracker.BundleTracker<Object>
    • addingBundle

      public final Object addingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event)
      Specified by:
      addingBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer<Object>
      Overrides:
      addingBundle in class org.osgi.util.tracker.BundleTracker<Object>
    • removedBundle

      public final void removedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
      Specified by:
      removedBundle in interface org.osgi.util.tracker.BundleTrackerCustomizer<Object>
      Overrides:
      removedBundle in class org.osgi.util.tracker.BundleTracker<Object>
    • purgeBundles

      public final void purgeBundles()
      Purges any bundles that are no longer valid.
    • prepare

      public BindingPublisher prepare(org.osgi.framework.Bundle bundle)
      Description copied from interface: BundlePlan
      Prepares a BindingPublisher of components for the given bundle.
      Specified by:
      prepare in interface BundlePlan
      Parameters:
      bundle - The bundle
      Returns:
      Publisher of bindings; null if the plan doesn't apply
    • discoverPlans

      protected List<BundlePlan> discoverPlans()
      Discovers plans listed locally under META-INF/services/org.eclipse.sisu.launch.BundlePlan ; implementations must have a public no-arg constructor or one that accepts a MutableBeanLocator.
      Returns:
      List of plans
    • evictBundle

      protected boolean evictBundle(org.osgi.framework.Bundle bundle)
      Determines whether we should remove the BindingPublisher associated with the given bundle.
      Parameters:
      bundle - The bundle
      Returns:
      true if the publisher should be removed; otherwise false