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 a collection of discovered plugins which have now been loaded by this PluginLoader
19       */
20      Collection<Plugin> addFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory) throws PluginParseException;
21  
22      /**
23       * @return true if this PluginLoader tracks whether or not plugins are added to it.
24       */
25      boolean supportsAddition();
26  
27      /**
28       * @return true if this PluginLoader tracks whether or not plugins are removed from it.
29       */
30      boolean supportsRemoval();
31  
32      /**
33       * Remove a specific plugin
34       */
35      void removePlugin(Plugin plugin) throws PluginException;
36  }