Package hudson
Interface PluginStrategy
- All Superinterfaces:
ExtensionPoint
- All Known Implementing Classes:
ClassicPluginStrategy
Pluggability point for how to create
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Method Summary
Modifier and TypeMethodDescriptioncreatePluginWrapper
(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.getShortName
(File archive) Finds the plugin name without actually unpacking anythingcreatePluginWrapper(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.
-
Method Details
-
createPluginWrapper
Creates a plugin wrapper, which provides a management interface for the plugin- Parameters:
archive
- Either a directory that points to a pre-exploded plugin, or an jpi file, or an jpl file.- Throws:
IOException
-
getShortName
Finds the plugin name without actually unpacking anythingcreatePluginWrapper(java.io.File)
would. Needed byPluginManager.dynamicLoad(java.io.File)
to decide whether such a plugin is already installed.- Returns:
- the
PluginWrapper.getShortName()
- Throws:
IOException
-
load
Loads the plugin and starts it.This should be done after all the classloaders are constructed for all the plugins, so that dependencies can be properly loaded by plugins.
- Throws:
IOException
-
initializeComponents
Optionally start services provided by the plugin. Should be called when all plugins are loaded. -
findComponents
Find components of the given type using the assigned strategy.- Parameters:
type
- The component typehudson
- The Hudson scope- Returns:
- Sequence of components
- Since:
- 1.400
-
updateDependency
Called when a plugin is installed, but there was already a plugin installed which optionally depended on that plugin. The class loader of the existing depending plugin should be updated to load classes from the newly installed plugin.- Parameters:
depender
- plugin depending on dependee.dependee
- newly loaded plugin.- Since:
- 1.557
-