public interface PluginStrategy extends ExtensionPoint
PluginWrapper
.
This extension point was added to allow plugins to be loaded into a different environment
(such as loading it in an existing DI container like Plexus.) A plugin strategy is a singleton
instance, and as such this feature is primarily meant for OEM.
See PluginManager.createPluginStrategy()
for how this instance is created.
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Method and Description |
---|---|
PluginWrapper |
createPluginWrapper(File archive)
Creates a plugin wrapper, which provides a management interface for the plugin
|
<T> List<ExtensionComponent<T>> |
findComponents(Class<T> type,
Hudson hudson)
Find components of the given type using the assigned strategy.
|
String |
getShortName(File archive)
Finds the plugin name without actually unpacking anything
createPluginWrapper(java.io.File) would. |
void |
initializeComponents(PluginWrapper plugin)
Optionally start services provided by the plugin.
|
void |
load(PluginWrapper wrapper)
Loads the plugin and starts it.
|
default void |
updateDependency(PluginWrapper depender,
PluginWrapper dependee)
Called when a plugin is installed, but there was already a plugin installed which optionally depended on that plugin.
|
PluginWrapper createPluginWrapper(File archive) throws IOException
archive
- Either a directory that points to a pre-exploded plugin, or an jpi file, or an jpl file.IOException
@NonNull String getShortName(File archive) throws IOException
createPluginWrapper(java.io.File)
would.
Needed by PluginManager.dynamicLoad(java.io.File)
to decide whether such a plugin is already installed.PluginWrapper.getShortName()
IOException
void load(PluginWrapper wrapper) throws IOException
This should be done after all the classloaders are constructed for all the plugins, so that dependencies can be properly loaded by plugins.
IOException
void initializeComponents(PluginWrapper plugin)
plugin
- <T> List<ExtensionComponent<T>> findComponents(Class<T> type, Hudson hudson)
type
- The component typehudson
- The Hudson scopedefault void updateDependency(PluginWrapper depender, PluginWrapper dependee)
depender
- plugin depending on dependee.dependee
- newly loaded plugin.Copyright © 2004–2021. All rights reserved.