public class ClassicPluginStrategy extends Object implements PluginStrategy
ExtensionPoint.LegacyInstancesAreScopedToHudson
Modifier and Type | Field and Description |
---|---|
static boolean |
useAntClassLoader |
Constructor and Description |
---|
ClassicPluginStrategy(PluginManager pluginManager) |
Modifier and Type | Method and Description |
---|---|
protected ClassLoader |
createClassLoader(List<File> paths,
ClassLoader parent)
Deprecated.
|
protected ClassLoader |
createClassLoader(List<File> paths,
ClassLoader parent,
Attributes atts)
Creates the classloader that can load all the specified jar files and delegate to the given parent.
|
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.
|
static List<PluginWrapper.Dependency> |
getImpliedDependencies(String pluginName,
String jenkinsVersion)
Deprecated.
since 2.163
|
String |
getShortName(File archive)
Finds the plugin name without actually unpacking anything
PluginStrategy.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.
|
public ClassicPluginStrategy(PluginManager pluginManager)
public String getShortName(File archive) throws IOException
PluginStrategy
PluginStrategy.createPluginWrapper(java.io.File)
would.
Needed by PluginManager.dynamicLoad(java.io.File)
to decide whether such a plugin is already installed.getShortName
in interface PluginStrategy
PluginWrapper.getShortName()
IOException
public PluginWrapper createPluginWrapper(File archive) throws IOException
PluginStrategy
createPluginWrapper
in interface PluginStrategy
archive
- Either a directory that points to a pre-exploded plugin, or an jpi file, or an jpl file.IOException
@Deprecated @NonNull public static List<PluginWrapper.Dependency> getImpliedDependencies(String pluginName, String jenkinsVersion)
@Deprecated protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent) throws IOException
IOException
protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent, Attributes atts) throws IOException
IOException
public void initializeComponents(PluginWrapper plugin)
PluginStrategy
initializeComponents
in interface PluginStrategy
public <T> List<ExtensionComponent<T>> findComponents(Class<T> type, Hudson hudson)
PluginStrategy
findComponents
in interface PluginStrategy
type
- The component typehudson
- The Hudson scopepublic void load(PluginWrapper wrapper) throws IOException
PluginStrategy
This should be done after all the classloaders are constructed for all the plugins, so that dependencies can be properly loaded by plugins.
load
in interface PluginStrategy
IOException
public void startPlugin(PluginWrapper plugin) throws Exception
Exception
public void updateDependency(PluginWrapper depender, PluginWrapper dependee)
PluginStrategy
updateDependency
in interface PluginStrategy
depender
- plugin depending on dependee.dependee
- newly loaded plugin.Copyright © 2004–2022. All rights reserved.