Class PluginEventSubscriptionsImpl
java.lang.Object
com.xebialabs.xlrelease.osgi.spring.PluginEventSubscriptionsImpl
- All Implemented Interfaces:
com.xebialabs.xlrelease.osgi.api.spring.PluginEventSubscriptions
@Component
public class PluginEventSubscriptionsImpl
extends Object
implements com.xebialabs.xlrelease.osgi.api.spring.PluginEventSubscriptions
A single instance is shared between the root host
ApplicationContext (as this
@Component) and every plugin's curated parent context (PluginApiParentContext
registers the exact same object as a singleton there), mirroring PluginExtensionRegistryImpl's
sharing pattern.
Subscriptions are tracked by the ClassLoader active on the calling thread at
subscribe(...) time, not by an explicit plugin identifier - subscribe has no
such parameter. This relies on PluginContextFactory/PluginExecutionContext
pinning the TCCL to the owning bundle's classloader for every plugin code execution path
(context refresh, and eventually request handling and extension invocation), so
Thread.currentThread().getContextClassLoader() reliably identifies "which plugin is
calling right now" wherever a plugin bean's own code runs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcloseAll(ClassLoader owner) Closes every still-open handle issued underowner, even ones the plugin author forgot to close.
-
Constructor Details
-
PluginEventSubscriptionsImpl
-
-
Method Details
-
subscribe
- Specified by:
subscribein interfacecom.xebialabs.xlrelease.osgi.api.spring.PluginEventSubscriptions
-
closeAll
Closes every still-open handle issued underowner, even ones the plugin author forgot to close. Called byPluginTeardownas one ordered teardown step. Idempotent: a second call for the same, already-clearedownerfinds nothing and is a no-op.
-