Package org.eclipse.sisu.launch
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
OSGiBundleTrackerthat tracks component bundles and usesBundlePlans to publish them.
-
-
Field Summary
Fields Modifier and Type Field Description protected MutableBeanLocatorlocatorShared locator of bound components.protected List<BundlePlan>plansCustom plans; contributed by attaching fragments to the extender bundle.protected intstateMaskMask of bundle states being tracked.
-
Constructor Summary
Constructors Constructor Description SisuTracker(org.osgi.framework.BundleContext context, int stateMask, MutableBeanLocator locator)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectaddingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event)protected List<BundlePlan>discoverPlans()Discovers plans listed locally underMETA-INF/services/org.eclipse.sisu.launch.BundlePlan; implementations must have a public no-arg constructor or one that accepts aMutableBeanLocator.protected booleanevictBundle(org.osgi.framework.Bundle bundle)Determines whether we should remove theBindingPublisherassociated with the given bundle.voidopen()BindingPublisherprepare(org.osgi.framework.Bundle bundle)Prepares aBindingPublisherof components for the given bundle.voidpurgeBundles()Purges any bundles that are no longer valid.voidremovedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object object)
-
-
-
Field Detail
-
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 Detail
-
SisuTracker
public SisuTracker(org.osgi.framework.BundleContext context, int stateMask, MutableBeanLocator locator)
-
-
Method Detail
-
open
public final void open()
- Overrides:
openin classorg.osgi.util.tracker.BundleTracker<Object>
-
addingBundle
public final Object addingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event)
-
removedBundle
public final void removedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, Object 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:BundlePlanPrepares aBindingPublisherof components for the given bundle.- Specified by:
preparein interfaceBundlePlan- Parameters:
bundle- The bundle- Returns:
- Publisher of bindings;
nullif the plan doesn't apply
-
discoverPlans
protected List<BundlePlan> discoverPlans()
Discovers plans listed locally underMETA-INF/services/org.eclipse.sisu.launch.BundlePlan; implementations must have a public no-arg constructor or one that accepts aMutableBeanLocator.- Returns:
- List of plans
-
evictBundle
protected boolean evictBundle(org.osgi.framework.Bundle bundle)
Determines whether we should remove theBindingPublisherassociated with the given bundle.- Parameters:
bundle- The bundle- Returns:
trueif the publisher should be removed; otherwisefalse
-
-