com.atlassian.plugin.osgi.factory
Class UnloadableStaticPluginFactory

java.lang.Object
  extended by com.atlassian.plugin.osgi.factory.UnloadableStaticPluginFactory
All Implemented Interfaces:
PluginFactory

public class UnloadableStaticPluginFactory
extends Object
implements PluginFactory

Creates unloadable plugins from static plugins. Used to handle when a static plugin (version 1) is deployed to a directory that only accepts OSGi plugins. This should be placed last in the chain of plugin factories and only if LegacyDynamicPluginFactory is not used.

Since:
2.2.3

Constructor Summary
UnloadableStaticPluginFactory(String pluginDescriptorFileName)
           
 
Method Summary
 String canCreate(PluginArtifact pluginArtifact)
          Determines if this factory can handle this artifact.
 Plugin create(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)
          Deprecated. Since 2.2.0, use create(PluginArtifact,ModuleDescriptorFactory) instead
 Plugin create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory)
          Creates an unloadable plugin
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnloadableStaticPluginFactory

public UnloadableStaticPluginFactory(String pluginDescriptorFileName)
Method Detail

canCreate

public String canCreate(PluginArtifact pluginArtifact)
                 throws PluginParseException
Description copied from interface: PluginFactory
Determines if this factory can handle this artifact.

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 when the deployer should have been able to deploy the plugin

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
Creates an unloadable plugin

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


Copyright © 2011 Atlassian. All Rights Reserved.