|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.plugin.loaders.ScanningPluginLoader
public class ScanningPluginLoader
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.
| Field Summary | |
|---|---|
protected PluginArtifactFactory |
pluginArtifactFactory
|
protected java.util.List<PluginFactory> |
pluginFactories
|
protected java.util.Map<DeploymentUnit,Plugin> |
plugins
|
protected Scanner |
scanner
|
| Constructor Summary | |
|---|---|
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 ` |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Scanner scanner
protected final java.util.Map<DeploymentUnit,Plugin> plugins
protected final java.util.List<PluginFactory> pluginFactories
protected final PluginArtifactFactory pluginArtifactFactory
| Constructor Detail |
|---|
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 events
public 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 events| Method Detail |
|---|
public java.lang.Iterable<Plugin> loadAllPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
PluginLoader
loadAllPlugins in interface PluginLoadermoduleDescriptorFactory - the factory for module descriptors
public java.lang.Iterable<Plugin> loadFoundPlugins(ModuleDescriptorFactory moduleDescriptorFactory)
throws PluginParseException
PluginLoader
loadFoundPlugins in interface PluginLoadermoduleDescriptorFactory - the factory for module descriptors
PluginParseException - if any error occurred loading pluginspublic boolean supportsRemoval()
supportsRemoval in interface PluginLoaderpublic boolean supportsAddition()
supportsAddition in interface PluginLoader
protected final Plugin deployPluginFromUnit(DeploymentUnit deploymentUnit,
ModuleDescriptorFactory moduleDescriptorFactory)
public void removePlugin(Plugin plugin)
throws PluginException
PluginLoader
removePlugin in interface PluginLoaderplugin - - the plugin to remove
PluginException - 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 dynamically
public java.lang.String canLoad(PluginArtifact pluginArtifact)
throws PluginParseException
canLoad in interface DynamicPluginLoaderpluginArtifact - The artifact to test
PluginParseExceptionprotected Plugin postProcess(Plugin plugin)
PluginLoader to
add information to a Plugin after it has been loaded.
plugin - a plugin that has been loaded
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||