Class PluginBundleTracker
java.lang.Object
org.osgi.util.tracker.BundleTracker<PluginRuntime>
com.xebialabs.xlrelease.osgi.spring.PluginBundleTracker
- All Implemented Interfaces:
org.osgi.util.tracker.BundleTrackerCustomizer<PluginRuntime>
Discovers Spring plugin bundles via the
PluginManifest contract, builds their child
context via PluginContextFactory, and guarantees deterministic teardown on
removedBundle - including plain bundle.stop() with no uninstall, the gap a
ServiceTracker-only approach cannot close (see
.opencode/tech/osgi.md:58-62: removedBundle fires synchronously, on the calling
thread, with a fully usable bundle classloader, for uninstall, stop-alone, and framework
shutdown alike).
Every removal path - normal teardown and the rollback of a failed install alike - funnels
through the single PluginTeardown.teardown(com.xebialabs.xlrelease.osgi.spring.PluginRuntime) procedure, so there
is exactly one place that knows how to tear a plugin down completely.
-
Field Summary
Fields inherited from class org.osgi.util.tracker.BundleTracker
context -
Constructor Summary
ConstructorsConstructorDescriptionPluginBundleTracker(org.osgi.framework.BundleContext context, org.springframework.context.support.GenericApplicationContext parent) -
Method Summary
Modifier and TypeMethodDescriptionaddingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event) voidclose()voidmodifiedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, PluginRuntime runtime) voidremovedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, PluginRuntime runtime) Methods inherited from class org.osgi.util.tracker.BundleTracker
getBundles, getObject, getTracked, getTrackingCount, isEmpty, open, remove, size
-
Constructor Details
-
PluginBundleTracker
public PluginBundleTracker(org.osgi.framework.BundleContext context, org.springframework.context.support.GenericApplicationContext parent)
-
-
Method Details
-
addingBundle
public PluginRuntime addingBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event) - Specified by:
addingBundlein interfaceorg.osgi.util.tracker.BundleTrackerCustomizer<PluginRuntime>- Overrides:
addingBundlein classorg.osgi.util.tracker.BundleTracker<PluginRuntime>
-
modifiedBundle
public void modifiedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, PluginRuntime runtime) - Specified by:
modifiedBundlein interfaceorg.osgi.util.tracker.BundleTrackerCustomizer<PluginRuntime>- Overrides:
modifiedBundlein classorg.osgi.util.tracker.BundleTracker<PluginRuntime>
-
removedBundle
public void removedBundle(org.osgi.framework.Bundle bundle, org.osgi.framework.BundleEvent event, PluginRuntime runtime) - Specified by:
removedBundlein interfaceorg.osgi.util.tracker.BundleTrackerCustomizer<PluginRuntime>- Overrides:
removedBundlein classorg.osgi.util.tracker.BundleTracker<PluginRuntime>
-
close
public void close()- Overrides:
closein classorg.osgi.util.tracker.BundleTracker<PluginRuntime>
-