com.atlassian.plugin.factories
Interface PluginFactory

All Known Implementing Classes:
LegacyDynamicPluginFactory, OsgiBundleFactory, OsgiPluginFactory, UnloadableStaticPluginFactory, XmlDynamicPluginFactory

public interface PluginFactory

Creates the plugin artifact and deploys it into the appropriate plugin management system

Since:
2.0.0

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)
          Deploys the plugin artifact by instantiating the plugin and configuring it.
 

Method Detail

canCreate

String canCreate(PluginArtifact pluginArtifact)
                 throws PluginParseException
Determines if this factory can handle this artifact.

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

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

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

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

Plugin create(PluginArtifact pluginArtifact,
              ModuleDescriptorFactory moduleDescriptorFactory)
              throws PluginParseException
Deploys the plugin artifact by instantiating the plugin and configuring it. Should only be called if the respective canCreate(PluginArtifact) call returned the plugin key

Parameters:
pluginArtifact - the plugin artifact to deploy
moduleDescriptorFactory - the factory for the module descriptors
Returns:
the plugin loaded from the plugin artifact, or an UnloadablePlugin instance if loading fails.
Throws:
PluginParseException - if the plugin could not be parsed
Since:
2.2.0


Copyright © 2011 Atlassian. All Rights Reserved.