hudson
Class LauncherDecorator

java.lang.Object
  extended by hudson.LauncherDecorator
All Implemented Interfaces:
ExtensionPoint

public abstract class LauncherDecorator
extends Object
implements ExtensionPoint

Decorates Launcher so that one can intercept executions of commands and alters the command being executed, such as doing this in fakeroot, sudo, pfexec, etc.

Since:
1.299
Author:
Kohsuke Kawaguchi
See Also:
BuildWrapper.decorateLauncher(AbstractBuild, Launcher, BuildListener)

Nested Class Summary
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Constructor Summary
LauncherDecorator()
           
 
Method Summary
static ExtensionList<LauncherDecorator> all()
          Returns all the registered LauncherDecorators.
abstract  Launcher decorate(Launcher launcher, Node node)
          Called from Node.createLauncher(TaskListener) to decorate the launchers.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LauncherDecorator

public LauncherDecorator()
Method Detail

decorate

public abstract Launcher decorate(Launcher launcher,
                                  Node node)
Called from 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 Launchers 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.

Parameters:
launcher - The base launcher that you can decorate. Never null.
node - Node for which this launcher is created. Never null.
Returns:
Never null. Return the 'launcher' parameter to do no-op.
See Also:
Launcher.decorateFor(Node), Launcher.decorateByPrefix(String[])

all

public static ExtensionList<LauncherDecorator> all()
Returns all the registered LauncherDecorators.



Copyright © 2004-2013 Hudson. All Rights Reserved.