Class PluginContextFactory

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

public final class PluginContextFactory extends Object
Builds a plugin's child AnnotationConfigApplicationContext from a PluginManifest + Bundle, parented to the curated PluginApiParentContext.
  • Method Details

    • build

      public static PluginRuntime build(org.osgi.framework.Bundle bundle, PluginManifest manifest, org.springframework.context.support.GenericApplicationContext parent)
      Throws:
      InvalidPluginManifestException - if manifest.pluginContextClassName() cannot be loaded from the bundle's own classloader - thrown before any context exists, so there is nothing to route through PluginTeardown for this failure.
      PluginContextBuildException - if the plugin's @Configuration class fails to refresh, or extension-point registration itself fails - carries the partially-built PluginRuntime so the caller tears it down via PluginTeardown exactly like a normal removal, instead of this method closing it internally.