Package com.atlassian.plugin.loaders
Class ForwardingPluginLoader
java.lang.Object
com.atlassian.plugin.loaders.ForwardingPluginLoader
- All Implemented Interfaces:
DiscardablePluginLoader,DynamicPluginLoader,PluginLoader
- Direct Known Subclasses:
PermissionCheckingPluginLoader
public class ForwardingPluginLoader
extends Object
implements DynamicPluginLoader, DiscardablePluginLoader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncanLoad(PluginArtifact pluginArtifact) Determines if this loader can load the jar.createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory) If this loader is capable of loading a plugin of the type passed, attempt to create a module descriptor.protected final PluginLoaderdelegate()voiddiscardPlugin(Plugin plugin) Notify the PluginLoader that the system will not be loading the given plugin.booleanloadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory) Loads all plugins that can be installed in the plugin system.loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory) Load all newly found plugins that can be installed in the plugin system.voidremovePlugin(Plugin plugin) Remove a specific pluginbooleanbooleantoString()
-
Constructor Details
-
ForwardingPluginLoader
-
-
Method Details
-
delegate
-
loadAllPlugins
Description copied from interface:PluginLoaderLoads all plugins that can be installed in the plugin system.- Specified by:
loadAllPluginsin interfacePluginLoader- Parameters:
moduleDescriptorFactory- the factory for module descriptors- Returns:
- the list of found plugins, may be empty
-
loadFoundPlugins
Description copied from interface:PluginLoaderLoad all newly found plugins that can be installed in the plugin system. Only plugins not previously loaded will be added.- Specified by:
loadFoundPluginsin interfacePluginLoader- Parameters:
moduleDescriptorFactory- the factory for module descriptors- Returns:
- a list of newly discovered plugins since the last time plugins were loaded
-
supportsAddition
public boolean supportsAddition()- Specified by:
supportsAdditionin interfacePluginLoader- Returns:
- true if this PluginLoader tracks whether or not plugins are added to it.
-
supportsRemoval
public boolean supportsRemoval()- Specified by:
supportsRemovalin interfacePluginLoader- Returns:
- true if this PluginLoader tracks whether or not plugins are removed from it.
-
removePlugin
Description copied from interface:PluginLoaderRemove a specific plugin- Specified by:
removePluginin interfacePluginLoader
-
isDynamicPluginLoader
public boolean isDynamicPluginLoader()- Specified by:
isDynamicPluginLoaderin interfacePluginLoader- Returns:
trueif this plugin loader can load plugins dynamically
-
createModule
public ModuleDescriptor<?> createModule(Plugin plugin, Element module, ModuleDescriptorFactory moduleDescriptorFactory) Description copied from interface:PluginLoaderIf this loader is capable of loading a plugin of the type passed, attempt to create a module descriptor. Add that module descriptor to the plugin.If capable, always return a ModuleDescriptor, even if it indicates a failure case. Caller is responsible for handling exceptional
ModuleDescriptor.- Specified by:
createModulein interfacePluginLoader- Parameters:
plugin- that the module will be added tomodule- to createmoduleDescriptorFactory- basic factory, may be overridden- Returns:
- null if incapable of creating
-
canLoad
Description copied from interface:DynamicPluginLoaderDetermines if this loader can load the jar.- Specified by:
canLoadin interfaceDynamicPluginLoader- Parameters:
pluginArtifact- The jar to test- Returns:
- The plugin key, null if it cannot load the jar
-
discardPlugin
Description copied from interface:DiscardablePluginLoaderNotify the PluginLoader that the system will not be loading the given plugin. This instructs the PluginLoader to discard any resources associated with the Plugin.- Specified by:
discardPluginin interfaceDiscardablePluginLoader
-
toString
-