public class ScanningPluginLoader extends Object implements DynamicPluginLoader, DiscardablePluginLoader
| Modifier and Type | Field and Description |
|---|---|
protected PluginArtifactFactory |
pluginArtifactFactory |
protected List<PluginFactory> |
pluginFactories |
protected Map<DeploymentUnit,Plugin> |
plugins |
protected Scanner |
scanner |
| Constructor and Description |
|---|
ScanningPluginLoader(Scanner scanner,
List<PluginFactory> pluginFactories,
PluginArtifactFactory pluginArtifactFactory,
PluginEventManager pluginEventManager)
Construct a new scanning plugin loader with no default values
|
ScanningPluginLoader(Scanner scanner,
List<PluginFactory> pluginFactories,
PluginEventManager pluginEventManager)
Constructor that provides a default plugin artifact factory
`
|
| Modifier and Type | Method and Description |
|---|---|
String |
canLoad(PluginArtifact pluginArtifact)
Determines if the artifact can be loaded by any of its deployers
|
protected Plugin |
deployPluginFromUnit(DeploymentUnit deploymentUnit,
ModuleDescriptorFactory moduleDescriptorFactory) |
void |
discardPlugin(Plugin plugin)
Notify the PluginLoader that the system will not be loading the given plugin.
|
boolean |
isDynamicPluginLoader() |
Iterable<Plugin> |
loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
Loads all plugins that can be installed in the plugin system.
|
Iterable<Plugin> |
loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
Load all newly found plugins that can be installed in the plugin system.
|
void |
onShutdown(PluginFrameworkShutdownEvent event)
Called during plugin framework shutdown
|
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. |
void |
removePlugin(Plugin plugin)
Remove a specific plugin
|
void |
shutDown()
Deprecated.
Since 2.0.0, shutdown will automatically occur when the plugin framework is shutdown
|
boolean |
supportsAddition() |
boolean |
supportsRemoval() |
protected final Scanner scanner
protected final Map<DeploymentUnit,Plugin> plugins
protected final List<PluginFactory> pluginFactories
protected final PluginArtifactFactory pluginArtifactFactory
public ScanningPluginLoader(Scanner scanner, List<PluginFactory> pluginFactories, PluginEventManager pluginEventManager)
scanner - The scanner to use to detect new pluginspluginFactories - The deployers that will handle turning an artifact into a pluginpluginEventManager - The event manager, used for listening for shutdown eventspublic ScanningPluginLoader(Scanner scanner, List<PluginFactory> pluginFactories, PluginArtifactFactory pluginArtifactFactory, PluginEventManager pluginEventManager)
scanner - The scanner to use to detect new pluginspluginFactories - The deployers that will handle turning an artifact into a pluginpluginArtifactFactory - used to create new plugin artifacts from an URLpluginEventManager - The event manager, used for listening for shutdown eventspublic Iterable<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
PluginLoaderloadAllPlugins in interface PluginLoadermoduleDescriptorFactory - the factory for module descriptorspublic Iterable<Plugin> loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory) throws PluginParseException
PluginLoaderloadFoundPlugins in interface PluginLoadermoduleDescriptorFactory - the factory for module descriptorsPluginParseException - if any error occurred loading pluginspublic boolean supportsRemoval()
supportsRemoval in interface PluginLoaderpublic boolean supportsAddition()
supportsAddition in interface PluginLoaderprotected final Plugin deployPluginFromUnit(DeploymentUnit deploymentUnit, ModuleDescriptorFactory moduleDescriptorFactory)
public void removePlugin(Plugin plugin) throws PluginException
PluginLoaderremovePlugin in interface PluginLoaderplugin - - the plugin to removePluginException - representing the reason for failure.public void onShutdown(PluginFrameworkShutdownEvent event)
event - The shutdown event@Deprecated public void shutDown()
public boolean isDynamicPluginLoader()
isDynamicPluginLoader in interface PluginLoadertrue if this plugin loader can load plugins dynamicallypublic String canLoad(PluginArtifact pluginArtifact) throws PluginParseException
canLoad in interface DynamicPluginLoaderpluginArtifact - The artifact to testPluginParseExceptionpublic void discardPlugin(Plugin plugin)
DiscardablePluginLoaderdiscardPlugin in interface DiscardablePluginLoaderprotected Plugin postProcess(Plugin plugin)
PluginLoader to
add information to a Plugin after it has been loaded.plugin - a plugin that has been loadedCopyright © 2014 Atlassian. All rights reserved.