Class PluginBundleTracker
java.lang.Object
org.osgi.util.tracker.BundleTracker<PluginRuntime>
com.xebialabs.xlrelease.osgi.impl.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, which fires
synchronously on the calling thread with a fully usable bundle classloader for uninstall,
stop, 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.impl.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) takeTrackingFailure(org.osgi.framework.Bundle bundle) Outcome of tracking the current revision ofbundle, consumed by a checked install.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>
-
takeTrackingFailure
Outcome of tracking the current revision ofbundle, consumed by a checked install.- Returns:
- empty when the bundle is tracked as a running Spring plugin; otherwise the reason it is not.
-
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>
-