Package hudson
Class ClassicPluginStrategy
- java.lang.Object
-
- hudson.ClassicPluginStrategy
-
- All Implemented Interfaces:
ExtensionPoint,PluginStrategy
public class ClassicPluginStrategy extends Object implements PluginStrategy
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description ClassicPluginStrategy(PluginManager pluginManager)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ClassLoadercreateClassLoader(List<File> paths, ClassLoader parent)Deprecated.protected ClassLoadercreateClassLoader(List<File> paths, ClassLoader parent, Attributes atts)Creates the classloader that can load all the specified jar files and delegate to the given parent.PluginWrappercreatePluginWrapper(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.163StringgetShortName(File archive)Finds the plugin name without actually unpacking anythingPluginStrategy.createPluginWrapper(java.io.File)would.voidinitializeComponents(PluginWrapper plugin)Optionally start services provided by the plugin.voidload(PluginWrapper wrapper)Loads the plugin and starts it.voidstartPlugin(PluginWrapper plugin)voidupdateDependency(PluginWrapper depender, PluginWrapper dependee)Called when a plugin is installed, but there was already a plugin installed which optionally depended on that plugin.
-
-
-
Constructor Detail
-
ClassicPluginStrategy
public ClassicPluginStrategy(PluginManager pluginManager)
-
-
Method Detail
-
getShortName
public String getShortName(File archive) throws IOException
Description copied from interface:PluginStrategyFinds 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:
getShortNamein interfacePluginStrategy- Returns:
- the
PluginWrapper.getShortName() - Throws:
IOException
-
createPluginWrapper
public PluginWrapper createPluginWrapper(File archive) throws IOException
Description copied from interface:PluginStrategyCreates a plugin wrapper, which provides a management interface for the plugin- Specified by:
createPluginWrapperin 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 protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent) throws IOException
Deprecated.- Throws:
IOException
-
createClassLoader
protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent, Attributes atts) throws IOException
Creates the classloader that can load all the specified jar files and delegate to the given parent.- Throws:
IOException
-
initializeComponents
public void initializeComponents(PluginWrapper plugin)
Description copied from interface:PluginStrategyOptionally start services provided by the plugin. Should be called when all plugins are loaded.- Specified by:
initializeComponentsin interfacePluginStrategy
-
findComponents
public <T> List<ExtensionComponent<T>> findComponents(Class<T> type, Hudson hudson)
Description copied from interface:PluginStrategyFind components of the given type using the assigned strategy.- Specified by:
findComponentsin interfacePluginStrategy- Parameters:
type- The component typehudson- The Hudson scope- Returns:
- Sequence of components
-
load
public void load(PluginWrapper wrapper) throws IOException
Description copied from interface:PluginStrategyLoads 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:
loadin interfacePluginStrategy- Throws:
IOException
-
startPlugin
public void startPlugin(PluginWrapper plugin) throws Exception
- Throws:
Exception
-
updateDependency
public void updateDependency(PluginWrapper depender, PluginWrapper dependee)
Description copied from interface:PluginStrategyCalled 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:
updateDependencyin interfacePluginStrategy- Parameters:
depender- plugin depending on dependee.dependee- newly loaded plugin.
-
-