Package com.atlassian.plugin.factories
Interface PluginFactory
public interface PluginFactory
Creates the plugin artifact and deploys it into the appropriate plugin management system
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptioncanCreate(PluginArtifact pluginArtifact) Determines if this factory can handle this artifact.create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory) Deploys the plugin artifact by instantiating the plugin and configuring it.createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory) If this factory is capable of loading a plugin of the type passed, attempt to create a module descriptor.
-
Method Details
-
canCreate
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
Deploys the plugin artifact by instantiating the plugin and configuring it. Should only be called if the respectivecanCreate(PluginArtifact)call returned the plugin key- Parameters:
pluginArtifact- the plugin artifact to deploymoduleDescriptorFactory- 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
-
createModule
ModuleDescriptor<?> createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory) If this factory is capable of loading a plugin of the type passed, attempt to create a module descriptor. Add that module descriptor to the plugin.If capable, always return a ModuleDescriptor, even if it indicates a failure case. Caller is responsible for handling exceptional
ModuleDescriptor.Implementors should use
(plugin instanceof <plugin-class>)to determine their capability; subclasses of implementors should override this if special handling is required.- Parameters:
plugin- that the module will be a member ofmodule- to createmoduleDescriptorFactory- basic factory, may be overridden- Returns:
- null plugin was not created by this PluginFactory
- Since:
- 4.0.0
-