Class RemotablePluginFactory

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

public final class RemotablePluginFactory extends com.atlassian.plugin.factories.AbstractPluginFactory
Plugin loader that starts an OSGi container and loads plugins into it, wrapped as OSGi bundles. Supports
  • Dynamic loading of module descriptors via OSGi services
  • Delayed enabling until the plugin container is active
  • XML or Jar manifest configuration
Since:
3.0
  • Field Summary

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

    applications, descriptorParserFactory
  • Constructor Summary

    Constructors
    Constructor
    Description
    RemotablePluginFactory(String pluginDescriptorFileName, Set<com.atlassian.plugin.Application> applications, OsgiContainerManager osgi, com.atlassian.plugin.event.PluginEventManager pluginEventManager)
    Constructor for implementations that want to override the DefaultPluginTransformer with a custom implementation
  • Method Summary

    Modifier and Type
    Method
    Description
    com.atlassian.plugin.Plugin
    create(com.atlassian.plugin.PluginArtifact pluginArtifact, com.atlassian.plugin.ModuleDescriptorFactory moduleDescriptorFactory)
    Creates the plugin
    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

    canCreate, getPluginKeyFromDescriptor, hasDescriptor

    Methods inherited from class java.lang.Object

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

    • RemotablePluginFactory

      public RemotablePluginFactory(String pluginDescriptorFileName, Set<com.atlassian.plugin.Application> applications, OsgiContainerManager osgi, com.atlassian.plugin.event.PluginEventManager pluginEventManager)
      Constructor for implementations that want to override the DefaultPluginTransformer with a custom implementation
  • 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
    • create

      public com.atlassian.plugin.Plugin create(com.atlassian.plugin.PluginArtifact pluginArtifact, com.atlassian.plugin.ModuleDescriptorFactory moduleDescriptorFactory)
      Creates the plugin
      Parameters:
      pluginArtifact - the plugin artifact to deploy
      moduleDescriptorFactory - The factory for plugin modules
      Returns:
      The instantiated and populated plugin
      Throws:
      com.atlassian.plugin.PluginParseException - If the descriptor cannot be parsed
      IllegalArgumentException - If the plugin descriptor isn't found, and the plugin key and bundle version aren't specified in the manifest
    • createModule

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