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>
OSGi
BundleTracker
that tracks component bundles and uses BundlePlan
s to publish them.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MutableBeanLocator
Shared locator of bound components.private static final Object
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
ConstructorsConstructorDescriptionSisuTracker
(org.osgi.framework.BundleContext context, int stateMask, MutableBeanLocator locator) -
Method Summary
Modifier and TypeMethodDescriptionfinal Object
addingBundle
(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event) private void
addPublisher
(Long bundleId, BindingPublisher publisher) protected List<BundlePlan>
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 boolean
evictBundle
(org.osgi.framework.Bundle bundle) Determines whether we should remove theBindingPublisher
associated with the given bundle.final void
open()
prepare
(org.osgi.framework.Bundle bundle) Prepares aBindingPublisher
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) private void
removePublisher
(Long bundleId) Methods inherited from class org.osgi.util.tracker.BundleTracker
close, getBundles, getObject, getTracked, getTrackingCount, isEmpty, modifiedBundle, remove, size
-
Field Details
-
PLACEHOLDER
-
SUPPORT_BUNDLE_NAMES
-
bundlePublishers
-
stateMask
protected final int stateMaskMask of bundle states being tracked. -
locator
Shared locator of bound components. -
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 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
Description copied from interface:BundlePlan
Prepares aBindingPublisher
of components for the given bundle.- Specified by:
prepare
in interfaceBundlePlan
- Parameters:
bundle
- The bundle- Returns:
- Publisher of bindings;
null
if the plan doesn't apply
-
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 theBindingPublisher
associated with the given bundle.- Parameters:
bundle
- The bundle- Returns:
true
if the publisher should be removed; otherwisefalse
-
addPublisher
-
removePublisher
-