public class LaunchManager
extends java.lang.Object
Constructor and Description |
---|
LaunchManager() |
Modifier and Type | Method and Description |
---|---|
static int |
pseudoTerminalLaunch(java.lang.String[] cmdline,
java.io.FileDescriptor in,
java.io.FileDescriptor out,
java.io.FileDescriptor err,
boolean silent,
boolean background)
Creates a child process with all or some of its stdio handles redirected
to the pipes and the rest of them left unchanged.
|
static void |
pseudoTerminalWait(int pid)
Wait for a specific non-interactive child process (which was previously
launched using
pseudoTerminalLaunch(java.lang.String[], java.io.FileDescriptor, java.io.FileDescriptor, java.io.FileDescriptor, boolean, boolean) ) to exit. |
static void |
pseudoTerminalWait(int pid,
boolean silent)
Wait for a specific child process (which was previously launched
using
pseudoTerminalLaunch(java.lang.String[], java.io.FileDescriptor, java.io.FileDescriptor, java.io.FileDescriptor, boolean, boolean) ) to exit. |
public static int pseudoTerminalLaunch(java.lang.String[] cmdline, java.io.FileDescriptor in, java.io.FileDescriptor out, java.io.FileDescriptor err, boolean silent, boolean background)
The handles redirected to the pipes can be used to communicate between processes.
In Progress, there are following use cases for the redirected I/O:
stdio\\use |
Interactive Process Launch |
INPUT THROUGH |
INPUT-OUTPUT THROUGH |
OUTPUT THROUGH |
stdin |
TTY |
TTY |
pipe |
pipe |
stdout |
TTY |
pipe |
pipe |
TTY |
stderr |
TTY |
pipe |
pipe |
TTY |
cmdline
- The command line to execute. The first element must be the
program name.in
- File descriptor to be associated with the pipe that redirects
stdin, or null
if no redirection is required.out
- File descriptor to be associated with the pipe that redirects
stdout, or null
if no redirection is required.err
- File descriptor to be associated with the pipe that redirects
stderr, or null
if no redirection is required.silent
- false
for interactive mode (there the terminal
is expected to be shared by the child process and the user is
allowed to directly interact with the child process.background
- true
if client is running in the background
(disconnected from its controlling terminal); else false
.public static void pseudoTerminalWait(int pid, boolean silent)
pseudoTerminalLaunch(java.lang.String[], java.io.FileDescriptor, java.io.FileDescriptor, java.io.FileDescriptor, boolean, boolean)
) to exit.pid
- ID of the child process to be waited.silent
- false
for interactive mode (there the terminal
is expected to be shared by the child process and the user is
allowed to directly interact with the child process.public static void pseudoTerminalWait(int pid)
pseudoTerminalLaunch(java.lang.String[], java.io.FileDescriptor, java.io.FileDescriptor, java.io.FileDescriptor, boolean, boolean)
) to exit.pid
- ID of the child process to be waited.