| Modifier and Type | Class and Description |
|---|---|
| private static class | ProcessImpl.
A buffered input stream for a subprocess pipe file descriptor that allows the underlying file descriptor to be reclaimed when the process exits, via the processExited hook. |
| private static enum | |
| private static class | ProcessImpl.
A buffered input stream for a subprocess pipe file descriptor that allows the underlying file descriptor to be reclaimed when the process exits, via the processExited hook. |
| private static class | ProcessImpl.
A buffered output stream for a subprocess pipe file descriptor that allows the underlying file descriptor to be reclaimed when the process exits, via the processExited hook. |
| Modifier and Type | Field and Description |
|---|---|
| private final Condition | |
| private int | |
| private static final JavaIOFileDescriptorAccess | |
| private boolean | |
| private static final byte[] | |
| pack-priv static final Charset | |
| private static final ProcessImpl. | |
| private final ReentrantLock | |
| private final int | |
| private final ProcessHandleImpl | |
| private InputStream | |
| private OutputStream | |
| private InputStream | |
| pack-priv static final boolean |
| Access | Constructor and Description |
|---|---|
| private | ProcessImpl(final byte[] prog, final byte[] argBlock, final int argc, final byte[] envBlock, final int envc, final byte[] dir, final int[] fds, final boolean forceNullOutputStream, final boolean redirectErrorStream)
|
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | |
| public Process | |
| public int | |
| private native int | Returns: the pid of the subprocessan array of three file descriptors.
Indexes 0, 1, and 2 correspond to standard input,
standard output and standard error, respectively. On
input, a value of -1 means to create a pipe to connect
child and parent processes. On output, a value which
is not -1 is the parent pipe fd corresponding to the
pipe which has been created. An element of this array
is -1 on input if and only if it is not -1 on
output. fds, boolean redirectErrorStream)Creates a process. |
| public InputStream | getErrorStream()
Implements abstract java. Returns the input stream connected to the error output of the process. |
| public InputStream | getInputStream()
Implements abstract java. Returns the input stream connected to the normal output of the process. |
| public OutputStream | getOutputStream()
Implements abstract java. Returns the output stream connected to the normal input of the process. |
| private static native void | |
| pack-priv void | initStreams(int[]
array of stdin, stdout, stderr fds fds, boolean true if the stdout is being directed to
a subsequent process. The stdout stream should be a null output stream . forceNullOutputStream)Initialize the streams from the file descriptors. |
| public boolean | isAlive()
Overrides java. Tests whether the process represented by this |
| private static ProcessImpl. | Returns: the default or requested launch mechanismReturns the default or requested launch mechanism. |
| pack-priv static FileDescriptor | |
| public CompletableFuture | onExit()
Overrides java. Returns a |
| public long | |
| pack-priv static Process | |
| public boolean | supportsNormalTermination()
Overrides java. Returns |
| private static byte[] | |
| public ProcessHandle | |
| public String | Returns: a string representation of the object.Overrides java. The |
| public int | waitFor()
Implements abstract java. Causes the current thread to wait, if necessary, until the
process represented by this |
| public boolean | waitFor(long timeout, TimeUnit unit)
Overrides java. Causes the current thread to wait, if necessary, until the
process represented by this |
| condition | back to summary |
|---|---|
| private final Condition condition | |
| exitcode | back to summary |
|---|---|
| private int exitcode | |
| fdAccess | back to summary |
|---|---|
| private static final JavaIOFileDescriptorAccess fdAccess | |
| hasExited | back to summary |
|---|---|
| private boolean hasExited | |
| helperpath | back to summary |
|---|---|
| private static final byte[] helperpath | |
| JNU_CHARSET | back to summary |
|---|---|
| pack-priv static final Charset JNU_CHARSET | |
| launchMechanism | back to summary |
|---|---|
| private static final ProcessImpl. | |
| lock | back to summary |
|---|---|
| private final ReentrantLock lock | |
| pid | back to summary |
|---|---|
| private final int pid | |
| processHandle | back to summary |
|---|---|
| private final ProcessHandleImpl processHandle | |
| stderr | back to summary |
|---|---|
| private InputStream stderr | |
| stdin | back to summary |
|---|---|
| private OutputStream stdin | |
| stdout | back to summary |
|---|---|
| private InputStream stdout | |
| SUPPORTS_NORMAL_TERMINATION | back to summary |
|---|---|
| pack-priv static final boolean SUPPORTS_NORMAL_TERMINATION | |
| ProcessImpl | back to summary |
|---|---|
| private ProcessImpl(final byte[] prog, final byte[] argBlock, final int argc, final byte[] envBlock, final int envc, final byte[] dir, final int[] fds, final boolean forceNullOutputStream, final boolean redirectErrorStream) throws IOException | |
| destroy | back to summary |
|---|---|
| private void destroy(boolean force) | |
| destroy | back to summary |
|---|---|
| public void destroy() Implements abstract java. Doc from java. Kills the process.
Whether the process represented by this
The
| |
| destroyForcibly | back to summary |
|---|---|
| public Process destroyForcibly() Overrides java. Doc from java. Kills the process forcibly. The process represented by this
The
Invoking this method on
| |
| exitValue | back to summary |
|---|---|
| public int exitValue() Implements abstract java. Doc from java. Returns the exit value for the process. | |
| forkAndExec | back to summary |
|---|---|
| private native int forkAndExec(int mode, byte[] helperpath, byte[] prog, byte[] argBlock, int argc, byte[] envBlock, int envc, byte[] dir, int[] fds, boolean redirectErrorStream) throws IOException Creates a process. Depending on the 1 - fork(2) and exec(2) 2 - posix_spawn(3P)
| |
| getErrorStream | back to summary |
|---|---|
| public InputStream getErrorStream() Implements abstract java. Doc from java. Returns the input stream connected to the error output of the
process. The stream obtains data piped from the error output
of the process represented by this If the standard error of the process has been redirected using
The error stream should be closed when it is no longer needed. | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() Implements abstract java. Doc from java. Returns the input stream connected to the normal output of the
process. The stream obtains data piped from the standard
output of the process represented by this If the standard output of the process has been redirected using
Otherwise, if the standard error of the process has been
redirected using
The input stream should be closed when it is no longer needed. | |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() Implements abstract java. Doc from java. Returns the output stream connected to the normal input of the
process. Output to the stream is piped into the standard
input of the process represented by this If the standard input of the process has been redirected using
The output stream should be closed when it is no longer needed. | |
| init | back to summary |
|---|---|
| private static native void init() | |
| initStreams | back to summary |
|---|---|
| pack-priv void initStreams(int[] fds, boolean forceNullOutputStream) throws IOException Initialize the streams from the file descriptors.
| |
| isAlive | back to summary |
|---|---|
| public boolean isAlive() Overrides java. Doc from java. Tests whether the process represented by this
| |
| launchMechanism | back to summary |
|---|---|
| private static ProcessImpl. Returns the default or requested launch mechanism.
| |
| newFileDescriptor | back to summary |
|---|---|
| pack-priv static FileDescriptor newFileDescriptor(int fd) | |
| onExit | back to summary |
|---|---|
| public CompletableFuture Overrides java. Doc from java. Returns a
Calling
Processes returned from
| |
| pid | back to summary |
|---|---|
| public long pid() Overrides java. Doc from java. Returns the native process ID of the process. The native process ID is an identification number that the operating system assigns to the process.
| |
| start | back to summary |
|---|---|
| pack-priv static Process start(String[] cmdarray, Map<String, String> environment, String dir, ProcessBuilder. | |
| supportsNormalTermination | back to summary |
|---|---|
| public boolean supportsNormalTermination() Overrides java. Doc from java. Returns
Invoking this method on
| |
| toCString | back to summary |
|---|---|
| private static byte[] toCString(String s) | |
| toHandle | back to summary |
|---|---|
| public ProcessHandle toHandle() Overrides java. Doc from java. Returns a ProcessHandle for the Process.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. The | |
| waitFor | back to summary |
|---|---|
| public int waitFor() throws InterruptedException Implements abstract java. Doc from java. Causes the current thread to wait, if necessary, until the
process represented by this
| |
| waitFor | back to summary |
|---|---|
| public boolean waitFor(long timeout, TimeUnit unit) throws InterruptedException Overrides java. Doc from java. Causes the current thread to wait, if necessary, until the
process represented by this If the process has already terminated then this method returns
immediately with the value
| |
| Modifier and Type | Field and Description |
|---|---|
| private final Object | |
| private boolean | |
| private int |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | available()
Overrides java. Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. |
| public void | close()
Overrides java. Implements java. Closes this input stream and releases any system resources associated with the stream. |
| private InputStream | |
| private void | |
| pack-priv synchronized void | |
| private void | |
| public int | read()
Overrides java. See
the general contract of the |
| public int | read(byte[] b)
Overrides java. Reads up to |
| public int | read(byte[] b, int off, int len)
Overrides java. Reads bytes from this byte-input stream into the specified byte array, starting at the given offset. |
| public long | skip(long n)
Overrides java. See the general contract of the |
| closeLock | back to summary |
|---|---|
| private final Object closeLock | |
| closePending | back to summary |
|---|---|
| private boolean closePending | |
| useCount | back to summary |
|---|---|
| private int useCount | |
| DeferredCloseProcessPipeInputStream | back to summary |
|---|---|
| pack-priv DeferredCloseProcessPipeInputStream(int fd) | |
| available | back to summary |
|---|---|
| public int available() throws IOException Overrides java. Doc from java. Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. The next invocation might be the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes.
This method returns the sum of the number of bytes remaining to be read in
the buffer (
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream. Once the stream has been closed, further read(), available(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
| |
| drainInputStream | back to summary |
|---|---|
| private InputStream drainInputStream(InputStream in) throws IOException | |
| lower | back to summary |
|---|---|
| private void lower() throws IOException | |
| processExited | back to summary |
|---|---|
| pack-priv synchronized void processExited() Called by the process reaper thread when the process exits. | |
| raise | back to summary |
|---|---|
| private void raise() | |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Doc from java. See
the general contract of the
| |
| read | back to summary |
|---|---|
| public int read(byte[] b) throws IOException Overrides java. Doc from java. Reads up to
| |
| read | back to summary |
|---|---|
| public int read(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Reads bytes from this byte-input stream into the specified byte array, starting at the given offset. This method implements the general contract of the corresponding
read on the underlying stream returns
-1 to indicate end-of-file then this method returns
-1. Otherwise, this method returns the number of bytes
actually read.
Subclasses of this class are encouraged, but not required, to attempt to read as many bytes as possible in the same fashion.
| |
| skip | back to summary |
|---|---|
| public long skip(long n) throws IOException Overrides java. Doc from java. See the general contract of the
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final ProcessImpl. | |
| public static final ProcessImpl. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ProcessImpl. | |
| public static ProcessImpl. |
| FORK | back to summary |
|---|---|
| public static final ProcessImpl. | |
| POSIX_SPAWN | back to summary |
|---|---|
| public static final ProcessImpl. | |
| LaunchMechanism | back to summary |
|---|---|
| private LaunchMechanism() | |
| valueOf | back to summary |
|---|---|
| public static ProcessImpl. | |
| values | back to summary |
|---|---|
| public static ProcessImpl. | |
| Modifier and Type | Field and Description |
|---|---|
| private final Object |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this input stream and releases any system resources associated with the stream. |
| private static byte[] | |
| pack-priv synchronized void |
| closeLock | back to summary |
|---|---|
| private final Object closeLock | |
| ProcessPipeInputStream | back to summary |
|---|---|
| pack-priv ProcessPipeInputStream(int fd) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this input stream and releases any system resources associated with the stream. Once the stream has been closed, further read(), available(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
| |
| drainInputStream | back to summary |
|---|---|
| private static byte[] drainInputStream(InputStream in) throws IOException | |
| processExited | back to summary |
|---|---|
| pack-priv synchronized void processExited() Called by the process reaper thread when the process exits. | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv synchronized void |
| ProcessPipeOutputStream | back to summary |
|---|---|
| pack-priv ProcessPipeOutputStream(int fd) | |
| processExited | back to summary |
|---|---|
| pack-priv synchronized void processExited() Called by the process reaper thread when the process exits. | |