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
 Collection<Plugin> addFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
           
protected  StaticPlugin getNewPlugin()
           
protected  InputStream getSource()
           
 Collection<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
           
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 Collection<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
Specified by:
loadAllPlugins in interface PluginLoader

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.

addFoundPlugins

public Collection<Plugin> addFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
Specified by:
addFoundPlugins in interface PluginLoader
Returns:
a collection of discovered plugins which have now been loaded by this PluginLoader

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

loadPlugin

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

getNewPlugin

protected StaticPlugin getNewPlugin()

getSource

protected InputStream getSource()


Copyright © 2010 Atlassian. All Rights Reserved.