public abstract class LauncherDecorator extends Object implements ExtensionPoint
Launcher
so that one can intercept executions of commands
and alters the command being executed, such as doing this in fakeroot, sudo, pfexec, etc.BuildWrapper.decorateLauncher(AbstractBuild, Launcher, BuildListener)
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
LauncherDecorator() |
Modifier and Type | Method and Description |
---|---|
static ExtensionList<LauncherDecorator> |
all()
Returns all the registered
LauncherDecorator s. |
abstract Launcher |
decorate(Launcher launcher,
Node node)
Called from
Node.createLauncher(TaskListener) to decorate the launchers. |
@NonNull public abstract Launcher decorate(@NonNull Launcher launcher, @NonNull Node node)
Node.createLauncher(TaskListener)
to decorate the launchers.
This method should perform node-specific decoration. For job-specific decoration,
BuildWrapper.decorateLauncher(AbstractBuild, Launcher, BuildListener)
might
fit your needs better.
If the implementation wants to do something differently if the launcher is
for a build, call Executor.currentExecutor()
. If it returns non-null
you can figure out the current build in progress from there. Note that
Launcher
s are also created for doing things other than builds,
so Executor.currentExecutor()
may return null. Also, for job-specific
decoration, see BuildWrapper.decorateLauncher(AbstractBuild, Launcher, BuildListener)
as well.
launcher
- The base launcher that you can decorate.node
- Node for which this launcher is created.Launcher.decorateFor(Node)
,
Launcher.decorateByPrefix(String[])
public static ExtensionList<LauncherDecorator> all()
LauncherDecorator
s.Copyright © 2004–2021. All rights reserved.