Package hudson
Class ClassicPluginStrategy
java.lang.Object
hudson.ClassicPluginStrategy
- All Implemented Interfaces:
ExtensionPoint
,PluginStrategy
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ClassLoader
createClassLoader
(String name, List<File> paths, ClassLoader parent, Attributes atts) Creates a classloader that can load all the specified jar files and delegate to the given parent.protected ClassLoader
createClassLoader
(List<File> paths, ClassLoader parent) Deprecated.protected ClassLoader
createClassLoader
(List<File> paths, ClassLoader parent, Attributes atts) Deprecated.since 2.459 usecreateClassLoader(String, List, ClassLoader, Attributes)
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.static List<PluginWrapper.Dependency>
getImpliedDependencies
(String pluginName, String jenkinsVersion) Deprecated.since 2.163getShortName
(File archive) Finds the plugin name without actually unpacking anythingPluginStrategy.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.void
startPlugin
(PluginWrapper plugin) 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.
-
Constructor Details
-
ClassicPluginStrategy
-
-
Method Details
-
getShortName
Description copied from interface:PluginStrategy
Finds the plugin name without actually unpacking anythingPluginStrategy.createPluginWrapper(java.io.File)
would. Needed byPluginManager.dynamicLoad(java.io.File)
to decide whether such a plugin is already installed.- Specified by:
getShortName
in interfacePluginStrategy
- Returns:
- the
PluginWrapper.getShortName()
- Throws:
IOException
-
createPluginWrapper
Description copied from interface:PluginStrategy
Creates a plugin wrapper, which provides a management interface for the plugin- Specified by:
createPluginWrapper
in interfacePluginStrategy
- Parameters:
archive
- Either a directory that points to a pre-exploded plugin, or an jpi file, or an jpl file.- Throws:
IOException
-
getImpliedDependencies
@Deprecated @NonNull public static List<PluginWrapper.Dependency> getImpliedDependencies(String pluginName, String jenkinsVersion) Deprecated.since 2.163 -
createClassLoader
@Deprecated(since="2.459") protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent) throws IOException Deprecated.since 2.459 usecreateClassLoader(String, List, ClassLoader, Attributes)
- Throws:
IOException
-
createClassLoader
@Deprecated(since="2.459") protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent, Attributes atts) throws IOException Deprecated.since 2.459 usecreateClassLoader(String, List, ClassLoader, Attributes)
- Throws:
IOException
-
createClassLoader
protected ClassLoader createClassLoader(String name, List<File> paths, ClassLoader parent, Attributes atts) throws IOException Creates a classloader that can load all the specified jar files and delegate to the given parent.- Throws:
IOException
- Since:
- 2.459
-
initializeComponents
Description copied from interface:PluginStrategy
Optionally start services provided by the plugin. Should be called when all plugins are loaded.- Specified by:
initializeComponents
in interfacePluginStrategy
-
findComponents
Description copied from interface:PluginStrategy
Find components of the given type using the assigned strategy.- Specified by:
findComponents
in interfacePluginStrategy
- Parameters:
type
- The component typehudson
- The Hudson scope- Returns:
- Sequence of components
-
load
Description copied from interface:PluginStrategy
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.
- Specified by:
load
in interfacePluginStrategy
- Throws:
IOException
-
startPlugin
- Throws:
Exception
-
updateDependency
Description copied from interface:PluginStrategy
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.- Specified by:
updateDependency
in interfacePluginStrategy
- Parameters:
depender
- plugin depending on dependee.dependee
- newly loaded plugin.
-
createClassLoader(String, List, ClassLoader, Attributes)