java.lang.Object | |
↳ | com.atlassian.plugin.manager.DefaultPluginManager |
Known Direct Subclasses |
This implementation delegates the initiation and classloading of plugins to a
list of PluginLoader
s and records the
state of plugins in a
PluginPersistentStateStore
.
installPlugin(com.atlassian.plugin.PluginArtifact)
explicitly stores
the plugin via a PluginInstaller
, whereas
uninstall(Plugin)
relies on the underlying
PluginLoader
to remove the plugin if
necessary.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Disables the plugin with the given key.
| |||||||||||
Disable a plugin module by key.
| |||||||||||
Disables the plugin with the given key without persisting the disabled state.
| |||||||||||
This method is deprecated.
since 2.5.0, use {#link enablePlugins(String... keys)} instead
| |||||||||||
Enable a plugin module by key.
| |||||||||||
Enable a set of plugins by key.
| |||||||||||
Retrieve the class loader responsible for loading classes and resources from plugins.
| |||||||||||
Retrieve a class from a currently loaded (and active) dynamically loaded plugin.
| |||||||||||
Retrieve a resource from a currently loaded (and active) dynamically loaded plugin.
| |||||||||||
This method has been reverted to pre PLUG-40 to fix performance issues
that were encountered during load testing.
| |||||||||||
Get all enabled module descriptors that have a specific descriptor class.
| |||||||||||
This method is deprecated.
since 0.17, use
getModuleDescriptors(com.atlassian.plugin.predicate.ModuleDescriptorPredicate)
with an appropriate predicate instead.
| |||||||||||
Retrieve all plugin modules that implement or extend a specific class.
| |||||||||||
This method is deprecated.
since 0.17, use
getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate)
with an appropriate predicate instead.
| |||||||||||
This method is deprecated.
since 0.17, use
getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate)
with an appropriate predicate instead.
| |||||||||||
Retrieve a given plugin if it is enabled.
| |||||||||||
Retrieve an enabled plugin module by complete module key.
| |||||||||||
Get all of the currently enabled plugins.
| |||||||||||
Gets all module descriptors of installed modules that match the given predicate.
| |||||||||||
Gets all installed modules that match the given predicate.
| |||||||||||
Retrieve a given plugin (whether enabled or not).
| |||||||||||
Retrieve any plugin module by complete module key.
| |||||||||||
Retrieve a resource from a currently loaded (and active) plugin.
| |||||||||||
Gets the state of the plugin upon restart.
| |||||||||||
Gets all installed plugins that match the given predicate.
| |||||||||||
Gets all of the currently installed plugins.
| |||||||||||
Initialise the plugin system.
| |||||||||||
Installs a plugin and returns the plugin key
| |||||||||||
Installs multiple plugins and returns the list of plugin keys.
| |||||||||||
This method checks to see if the plugin is enabled based on the state
manager and the plugin.
| |||||||||||
Whether or not a given plugin module is currently enabled.
| |||||||||||
Restores the state of any plugin requiring a restart that had been removed, upgraded, or installed.
| |||||||||||
Search all loaders and add any new plugins you find.
| |||||||||||
This method is deprecated.
Since 2.0.0.beta2
| |||||||||||
Set the plugin installation strategy for this manager
| |||||||||||
Fires the shutdown event
| |||||||||||
Uninstall the plugin, disabling it first.
| |||||||||||
Restart all plugins by disabling and enabling them in the order they were loaded (by plugin loader)
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
This method is deprecated.
Since 2.0.2, use #addPlugins(PluginLoader,Collection
| |||||||||||
Update the local plugin state and enable state aware modules.
| |||||||||||
Called on all clustered application nodes, rather than
enablePlugin(String) to just update the local state, state aware
modules and loaders, but not affect the global plugin state. | |||||||||||
Preforms an uninstallation without broadcasting the uninstallation event.
| |||||||||||
Unload a plugin.
| |||||||||||
Replace an already loaded plugin with another version.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.atlassian.plugin.PluginAccessor
| |||||||||||
From interface
com.atlassian.plugin.PluginController
| |||||||||||
From interface
com.atlassian.plugin.PluginSystemLifecycle
|
Disables the plugin with the given 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)
.
key | The plugin key. |
---|
Disable a plugin module by key.
completeKey | The "complete key" of the plugin module. |
---|
Disables the plugin with the given key without persisting the disabled state.
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.
key | The plugin key. |
---|
This method is deprecated.
since 2.5.0, use {#link enablePlugins(String... keys)} instead
Enable a plugin by key.
key | The plugin key. |
---|
Enable a plugin module by key.
completeKey | The "complete key" of the plugin module. |
---|
Enable a set of plugins by key. This will implicitly and recursively enable all dependent plugins.
keys | The plugin keys. Must not be null. |
---|
Retrieve the class loader responsible for loading classes and resources from plugins.
Retrieve a class from a currently loaded (and active) dynamically loaded plugin. Will return the first class found, so plugins with overlapping class names will behave eratically.
className | the name of the class to retrieve |
---|
ClassNotFoundException |
---|
Retrieve a resource from a currently loaded (and active) dynamically loaded plugin. Will return the first resource found, so plugins with overlapping resource names will behave eratically.
name | the path to the resource to retrieve |
---|
This method has been reverted to pre PLUG-40 to fix performance issues that were encountered during load testing. This should be reverted to the state it was in at 54639 when the fundamental issue leading to this slowdown has been corrected (that is, slowness of PluginClassLoader).
descriptorClazz | module descriptor class |
---|
ModuleDescriptor
s that implement or extend the given class.
Get all enabled module descriptors that have a specific descriptor class.
descriptorClazz | module descriptor class |
---|---|
verbose | log verbose messages flag |
ModuleDescriptor
s that implement or extend the given class.
This method is deprecated.
since 0.17, use
getModuleDescriptors(com.atlassian.plugin.predicate.ModuleDescriptorPredicate)
with an appropriate predicate instead.
Get all enabled module descriptors that have a specific descriptor type.
ModuleDescriptor
s that are of a given type.Retrieve all plugin modules that implement or extend a specific class.
This method is deprecated.
since 0.17, use
getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate)
with an appropriate predicate instead.
Retrieve all plugin modules that implement or extend a specific class, and has a descriptor class as the descriptorClazz
descriptorClass | @NotNull |
---|---|
moduleClass | @NotNull |
This method is deprecated.
since 0.17, use
getModules(com.atlassian.plugin.predicate.ModuleDescriptorPredicate)
with an appropriate predicate instead.
Retrieve all plugin modules that implement or extend a specific class, and has a descriptor class as one of descriptorClazz
descriptorClasses | @NotNull |
---|---|
moduleClass | @NotNull |
Retrieve a given plugin if it is enabled.
Retrieve an enabled plugin module by complete module key.
Get all of the currently enabled plugins.
Plugin
s.
Gets all module descriptors of installed modules that match the given predicate.
moduleDescriptorPredicate | the ModuleDescriptorPredicate to match. |
---|
ModuleDescriptor
s that match the given predicate.Gets all installed modules that match the given predicate.
moduleDescriptorPredicate | the ModuleDescriptorPredicate to match. |
---|
getModule()
that match the given predicate.Retrieve a given plugin (whether enabled or not).
key | The plugin key. Cannot be null. |
---|
Retrieve any plugin module by complete module key.
Note: the module may or may not be disabled.
Retrieve a resource from a currently loaded (and active) plugin. For statically loaded plugins, this just means pulling the resource from the PluginManager's classloader. For dynamically loaded plugins, this means retrieving the resource from the plugin's private classloader.
Gets the state of the plugin upon restart. Only useful for plugins that contain module descriptors with the \@RestartRequired annotation, and therefore, cannot be dynamically installed, upgraded, or removed at runtime
key | The plugin key |
---|
Gets all installed plugins that match the given predicate.
pluginPredicate | the PluginPredicate to match. |
---|
Plugin
s that match the given predicate.Gets all of the currently installed plugins.
Plugin
s.
Initialise the plugin system. This must be called before anything else.
Installs a plugin and returns the plugin key
pluginArtifact | The plugin artifact to install |
---|
PluginParseException |
---|
Installs multiple plugins and returns the list of plugin keys. All plugin artifacts must be for valid plugins or none will be installed.
pluginArtifacts | The list of plugin artifacts to install |
---|
PluginParseException |
---|
This method checks to see if the plugin is enabled based on the state manager and the plugin.
key | The plugin key |
---|
Whether or not a given plugin module is currently enabled. This also checks if the plugin it is contained within is enabled also
Restores the state of any plugin requiring a restart that had been removed, upgraded, or installed. If marked as removed, the mark will be deleted. If marked as upgrade, an attempt to restore the original plugin artifact will be made. If marked as install, the artifact will be deleted.
pluginKey | The plugin key to revert |
---|
PluginException | If the revert cannot be completed |
---|
Search all loaders and add any new plugins you find.
PluginParseException |
---|
This method is deprecated.
Since 2.0.0.beta2
Set the plugin installation strategy for this manager
pluginInstaller | the plugin installation strategy to use |
---|
Fires the shutdown event
IllegalStateException | if already shutdown or already in the process of shutting down. |
---|
Uninstall the plugin, disabling it first.
plugin | The plugin. |
---|
PluginException | If the plugin or loader doesn't support uninstallation |
---|
Restart all plugins by disabling and enabling them in the order they were loaded (by plugin loader)
This method is deprecated.
Since 2.0.2, use #addPlugins(PluginLoader,Collection
PluginParseException |
---|
Update the local plugin state and enable state aware modules.
If there is an existing plugin with the same key, the version strings of
the existing plugin and the plugin provided to this method will be parsed
and compared. If the installed version is newer than the provided
version, it will not be changed. If the specified plugin's version is the
same or newer, the existing plugin state will be saved and the plugin
will be unloaded before the provided plugin is installed. If the existing
plugin cannot be unloaded a PluginException
will be thrown.
loader | the loader used to load this plugin |
---|---|
pluginsToInstall | the plugins to add |
PluginParseException | if the plugin cannot be parsed |
---|
Called on all clustered application nodes, rather than
enablePlugin(String)
to just update the local state, state aware
modules and loaders, but not affect the global plugin state.
plugin | the plugin being enabled |
---|
Preforms an uninstallation without broadcasting the uninstallation event.
plugin | The plugin to uninstall |
---|
Unload a plugin. Called when plugins are added locally, or remotely in a clustered application.
plugin | the plugin to remove |
---|
PluginException | if the plugin cannot be uninstalled |
---|
Replace an already loaded plugin with another version. Relevant stored configuration for the plugin will be preserved.
oldPlugin | Plugin to replace |
---|---|
newPlugin | New plugin to install |
PluginException | if the plugin cannot be updated |
---|