public class ClassicPluginStrategy extends Object implements PluginStrategy
ExtensionPoint.LegacyInstancesAreScopedToHudson| Modifier and Type | Field and Description |
|---|---|
static boolean |
DISABLE_TRANSFORMER |
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.
|
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 static boolean useAntClassLoader
public static boolean DISABLE_TRANSFORMER
public ClassicPluginStrategy(PluginManager pluginManager)
public String getShortName(File archive) throws IOException
PluginStrategyPluginStrategy.createPluginWrapper(java.io.File) would.
Needed by PluginManager.dynamicLoad(java.io.File) to decide whether such a plugin is already installed.getShortName in interface PluginStrategyPluginWrapper.getShortName()IOExceptionpublic PluginWrapper createPluginWrapper(File archive) throws IOException
PluginStrategycreatePluginWrapper in interface PluginStrategyarchive - Either a directory that points to a pre-exploded plugin, or an jpi file, or an jpl file.IOException@Deprecated protected ClassLoader createClassLoader(List<File> paths, ClassLoader parent) throws IOException
IOExceptionprotected ClassLoader createClassLoader(List<File> paths, ClassLoader parent, Attributes atts) throws IOException
IOExceptionpublic void initializeComponents(PluginWrapper plugin)
PluginStrategyinitializeComponents in interface PluginStrategypublic <T> List<ExtensionComponent<T>> findComponents(Class<T> type, Hudson hudson)
PluginStrategyfindComponents in interface PluginStrategytype - The component typehudson - The Hudson scopepublic void load(PluginWrapper wrapper) throws IOException
PluginStrategyThis 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 PluginStrategyIOExceptionpublic void startPlugin(PluginWrapper plugin) throws Exception
Exceptionpublic void updateDependency(PluginWrapper depender, PluginWrapper dependee)
PluginStrategyupdateDependency in interface PluginStrategydepender - plugin depending on dependee.dependee - newly loaded plugin.Copyright © 2019. All rights reserved.