View Javadoc

1   package com.atlassian.plugin.loaders;
2   
3   import com.atlassian.plugin.ModuleDescriptorFactory;
4   import com.atlassian.plugin.Plugin;
5   import com.atlassian.plugin.PluginException;
6   import com.atlassian.plugin.PluginParseException;
7   
8   import java.util.Collection;
9   
10  /**
11   * Handles loading and unloading plugin artifacts from a location
12   */
13  public interface PluginLoader
14  {
15      Collection<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory) throws PluginParseException;
16  
17      /**
18       * @return true if this PluginLoader tracks whether or not plugins are added to it.
19       */
20      boolean supportsAddition();
21  
22      /**
23       * @return true if this PluginLoader tracks whether or not plugins are removed from it.
24       */
25      boolean supportsRemoval();
26  
27      /**
28       * @return a collection of discovered plugins which have now been loaded by this pluginloader
29       */
30      Collection<Plugin> addFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory) throws PluginParseException;
31  
32      /**
33       * Remove a specific plugin
34       */
35      void removePlugin(Plugin plugin) throws PluginException;
36  
37  }