public interface PluginController
| Modifier and Type | Method and Description |
|---|---|
ModuleDescriptor<?> |
addDynamicModule(Plugin plugin,
org.dom4j.Element module)
Add a new module described by
element to the plugin specified. |
void |
disablePlugin(String key)
Disables the plugin with the given key.
|
void |
disablePluginModule(String completeKey)
Disable a plugin module by key.
|
void |
disablePluginWithoutPersisting(String key)
Disables the plugin with the given key without persisting the disabled state.
|
void |
enablePluginModule(String completeKey)
Enable a plugin module by key.
|
void |
enablePlugins(String... keys)
Enable a set of plugins by key.
|
Set<String> |
installPlugins(PluginArtifact... pluginArtifacts)
Installs multiple plugins and returns the list of plugin keys.
|
void |
removeDynamicModule(Plugin plugin,
ModuleDescriptor<?> module)
Remove a module that was dynamically added to plugin..
|
void |
revertRestartRequiredChange(String pluginKey)
Restores the state of any plugin requiring a restart that had been removed, upgraded, or installed.
|
int |
scanForNewPlugins()
Search all loaders and add any new plugins you find.
|
void |
uninstall(Plugin plugin)
Uninstall the plugin, disabling it first.
|
default void |
uninstallPlugins(Collection<Plugin> plugins)
Uninstall multiple plugin, disabling it first.
|
void enablePlugins(String... keys)
keys - The plugin keys. Must not be null.void disablePlugin(String key)
Calling this method will persist the disabled state so that the plugin will also be disabled on next startup. This would normally be used when a user manually disables a plugin.
If you extend DefaultPluginManager and override this method, you will also need to override disablePluginWithoutPersisting(String).
Mandatory dependent plugins will also be disabled. Optionally dependent plugins will be disabled then enabled. Dynamically dependent plugins will not be disabled.
key - The plugin key.disablePluginWithoutPersisting(String),
Plugin.getDependencies()void disablePluginWithoutPersisting(String key)
Calling this method will NOT persist the disabled state so that the framework will try to enable the plugin on next startup. This is used when a plugin has errors on startup.
If you extend DefaultPluginManager and override disablePlugin(String), you will also need to override this method.
Mandatory dependent plugins will also be disabled. Optionally dependent plugins will be disabled then enabled. Dynamically dependent plugins will not be disabled.
key - The plugin key.disablePlugin(String),
Plugin.getDependencies()void enablePluginModule(String completeKey)
completeKey - The "complete key" of the plugin module.void disablePluginModule(String completeKey)
completeKey - The "complete key" of the plugin module.Set<String> installPlugins(PluginArtifact... pluginArtifacts) throws PluginParseException
pluginArtifacts - The list of plugin artifacts to installPluginParseException - if any plugin is not a valid pluginvoid uninstall(Plugin plugin) throws PluginException
plugin - The plugin.PluginException - if there was some problem uninstalling the plugin.default void uninstallPlugins(Collection<Plugin> plugins) throws PluginException
plugins - The plugins to uninstall.PluginException - if there was some problem uninstalling a plugin.void revertRestartRequiredChange(String pluginKey) throws PluginException
pluginKey - The plugin keyPluginException - if there was some problem reverting the plugin state.IllegalArgumentException - if the plugin key is null or cannot be resolved to a pluginint scanForNewPlugins()
throws PluginParseException
PluginParseExceptionModuleDescriptor<?> addDynamicModule(Plugin plugin, org.dom4j.Element module)
element to the plugin specified.
Module will be enabled if the following conditions are met:
ModuleDescriptor.isEnabledByDefault() returns trueplugin - to add the module tomodule - to addremoveDynamicModule(Plugin, ModuleDescriptor),
PluginAccessor.getDynamicModules(Plugin)void removeDynamicModule(Plugin plugin, ModuleDescriptor<?> module)
plugin - to remove the module frommodule - to removeaddDynamicModule(Plugin, org.dom4j.Element),
PluginAccessor.getDynamicModules(Plugin)Copyright © 2019 Atlassian. All rights reserved.