Class ForwardingPluginLoader

java.lang.Object
com.atlassian.plugin.loaders.ForwardingPluginLoader
All Implemented Interfaces:
DiscardablePluginLoader, DynamicPluginLoader, PluginLoader
Direct Known Subclasses:
PermissionCheckingPluginLoader

public class ForwardingPluginLoader extends Object implements DynamicPluginLoader, DiscardablePluginLoader
  • Constructor Details

    • ForwardingPluginLoader

      public ForwardingPluginLoader(PluginLoader delegate)
  • Method Details

    • delegate

      protected final PluginLoader delegate()
    • loadAllPlugins

      public Iterable<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
      Description copied from interface: PluginLoader
      Loads all plugins that can be installed in the plugin system.
      Specified by:
      loadAllPlugins in interface PluginLoader
      Parameters:
      moduleDescriptorFactory - the factory for module descriptors
      Returns:
      the list of found plugins, may be empty
    • loadFoundPlugins

      public Iterable<Plugin> loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
      Description copied from interface: PluginLoader
      Load all newly found plugins that can be installed in the plugin system. Only plugins not previously loaded will be added.
      Specified by:
      loadFoundPlugins in interface PluginLoader
      Parameters:
      moduleDescriptorFactory - the factory for module descriptors
      Returns:
      a list of newly discovered plugins since the last time plugins were loaded
    • supportsAddition

      public boolean supportsAddition()
      Specified by:
      supportsAddition in interface PluginLoader
      Returns:
      true if this PluginLoader tracks whether or not plugins are added to it.
    • supportsRemoval

      public boolean supportsRemoval()
      Specified by:
      supportsRemoval in interface PluginLoader
      Returns:
      true if this PluginLoader tracks whether or not plugins are removed from it.
    • removePlugin

      public void removePlugin(Plugin plugin)
      Description copied from interface: PluginLoader
      Remove a specific plugin
      Specified by:
      removePlugin in interface PluginLoader
    • isDynamicPluginLoader

      public boolean isDynamicPluginLoader()
      Specified by:
      isDynamicPluginLoader in interface PluginLoader
      Returns:
      true if this plugin loader can load plugins dynamically
    • createModule

      public ModuleDescriptor<?> createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory)
      Description copied from interface: PluginLoader
      If this loader 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.

      Specified by:
      createModule in interface PluginLoader
      Parameters:
      plugin - that the module will be added to
      module - to create
      moduleDescriptorFactory - basic factory, may be overridden
      Returns:
      null if incapable of creating
    • canLoad

      public String canLoad(PluginArtifact pluginArtifact)
      Description copied from interface: DynamicPluginLoader
      Determines if this loader can load the jar.
      Specified by:
      canLoad in interface DynamicPluginLoader
      Parameters:
      pluginArtifact - The jar to test
      Returns:
      The plugin key, null if it cannot load the jar
    • discardPlugin

      public void discardPlugin(Plugin plugin)
      Description copied from interface: DiscardablePluginLoader
      Notify the PluginLoader that the system will not be loading the given plugin. This instructs the PluginLoader to discard any resources associated with the Plugin.
      Specified by:
      discardPlugin in interface DiscardablePluginLoader
    • toString

      public String toString()
      Overrides:
      toString in class Object