public class ScanningPluginLoader extends java.lang.Object implements DynamicPluginLoader
| Modifier and Type | Field and Description |
|---|---|
protected PluginArtifactFactory |
pluginArtifactFactory |
protected java.util.List<PluginFactory> |
pluginFactories |
protected java.util.Map<DeploymentUnit,Plugin> |
plugins |
protected Scanner |
scanner |
| Constructor and Description |
|---|
ScanningPluginLoader(Scanner scanner,
java.util.List<PluginFactory> pluginFactories,
PluginArtifactFactory pluginArtifactFactory,
PluginEventManager pluginEventManager)
Construct a new scanning plugin loader with no default values
|
ScanningPluginLoader(Scanner scanner,
java.util.List<PluginFactory> pluginFactories,
PluginEventManager pluginEventManager)
Constructor that provides a default plugin artifact factory
`
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
canLoad(PluginArtifact pluginArtifact)
Determines if the artifact can be loaded by any of its deployers
|
protected Plugin |
deployPluginFromUnit(DeploymentUnit deploymentUnit,
ModuleDescriptorFactory moduleDescriptorFactory) |
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 |
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 java.util.Map<DeploymentUnit,Plugin> plugins
protected final java.util.List<PluginFactory> pluginFactories
protected final PluginArtifactFactory pluginArtifactFactory
public ScanningPluginLoader(Scanner scanner, java.util.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, java.util.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 java.lang.Iterable<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
PluginLoaderloadAllPlugins in interface PluginLoadermoduleDescriptorFactory - the factory for module descriptorspublic java.lang.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 java.lang.String canLoad(PluginArtifact pluginArtifact) throws PluginParseException
canLoad in interface DynamicPluginLoaderpluginArtifact - The artifact to testPluginParseExceptionprotected Plugin postProcess(Plugin plugin)
PluginLoader to
add information to a Plugin after it has been loaded.plugin - a plugin that has been loadedCopyright © 2013 Atlassian. All Rights Reserved.