Class PluginTeardown

java.lang.Object
com.xebialabs.xlrelease.osgi.spring.PluginTeardown

public class PluginTeardown extends Object
The single, strictly-ordered, fully idempotent teardown procedure used by every plugin removal path - this is the load-bearing safety mechanism of the entire OSGi plugin platform. Reused (not reimplemented) by PluginBundleTracker.removedBundle(org.osgi.framework.Bundle, org.osgi.framework.BundleEvent, com.xebialabs.xlrelease.osgi.spring.PluginRuntime) (normal teardown) and PluginBundleTracker.addingBundle(org.osgi.framework.Bundle, org.osgi.framework.BundleEvent)'s rollback branch on a partially-built PluginRuntime (a failed install).

Each step is individually try/catch-logged: a failure in one step must never prevent later steps from running. v1 implements steps 1, 2, 3, and 6 as no-ops - there is no HTTP layer or per-plugin serialization yet - but the ordering and try/catch structure is in place now so a future phase can fill in behavior without reopening this sequence.

Step methods are package-visible rather than private specifically so a test in this package can subclass and override them to record call order (method references in teardown(com.xebialabs.xlrelease.osgi.spring.PluginRuntime) dispatch virtually, so an override is observed) - see PluginTeardownTest for the ordering and fault-tolerance assertions this enables.