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
|
ModuleDescriptor<?> |
createModule(Plugin plugin,
org.dom4j.Element module,
ModuleDescriptorFactory moduleDescriptorFactory)
If this loader is capable of loading a plugin of the type passed, attempt to create a module descriptor.
|
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
|
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 eventpublic 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 loadedpublic ModuleDescriptor<?> createModule(Plugin plugin, org.dom4j.Element module, ModuleDescriptorFactory moduleDescriptorFactory)
PluginLoader
If capable, always return a ModuleDescriptor, even if it indicates a failure case. Caller is responsible for
handling exceptional ModuleDescriptor.
createModule in interface PluginLoaderplugin - that the module will be added tomodule - to createmoduleDescriptorFactory - basic factory, may be overriddenCopyright © 2019 Atlassian. All rights reserved.