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 java.lang.Object
implements PluginTransformer

Default implementation of plugin transformation that uses stages to convert a plain JAR into an OSGi bundle.


Constructor Summary
DefaultPluginTransformer(OsgiPersistentCache cache, SystemExports systemExports, java.util.Set<java.lang.String> applicationKeys, java.lang.String pluginDescriptorPath, OsgiContainerManager osgiContainerManager)
          Constructs a transformer with the default stages
DefaultPluginTransformer(OsgiPersistentCache cache, SystemExports systemExports, java.util.Set<java.lang.String> applicationKeys, java.lang.String pluginDescriptorPath, OsgiContainerManager osgiContainerManager, java.util.List<TransformStage> stages)
          Constructs a transformer and its stages
 
Method Summary
 java.io.File transform(java.io.File pluginJar, java.util.List<HostComponentRegistration> regs)
          Transforms the file into an OSGi bundle
 java.io.File transform(PluginArtifact pluginArtifact, java.util.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
 

Constructor Detail

DefaultPluginTransformer

public DefaultPluginTransformer(OsgiPersistentCache cache,
                                SystemExports systemExports,
                                java.util.Set<java.lang.String> applicationKeys,
                                java.lang.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,
                                java.util.Set<java.lang.String> applicationKeys,
                                java.lang.String pluginDescriptorPath,
                                OsgiContainerManager osgiContainerManager,
                                java.util.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

transform

public java.io.File transform(java.io.File pluginJar,
                              java.util.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 java.io.File transform(PluginArtifact pluginArtifact,
                              java.util.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 © 2010 Atlassian. All Rights Reserved.