Package hudson
Class Launcher.RemoteLauncher
java.lang.Object
hudson.Launcher
hudson.Launcher.RemoteLauncher
- Enclosing class:
- Launcher
Launches processes remotely by using the given channel.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.Launcher
Launcher.DecoratedLauncher, Launcher.DummyLauncher, Launcher.IOTriplet, Launcher.LocalLauncher, Launcher.ProcStarter, Launcher.RemoteLauncher, Launcher.RemoteProcess
-
Field Summary
Fields inherited from class hudson.Launcher
channel, envVarsFilterRuleWrapper, listener, showFullPath
-
Constructor Summary
ConstructorDescriptionRemoteLauncher
(TaskListener listener, hudson.remoting.VirtualChannel channel, boolean isUnix) -
Method Summary
Modifier and TypeMethodDescriptionhudson.remoting.VirtualChannel
Gets the channel that can be used to run a program remotely.boolean
isUnix()
Returns true if thisLauncher
is going to launch on Unix.void
CallsProcessTree.killAll(Map)
to kill processes.Primarily invoked fromLauncher.ProcStarter.start()
to start a process with a specific launcher.hudson.remoting.Channel
launchChannel
(String[] cmd, OutputStream err, FilePath _workDir, Map<String, String> envOverrides) Launches a specified process and connects its input/output to aChannel
, then return it.toString()
Methods inherited from class hudson.Launcher
decorateByEnv, decorateByPrefix, decorateFor, getComputer, getListener, launch, launch, launch, launch, launch, launch, launch, launch, launch, launch, launch, launch, launch, maskedPrintCommandLine, maskedPrintCommandLine, prepareFilterRules, printCommandLine, setEnvVarsFilterRuleWrapper
-
Constructor Details
-
RemoteLauncher
public RemoteLauncher(@NonNull TaskListener listener, @NonNull hudson.remoting.VirtualChannel channel, boolean isUnix)
-
-
Method Details
-
getChannel
@NonNull public hudson.remoting.VirtualChannel getChannel()Description copied from class:Launcher
Gets the channel that can be used to run a program remotely.- Overrides:
getChannel
in classLauncher
- Returns:
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.
-
launch
Description copied from class:Launcher
Primarily invoked fromLauncher.ProcStarter.start()
to start a process with a specific launcher.- Specified by:
launch
in classLauncher
- Throws:
IOException
-
launchChannel
public hudson.remoting.Channel launchChannel(String[] cmd, OutputStream err, FilePath _workDir, Map<String, String> envOverrides) throws IOException, InterruptedExceptionDescription copied from class:Launcher
Launches a specified process and connects its input/output to aChannel
, then return it.When the returned channel is terminated, the process will be killed.
- Specified by:
launchChannel
in classLauncher
- Parameters:
cmd
- The commands.err
- Where the stderr from the launched process will be sent._workDir
- The working directory of the new process, ornull
to inherit from the current processenvOverrides
- 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.- Throws:
IOException
InterruptedException
-
isUnix
public boolean isUnix()Description copied from class:Launcher
Returns true if thisLauncher
is going to launch on Unix. -
kill
Description copied from class:Launcher
CallsProcessTree.killAll(Map)
to kill processes.- Specified by:
kill
in classLauncher
- Throws:
IOException
InterruptedException
-
toString
-