com.atlassian.plugin.loaders
Class SinglePluginLoader
java.lang.Object
com.atlassian.plugin.loaders.SinglePluginLoader
- All Implemented Interfaces:
- PluginLoader
public class SinglePluginLoader
- extends java.lang.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.
Because the code which is run by these plugins must already be in the classpath (and
is therefore more trusted than an uploaded plugin), if the plugin is marked as a system
plugin in the descriptor file, it will actually be marked as a system plugin at runtime.
- See Also:
PluginLoader
,
ClassPathPluginLoader
,
DescriptorParser.isSystemPlugin()
Field Summary |
protected java.io.InputStream |
is
|
protected java.util.Collection<Plugin> |
plugins
|
protected java.lang.String |
resource
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
plugins
protected java.util.Collection<Plugin> plugins
resource
protected java.lang.String resource
is
protected java.io.InputStream is
SinglePluginLoader
public SinglePluginLoader(java.lang.String resource)
SinglePluginLoader
public SinglePluginLoader(java.io.InputStream is)
loadAllPlugins
public java.util.Collection<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
throws PluginParseException
- Specified by:
loadAllPlugins
in interface PluginLoader
- Throws:
PluginParseException
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 java.util.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 java.io.InputStream getSource()
Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.