Class OsgiBundleFactory

java.lang.Object
com.atlassian.plugin.factories.AbstractPluginFactory
com.atlassian.plugin.osgi.factory.OsgiBundleFactory
All Implemented Interfaces:
PluginFactory

public final class OsgiBundleFactory extends AbstractPluginFactory
Plugin deployer that deploys OSGi bundles that don't contain a (spring) context instantiated by the plugin system
  • Constructor Details

  • Method Details

    • getDescriptorInputStream

      protected InputStream getDescriptorInputStream(PluginArtifact pluginArtifact)
      Specified by:
      getDescriptorInputStream in class AbstractPluginFactory
    • isValidPluginsVersion

      protected Predicate<Integer> isValidPluginsVersion()
      Specified by:
      isValidPluginsVersion in class AbstractPluginFactory
    • canCreate

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

      OsgiBundlePlugin wraps usual OSGi Bundle into Atlassian Plugin. Factory could create plugin for any bundle that is not Spring powered even for those has not atlassian-plugin.xml. Note that some parts of plugin descriptor, such as <component> or <component-import>, relies on IoC container in order to work, so without PluginContainerAccessor service exported it won't work and will throw an exception

      Specified by:
      canCreate in interface PluginFactory
      Overrides:
      canCreate in class AbstractPluginFactory
      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
    • create

      public Plugin create(PluginArtifact pluginArtifact, ModuleDescriptorFactory moduleDescriptorFactory)
      Create a plugin from the given artifact.
      Parameters:
      pluginArtifact - the plugin artifact containing the plugin.
      moduleDescriptorFactory - The factory for plugin modules.
      Returns:
      The instantiated and populated plugin, or an UnloadablePlugin if the plugin cannot be loaded.
      Since:
      2.2.0
    • createModule

      public ModuleDescriptor<?> createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory)