public class

ScanningPluginLoader

extends Object
implements DynamicPluginLoader
java.lang.Object
   ↳ com.atlassian.plugin.loaders.ScanningPluginLoader
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

Plugin loader that delegates the detection of plugins to a Scanner instance. The scanner may monitor the contents of a directory on disk, a database, or any other place plugins may be hidden.

Summary

Fields
protected final PluginArtifactFactory pluginArtifactFactory
protected final List<PluginFactory> pluginFactories
protected final Map<DeploymentUnitPlugin> plugins
protected final Scanner scanner
Public Constructors
ScanningPluginLoader(Scanner scanner, List<PluginFactory> pluginFactories, PluginEventManager pluginEventManager)
Constructor that provides a default plugin artifact factory
ScanningPluginLoader(Scanner scanner, List<PluginFactory> pluginFactories, PluginArtifactFactory pluginArtifactFactory, PluginEventManager pluginEventManager)
Construct a new scanning plugin loader with no default values
Public Methods
Collection<Plugin> addFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
String canLoad(PluginArtifact pluginArtifact)
Determines if the artifact can be loaded by any of its deployers
Collection<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
void onShutdown(PluginFrameworkShutdownEvent event)
Called during plugin framework shutdown
void removePlugin(Plugin plugin)
Remove a specific plugin
void shutDown()
This method is deprecated. Since 2.0.0, shutdown will automatically occur when the plugin framework is shutdown
boolean supportsAddition()
boolean supportsRemoval()
Protected Methods
Plugin deployPluginFromUnit(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)
Plugin postProcess(Plugin plugin)
Template method that can be used by a specific PluginLoader to add information to a Plugin after it has been loaded.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugin.loaders.DynamicPluginLoader
From interface com.atlassian.plugin.loaders.PluginLoader

Fields

protected final PluginArtifactFactory pluginArtifactFactory

protected final List<PluginFactory> pluginFactories

protected final Map<DeploymentUnitPlugin> plugins

protected final Scanner scanner

Public Constructors

public ScanningPluginLoader (Scanner scanner, List<PluginFactory> pluginFactories, PluginEventManager pluginEventManager)

Constructor that provides a default plugin artifact factory

Parameters
scanner The scanner to use to detect new plugins
pluginFactories The deployers that will handle turning an artifact into a plugin
pluginEventManager The event manager, used for listening for shutdown events

public ScanningPluginLoader (Scanner scanner, List<PluginFactory> pluginFactories, PluginArtifactFactory pluginArtifactFactory, PluginEventManager pluginEventManager)

Construct a new scanning plugin loader with no default values

Parameters
scanner The scanner to use to detect new plugins
pluginFactories The deployers that will handle turning an artifact into a plugin
pluginArtifactFactory used to create new plugin artifacts from an URL
pluginEventManager The event manager, used for listening for shutdown events

Public Methods

public Collection<Plugin> addFoundPlugins (ModuleDescriptorFactory moduleDescriptorFactory)

Returns
  • all plugins, now loaded by the pluginLoader, which have been discovered and added since the last time a check was performed.

public String canLoad (PluginArtifact pluginArtifact)

Determines if the artifact can be loaded by any of its deployers

Parameters
pluginArtifact The artifact to test
Returns
  • True if this artifact can be loaded by this loader

public Collection<Plugin> loadAllPlugins (ModuleDescriptorFactory moduleDescriptorFactory)

public void onShutdown (PluginFrameworkShutdownEvent event)

Called during plugin framework shutdown

Parameters
event The shutdown event

public void removePlugin (Plugin plugin)

Remove a specific plugin

Parameters
plugin - the plugin to remove
Throws
PluginException representing the reason for failure.

public void shutDown ()

This method is deprecated.
Since 2.0.0, shutdown will automatically occur when the plugin framework is shutdown

public boolean supportsAddition ()

public boolean supportsRemoval ()

Protected Methods

protected Plugin deployPluginFromUnit (DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)

protected Plugin postProcess (Plugin plugin)

Template method that can be used by a specific PluginLoader to add information to a Plugin after it has been loaded.

Parameters
plugin a plugin that has been loaded