public class

UnloadableStaticPluginFactory

extends Object
implements PluginFactory
java.lang.Object
   ↳ com.atlassian.plugin.osgi.factory.UnloadableStaticPluginFactory

Class Overview

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.

Summary

Public Constructors
UnloadableStaticPluginFactory(String pluginDescriptorFileName)
Public Methods
String canCreate(PluginArtifact pluginArtifact)
Determines if this factory can handle this artifact.
Plugin create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory)
Creates an unloadable plugin
Plugin create(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)
This method is deprecated. Since 2.2.0, use create(PluginArtifact, ModuleDescriptorFactory) instead
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugin.factories.PluginFactory

Public Constructors

public UnloadableStaticPluginFactory (String pluginDescriptorFileName)

Public Methods

public String canCreate (PluginArtifact pluginArtifact)

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

public Plugin create (PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory)

Creates an unloadable plugin

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

public Plugin create (DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)

This method is 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.