public static class Launcher.DecoratedLauncher extends Launcher
Launcher.DecoratedLauncher, Launcher.DummyLauncher, Launcher.IOTriplet, Launcher.LocalLauncher, Launcher.ProcStarter, Launcher.RemoteLauncher, Launcher.RemoteProcess
channel, envVarsFilterRuleWrapper, listener, showFullPath
Constructor and Description |
---|
DecoratedLauncher(Launcher inner) |
Modifier and Type | Method and Description |
---|---|
hudson.remoting.VirtualChannel |
getChannel()
Gets the channel that can be used to run a program remotely.
|
Computer |
getComputer()
|
Launcher |
getInner()
Gets nested launcher.
|
TaskListener |
getListener()
Gets the
TaskListener that this launcher uses to
report the commands that it's executing. |
boolean |
isUnix()
Returns true if this
Launcher is going to launch on Unix. |
void |
kill(Map<String,String> modelEnvVars)
Calls
ProcessTree.killAll(Map) to kill processes. |
Proc |
launch(Launcher.ProcStarter starter)
Primarily invoked from
Launcher.ProcStarter.start() to start a process with a specific launcher. |
Proc |
launch(String[] cmd,
boolean[] mask,
String[] env,
InputStream in,
OutputStream out,
FilePath workDir)
Launch a command with optional censoring of arguments from the listener (Note: The censored portions will
remain visible through /proc, pargs, process explorer, etc.
|
Proc |
launch(String[] cmd,
String[] env,
InputStream in,
OutputStream out,
FilePath workDir) |
hudson.remoting.Channel |
launchChannel(String[] cmd,
OutputStream out,
FilePath workDir,
Map<String,String> envVars)
Launches a specified process and connects its input/output to a
Channel , then
return it. |
String |
toString() |
decorateByEnv, decorateByPrefix, decorateFor, launch, launch, launch, launch, launch, launch, launch, launch, launch, launch, launch, maskedPrintCommandLine, maskedPrintCommandLine, prepareFilterRules, printCommandLine, setEnvVarsFilterRuleWrapper
public DecoratedLauncher(@NonNull Launcher inner)
public Proc launch(Launcher.ProcStarter starter) throws IOException
Launcher
Launcher.ProcStarter.start()
to start a process with a specific launcher.launch
in class Launcher
IOException
public hudson.remoting.Channel launchChannel(String[] cmd, OutputStream out, FilePath workDir, Map<String,String> envVars) throws IOException, InterruptedException
Launcher
Channel
, then
return it.
When the returned channel is terminated, the process will be killed.
launchChannel
in class Launcher
cmd
- The commands.out
- Where the stderr from the launched process will be sent.workDir
- The working directory of the new process, or null
to inherit
from the current processenvVars
- Environment variable overrides. In addition to what the current process
is inherited (if this is going to be launched from an agent, that
becomes the "current" process), these variables will be also set.IOException
InterruptedException
public void kill(Map<String,String> modelEnvVars) throws IOException, InterruptedException
Launcher
ProcessTree.killAll(Map)
to kill processes.kill
in class Launcher
IOException
InterruptedException
public boolean isUnix()
Launcher
Launcher
is going to launch on Unix.public Proc launch(String[] cmd, boolean[] mask, String[] env, InputStream in, OutputStream out, FilePath workDir) throws IOException
Launcher
launch
in class Launcher
cmd
- The command and all it's arguments.mask
- Which of the command and arguments should be masked from the listenerenv
- Environment variable overrides.in
- null if there's no input.out
- stdout and stderr of the process will be sent to this stream. the stream won't be closed.workDir
- null if the working directory could be anything.IOException
- When there are IO problems.public Computer getComputer()
Launcher
Launcher
is encapsulating an execution on a specific Computer
,
return it.
Because of the way internal Hudson abstractions are set up (that is, Launcher
only
needs a VirtualChannel
to do its job and isn't really required that the channel
comes from an existing Computer
), this method may not always the right Computer
instance.
getComputer
in class Launcher
null
if this launcher is not created from a Computer
object.public TaskListener getListener()
Launcher
TaskListener
that this launcher uses to
report the commands that it's executing.getListener
in class Launcher
public hudson.remoting.VirtualChannel getChannel()
Launcher
getChannel
in class Launcher
null
if the target node is not configured to support this.
this is a transitional measure.
Note that a launcher for the built-in node is always non-null.public Proc launch(String[] cmd, String[] env, InputStream in, OutputStream out, FilePath workDir) throws IOException
launch
in class Launcher
env
- Environment variable overrides.in
- null if there's no input.out
- stdout and stderr of the process will be sent to this stream.
the stream won't be closed.workDir
- null if the working directory could be anything.IOException
@NonNull public Launcher getInner()
Copyright © 2004–2022. All rights reserved.