Class 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
    • Field Summary

      Fields 
      Modifier and Type Field 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  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • CURRENT

        private static final java.lang.ThreadLocal<Pipe> CURRENT
      • job

        final Job job
      • 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
    • Method Detail

      • getCurrentPipe

        public static Pipe getCurrentPipe()
      • setCurrentPipe

        private static Pipe setCurrentPipe​(Pipe pipe)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setStream

        private void setStream​(java.nio.channels.Channel ch,
                               int fd,
                               int readWrite)
      • in

        public java.io.InputStream in()
        Specified by:
        in in interface Process
      • out

        public java.io.PrintStream out()
        Specified by:
        out in interface Process
      • err

        public java.io.PrintStream err()
        Specified by:
        err in interface Process
      • job

        public Job job()
        Description copied from interface: Process
        Get the job controlling this process
        Specified by:
        job in interface Process
      • isTty

        public boolean isTty​(int fd)
        Description copied from interface: Process
        Check if the given descriptor for the currently running pipe is the terminal or not.
        Specified by:
        isTty in interface Process
      • error

        public void error​(int error)
        Description copied from interface: Process
        Set the error code for the currently running pipe.
        Specified by:
        error in interface Process
      • call

        public Pipe.Result call()
        Specified by:
        call in interface java.util.concurrent.Callable<Pipe.Result>
      • 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)