Class PluginClassLoaderCachePurger
java.lang.Object
com.xebialabs.xlrelease.osgi.spring.PluginClassLoaderCachePurger
Purges the enumerable set of JDK/Spring caches that would otherwise pin a departing plugin's
classloader - a hand-rolled list, after rejecting
ClassLoaderLeakPreventor (stale since 2016, and its API assumes a
ServletContextEvent rather than an arbitrary ClassLoader). Called from
PluginTeardown step 8.
The first two calls are classloader-scoped (they clear only classLoader's entries);
the rest are process-wide static caches with no classloader-scoped overload - clearing them on
every plugin teardown is safe (they are pure performance caches, rebuilt lazily on next access)
but is a minor, shared cost across all plugins, not specific to the one being removed.
CachedIntrospectionResults/ResourceBundle are the ones that actually pin the
leaving classloader.
Plugin-author contract - what this purge does NOT cover:
- No unmanaged threads/
ScheduledExecutorService- plugins must use a host-provided, plugin-scoped executor (no such executor exists yet in v1; noted as a follow-up). - No
ThreadLocalleft set on shared/pooled threads. - No direct host event-bus
@AsyncSubscribe- must usePluginEventSubscriptions, whose handlesPluginTeardowncloses automatically. - No JDBC driver registration, no JMX/MBean registration, no Logback appender registration from plugin code.
-
Method Summary
-
Method Details
-
purge
-