com.atlassian.plugin.loaders
Class PermissionCheckingPluginLoader

java.lang.Object
  extended by com.google.common.collect.ForwardingObject
      extended by com.atlassian.plugin.loaders.PermissionCheckingPluginLoader
All Implemented Interfaces:
DynamicPluginLoader, PluginLoader

public final class PermissionCheckingPluginLoader
extends com.google.common.collect.ForwardingObject


Constructor Summary
PermissionCheckingPluginLoader(PluginLoader delegate)
           
 
Method Summary
 java.lang.String canLoad(PluginArtifact pluginArtifact)
          Determines if this loader can load the jar.
protected  PluginLoader delegate()
           
 boolean isDynamicPluginLoader()
           
 java.lang.Iterable<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
          Loads all plugins that can be installed in the plugin system.
 java.lang.Iterable<Plugin> loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
          Load all newly found plugins that can be installed in the plugin system.
 void removePlugin(Plugin plugin)
          Remove a specific plugin
 boolean supportsAddition()
           
 boolean supportsRemoval()
           
 
Methods inherited from class com.google.common.collect.ForwardingObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PermissionCheckingPluginLoader

public PermissionCheckingPluginLoader(PluginLoader delegate)
Method Detail

loadAllPlugins

public java.lang.Iterable<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
                                          throws PluginParseException
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
Throws:
PluginParseException - if any error occurred loading plugins

loadFoundPlugins

public java.lang.Iterable<Plugin> loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
                                            throws PluginParseException
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
Throws:
PluginParseException - if any error occurred loading plugins

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

delegate

protected final PluginLoader delegate()
Specified by:
delegate in class com.google.common.collect.ForwardingObject

supportsAddition

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

supportsRemoval

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

isDynamicPluginLoader

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

canLoad

public java.lang.String canLoad(PluginArtifact pluginArtifact)
                         throws PluginParseException
Description copied from interface: DynamicPluginLoader
Determines if this loader can load the jar.

Specified by:
canLoad in interface DynamicPluginLoader
Parameters:
pluginArtifact - The jar to test
Returns:
The plugin key, null if it cannot load the jar
Throws:
PluginParseException - If there are exceptions parsing the plugin configuration


Copyright © 2013 Atlassian. All Rights Reserved.