Package org.apache.felix.gogo.runtime
Class Pipe
- java.lang.Object
-
- org.apache.felix.gogo.runtime.Pipe
-
- All Implemented Interfaces:
java.util.concurrent.Callable<Pipe.Result>,Process
public class Pipe extends java.lang.Object implements java.util.concurrent.Callable<Pipe.Result>, Process
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private classPipe.MultiChannelprivate classPipe.RefByteChannelstatic classPipe.Result-
Nested classes/interfaces inherited from interface org.apache.felix.service.command.Process
Process.Utils
-
-
Field Summary
Fields Modifier and Type Field Description (package private) Closureclosureprivate static java.lang.ThreadLocal<Pipe>CURRENT(package private) booleanendOfPipe(package private) java.io.PrintStreamerr(package private) interror(package private) java.io.InputStreamin(package private) Jobjob(package private) java.io.PrintStreamoutprivate static intREAD(package private) Parser.Statementstatement(package private) java.nio.channels.Channel[]streams(package private) boolean[]tocloseprivate static intWRITE
-
Constructor Summary
Constructors Constructor Description Pipe(Closure closure, CommandSessionImpl.JobImpl job, Parser.Statement statement, java.nio.channels.Channel[] streams, boolean[] toclose, boolean endOfPipe)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Pipe.Resultcall()private Pipe.ResultdoCall()java.io.PrintStreamerr()voiderror(int error)Set the error code for the currently running pipe.static PipegetCurrentPipe()java.io.InputStreamin()booleanisTty(int fd)Check if the given descriptor for the currently running pipe is the terminal or not.Jobjob()Get the job controlling this processjava.io.PrintStreamout()private static PipesetCurrentPipe(Pipe pipe)private voidsetStream(java.nio.channels.Channel ch, int fd, int readWrite)private java.nio.file.PathtoPath(java.lang.Object o)private java.util.List<java.nio.file.Path>toPaths(java.lang.Object val)java.lang.StringtoString()private java.nio.channels.Channelwrap(java.nio.channels.Channel channel)
-
-
-
Field Detail
-
CURRENT
private static final java.lang.ThreadLocal<Pipe> CURRENT
-
closure
final Closure closure
-
job
final Job job
-
statement
final Parser.Statement statement
-
streams
final java.nio.channels.Channel[] streams
-
toclose
final boolean[] toclose
-
endOfPipe
final boolean endOfPipe
-
error
int error
-
in
java.io.InputStream in
-
out
java.io.PrintStream out
-
err
java.io.PrintStream err
-
READ
private static final int READ
- See Also:
- Constant Field Values
-
WRITE
private static final int WRITE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Pipe
public Pipe(Closure closure, CommandSessionImpl.JobImpl job, Parser.Statement statement, java.nio.channels.Channel[] streams, boolean[] toclose, boolean endOfPipe)
-
-
Method Detail
-
getCurrentPipe
public static Pipe getCurrentPipe()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setStream
private void setStream(java.nio.channels.Channel ch, int fd, int readWrite)
-
job
public Job job()
Description copied from interface:ProcessGet the job controlling this process
-
isTty
public boolean isTty(int fd)
Description copied from interface:ProcessCheck if the given descriptor for the currently running pipe is the terminal or not.
-
error
public void error(int error)
Description copied from interface:ProcessSet the error code for the currently running pipe.
-
call
public Pipe.Result call()
- Specified by:
callin interfacejava.util.concurrent.Callable<Pipe.Result>
-
doCall
private Pipe.Result doCall()
-
toPaths
private java.util.List<java.nio.file.Path> toPaths(java.lang.Object val) throws java.io.IOException- Throws:
java.io.IOException
-
toPath
private java.nio.file.Path toPath(java.lang.Object o)
-
wrap
private java.nio.channels.Channel wrap(java.nio.channels.Channel channel)
-
-