public class Pipe extends java.lang.Object implements java.util.concurrent.Callable<Pipe.Result>, Process
Modifier and Type | Class and Description |
---|---|
private class |
Pipe.MultiChannel |
private class |
Pipe.RefByteChannel |
static class |
Pipe.Result |
Process.Utils
Modifier and Type | Field and Description |
---|---|
(package private) Closure |
closure |
private static java.lang.ThreadLocal<Pipe> |
CURRENT |
(package private) boolean |
endOfPipe |
(package private) java.io.PrintStream |
err |
(package private) int |
error |
(package private) java.io.InputStream |
in |
(package private) Job |
job |
(package private) java.io.PrintStream |
out |
private static int |
READ |
(package private) Parser.Statement |
statement |
(package private) java.nio.channels.Channel[] |
streams |
(package private) boolean[] |
toclose |
private static int |
WRITE |
Constructor and Description |
---|
Pipe(Closure closure,
CommandSessionImpl.JobImpl job,
Parser.Statement statement,
java.nio.channels.Channel[] streams,
boolean[] toclose,
boolean endOfPipe) |
Modifier and Type | Method and Description |
---|---|
Pipe.Result |
call() |
private Pipe.Result |
doCall() |
java.io.PrintStream |
err() |
void |
error(int error)
Set the error code for the currently running pipe.
|
static Pipe |
getCurrentPipe() |
java.io.InputStream |
in() |
boolean |
isTty(int fd)
Check if the given descriptor for the currently running pipe is the terminal or not.
|
Job |
job()
Get the job controlling this process
|
java.io.PrintStream |
out() |
private static Pipe |
setCurrentPipe(Pipe pipe) |
private void |
setStream(java.nio.channels.Channel ch,
int fd,
int readWrite) |
private java.nio.file.Path |
toPath(java.lang.Object o) |
private java.util.List<java.nio.file.Path> |
toPaths(java.lang.Object val) |
java.lang.String |
toString() |
private java.nio.channels.Channel |
wrap(java.nio.channels.Channel channel) |
private static final java.lang.ThreadLocal<Pipe> CURRENT
final Closure closure
final Job job
final Parser.Statement statement
final java.nio.channels.Channel[] streams
final boolean[] toclose
final boolean endOfPipe
int error
java.io.InputStream in
java.io.PrintStream out
java.io.PrintStream err
private static final int READ
private static final int WRITE
public Pipe(Closure closure, CommandSessionImpl.JobImpl job, Parser.Statement statement, java.nio.channels.Channel[] streams, boolean[] toclose, boolean endOfPipe)
public static Pipe getCurrentPipe()
public java.lang.String toString()
toString
in class java.lang.Object
private void setStream(java.nio.channels.Channel ch, int fd, int readWrite) throws java.io.IOException
java.io.IOException
public Job job()
Process
public boolean isTty(int fd)
Process
public void error(int error)
Process
public Pipe.Result call() throws java.lang.Exception
call
in interface java.util.concurrent.Callable<Pipe.Result>
java.lang.Exception
private Pipe.Result doCall()
private java.util.List<java.nio.file.Path> toPaths(java.lang.Object val) throws java.io.IOException
java.io.IOException
private java.nio.file.Path toPath(java.lang.Object o)
private java.nio.channels.Channel wrap(java.nio.channels.Channel channel)