Class DefaultPluginTransformer

java.lang.Object
com.atlassian.plugin.osgi.internal.factory.transform.DefaultPluginTransformer
All Implemented Interfaces:
PluginTransformer

public class DefaultPluginTransformer extends Object implements PluginTransformer
Default implementation of plugin transformation that uses stages to convert a plain JAR into an OSGi bundle.
  • Field Details

  • Constructor Details

    • DefaultPluginTransformer

      public DefaultPluginTransformer(OsgiPersistentCache cache, SystemExports systemExports, Set<Application> applications, String pluginDescriptorPath, OsgiContainerManager osgiContainerManager)
      Constructs a transformer with the default stages
      Parameters:
      cache - The OSGi cache configuration for transformed plugins
      systemExports - The packages the system bundle exports
      pluginDescriptorPath - The path to the plugin descriptor
      Since:
      2.2.0
    • DefaultPluginTransformer

      public DefaultPluginTransformer(OsgiPersistentCache cache, SystemExports systemExports, Set<Application> applications, String pluginDescriptorPath, OsgiContainerManager osgiContainerManager, List<TransformStage> stages)
      Constructs a transformer and its stages
      Parameters:
      cache - The OSGi cache configuration for transformed plugins
      systemExports - The packages the system bundle exports
      pluginDescriptorPath - The descriptor path
      stages - A set of stages
      Since:
      2.2.0
  • Method Details

    • getDefaultTransformStages

      public static ArrayList<TransformStage> getDefaultTransformStages()
      Gets the default list of transform stages performed by the transformer. Clients wishing to add stages to the transformation process should use this list as a template rather than creating their own from scratch.
    • transform

      public File transform(File pluginJar, List<HostComponentRegistration> regs)
      Transforms the file into an OSGi bundle
      Parameters:
      pluginJar - The plugin jar
      regs - The list of registered host components
      Returns:
      The new OSGi-enabled plugin jar
      Throws:
      PluginTransformationException - If anything goes wrong
    • transform

      public File transform(PluginArtifact pluginArtifact, List<HostComponentRegistration> regs)
      Transforms the file into an OSGi bundle
      Specified by:
      transform in interface PluginTransformer
      Parameters:
      pluginArtifact - The plugin artifact, usually a jar
      regs - The list of registered host components
      Returns:
      The new OSGi-enabled plugin jar
      Throws:
      PluginTransformationException - If anything goes wrong