com.atlassian.plugin.osgi.factory.transform
Class DefaultPluginTransformer

java.lang.Object
  extended by com.atlassian.plugin.osgi.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 Summary
static String TRANSFORM_COMPRESSION_LEVEL
           
 
Constructor Summary
DefaultPluginTransformer(OsgiPersistentCache cache, SystemExports systemExports, Set<Application> applications, String pluginDescriptorPath, OsgiContainerManager osgiContainerManager)
          Constructs a transformer with the default stages
DefaultPluginTransformer(OsgiPersistentCache cache, SystemExports systemExports, Set<Application> applications, String pluginDescriptorPath, OsgiContainerManager osgiContainerManager, List<TransformStage> stages)
          Constructs a transformer and its stages
 
Method Summary
static ArrayList<TransformStage> getDefaultTransformStages()
          Gets the default list of transform stages performed by the transformer.
 File transform(File pluginJar, List<HostComponentRegistration> regs)
          Transforms the file into an OSGi bundle
 File transform(PluginArtifact pluginArtifact, List<HostComponentRegistration> regs)
          Transforms the file into an OSGi bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSFORM_COMPRESSION_LEVEL

public static final String TRANSFORM_COMPRESSION_LEVEL
See Also:
Constant Field Values
Constructor Detail

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 Detail

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)
               throws PluginTransformationException
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)
               throws PluginTransformationException
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


Copyright © 2014 Atlassian. All rights reserved.