com.atlassian.plugin.factories
Class LegacyDynamicPluginFactory

java.lang.Object
  extended by com.atlassian.plugin.factories.LegacyDynamicPluginFactory
All Implemented Interfaces:
PluginFactory

public class LegacyDynamicPluginFactory
extends java.lang.Object
implements PluginFactory

Deploys version 1.0 plugins into the legacy custom classloader structure that gives each plugin its own classloader.

Since:
2.0.0

Constructor Summary
LegacyDynamicPluginFactory(java.lang.String pluginDescriptorFileName)
           
LegacyDynamicPluginFactory(java.lang.String pluginDescriptorFileName, java.io.File tempDirectory)
           
 
Method Summary
 java.lang.String canCreate(PluginArtifact pluginArtifact)
          Determines if this deployer can handle this artifact by looking for the plugin descriptor
 Plugin create(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)
          Deprecated. Since 2.2.0, use create(PluginArtifact,ModuleDescriptorFactory) instead
 Plugin create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory)
          Deploys the plugin artifact
protected  Plugin createPlugin(DeploymentUnit deploymentUnit, PluginClassLoader loader)
          Deprecated. Since 2.2.0, use createPlugin(PluginArtifact,PluginClassLoader) instead
protected  Plugin createPlugin(PluginArtifact pluginArtifact, PluginClassLoader loader)
          Creates the plugin.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LegacyDynamicPluginFactory

public LegacyDynamicPluginFactory(java.lang.String pluginDescriptorFileName)

LegacyDynamicPluginFactory

public LegacyDynamicPluginFactory(java.lang.String pluginDescriptorFileName,
                                  java.io.File tempDirectory)
Method Detail

create

public Plugin create(DeploymentUnit deploymentUnit,
                     ModuleDescriptorFactory moduleDescriptorFactory)
              throws PluginParseException
Deprecated. Since 2.2.0, use create(PluginArtifact,ModuleDescriptorFactory) instead

Description copied from interface: PluginFactory
Deploys the deployment unit by instantiating the plugin and configuring it. Should only be called if the respective PluginFactory.canCreate(PluginArtifact) call returned the plugin key

Specified by:
create in interface PluginFactory
Parameters:
deploymentUnit - the unit to deploy
moduleDescriptorFactory - the factory for the module descriptors
Returns:
the plugin loaded from the deployment unit, or an UnloadablePlugin instance if loading fails.
Throws:
PluginParseException - if the plugin could not be parsed

create

public Plugin create(PluginArtifact pluginArtifact,
                     ModuleDescriptorFactory moduleDescriptorFactory)
              throws PluginParseException
Deploys the plugin artifact

Specified by:
create in interface PluginFactory
Parameters:
pluginArtifact - the plugin artifact to deploy
moduleDescriptorFactory - The factory for plugin modules
Returns:
The instantiated and populated plugin
Throws:
PluginParseException - If the descriptor cannot be parsed
Since:
2.2.0

createPlugin

protected Plugin createPlugin(DeploymentUnit deploymentUnit,
                              PluginClassLoader loader)
Deprecated. Since 2.2.0, use createPlugin(PluginArtifact,PluginClassLoader) instead


createPlugin

protected Plugin createPlugin(PluginArtifact pluginArtifact,
                              PluginClassLoader loader)
Creates the plugin. Override to use a different Plugin class

Parameters:
pluginArtifact - The plugin artifact
loader - The plugin loader
Returns:
The plugin instance
Since:
2.2.0

canCreate

public java.lang.String canCreate(PluginArtifact pluginArtifact)
                           throws PluginParseException
Determines if this deployer can handle this artifact by looking for the plugin descriptor

Specified by:
canCreate in interface PluginFactory
Parameters:
pluginArtifact - The artifact to test
Returns:
The plugin key, null if it cannot load the plugin
Throws:
PluginParseException - If there are exceptions parsing the plugin configuration


Copyright © 2010 Atlassian. All Rights Reserved.