Class OsgiBundleFactory

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

public final class OsgiBundleFactory extends com.atlassian.plugin.factories.AbstractPluginFactory
Plugin deployer that deploys OSGi bundles that don't contain a (spring) context instantiated by the plugin system
  • Field Summary

    Fields inherited from class com.atlassian.plugin.factories.AbstractPluginFactory

    applications, descriptorParserFactory
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    OsgiBundleFactory(String pluginDescriptorFileName, OsgiContainerManager osgi)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    canCreate(com.atlassian.plugin.PluginArtifact pluginArtifact)
    Determines if this deployer can handle this artifact by looking for the plugin descriptor
    com.atlassian.plugin.Plugin
    create(com.atlassian.plugin.PluginArtifact pluginArtifact, com.atlassian.plugin.ModuleDescriptorFactory moduleDescriptorFactory)
    Create a plugin from the given artifact.
    com.atlassian.plugin.ModuleDescriptor<?>
    createModule(com.atlassian.plugin.Plugin plugin, com.atlassian.plugin.module.Element module, com.atlassian.plugin.ModuleDescriptorFactory moduleDescriptorFactory)
     
    protected InputStream
    getDescriptorInputStream(com.atlassian.plugin.PluginArtifact pluginArtifact)
     
    protected Predicate<Integer>
     

    Methods inherited from class com.atlassian.plugin.factories.AbstractPluginFactory

    getPluginKeyFromDescriptor, hasDescriptor

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • getDescriptorInputStream

      protected InputStream getDescriptorInputStream(com.atlassian.plugin.PluginArtifact pluginArtifact)
      Specified by:
      getDescriptorInputStream in class com.atlassian.plugin.factories.AbstractPluginFactory
    • isValidPluginsVersion

      protected Predicate<Integer> isValidPluginsVersion()
      Specified by:
      isValidPluginsVersion in class com.atlassian.plugin.factories.AbstractPluginFactory
    • canCreate

      public String canCreate(com.atlassian.plugin.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 com.atlassian.plugin.factories.PluginFactory
      Overrides:
      canCreate in class com.atlassian.plugin.factories.AbstractPluginFactory
      Parameters:
      pluginArtifact - The artifact to test
      Returns:
      The plugin key, null if it cannot load the plugin
      Throws:
      com.atlassian.plugin.PluginParseException - If there are exceptions parsing the plugin configuration
    • create

      public com.atlassian.plugin.Plugin create(com.atlassian.plugin.PluginArtifact pluginArtifact, com.atlassian.plugin.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 com.atlassian.plugin.ModuleDescriptor<?> createModule(com.atlassian.plugin.Plugin plugin, com.atlassian.plugin.module.Element module, com.atlassian.plugin.ModuleDescriptorFactory moduleDescriptorFactory)