com.atlassian.plugin.loaders
Class SinglePluginLoader

java.lang.Object
  extended by com.atlassian.plugin.loaders.SinglePluginLoader
All Implemented Interfaces:
PluginLoader

public class SinglePluginLoader
extends Object
implements PluginLoader

Loads a single plugin from the descriptor provided, which can either be an InputStream or a resource on the classpath. The classes used by the plugin must already be available on the classpath because this plugin loader does not load any classes.

See Also:
PluginLoader, ClassPathPluginLoader

Field Summary
protected  Collection<Plugin> plugins
           
 
Constructor Summary
SinglePluginLoader(InputStream is)
          Deprecated. since 2.2 use the version that passes a URL instead. Not used by the plugins system.
SinglePluginLoader(String resource)
           
SinglePluginLoader(URL url)
           
 
Method Summary
protected  StaticPlugin getNewPlugin()
           
protected  InputStream getSource()
           
 boolean isDynamicPluginLoader()
           
 Iterable<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
          Loads all plugins that can be installed in the plugin system.
 Iterable<Plugin> loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
          Load all newly found plugins that can be installed in the plugin system.
protected  Plugin loadPlugin(ModuleDescriptorFactory moduleDescriptorFactory)
           
 void removePlugin(Plugin plugin)
          Remove a specific plugin
 boolean supportsAddition()
           
 boolean supportsRemoval()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

plugins

protected Collection<Plugin> plugins
Constructor Detail

SinglePluginLoader

public SinglePluginLoader(String resource)

SinglePluginLoader

public SinglePluginLoader(URL url)

SinglePluginLoader

public SinglePluginLoader(InputStream is)
Deprecated. since 2.2 use the version that passes a URL instead. Not used by the plugins system.

Method Detail

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

supportsRemoval

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

supportsAddition

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

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

removePlugin

public void removePlugin(Plugin plugin)
                  throws PluginException
Description copied from interface: PluginLoader
Remove a specific plugin

Specified by:
removePlugin in interface PluginLoader
Throws:
PluginException

isDynamicPluginLoader

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

loadPlugin

protected Plugin loadPlugin(ModuleDescriptorFactory moduleDescriptorFactory)
                     throws PluginParseException
Throws:
PluginParseException

getNewPlugin

protected StaticPlugin getNewPlugin()

getSource

protected InputStream getSource()


Copyright © 2015 Atlassian. All rights reserved.