Class CommandSessionImpl.JobImpl

  • All Implemented Interfaces:
    java.lang.Runnable, Job
    Enclosing class:
    CommandSessionImpl

    class CommandSessionImpl.JobImpl
    extends java.lang.Object
    implements Job, java.lang.Runnable
    • Field Detail

      • id

        private final int id
      • command

        private final java.lang.CharSequence command
      • pipes

        private final java.util.List<Pipe> pipes
      • children

        private final java.util.List<Job> children
      • future

        private java.util.concurrent.Future<?> future
    • Method Detail

      • addPipe

        void addPipe​(Pipe pipe)
      • id

        public int id()
        Specified by:
        id in interface Job
      • command

        public java.lang.CharSequence command()
        Specified by:
        command in interface Job
      • suspend

        public void suspend()
        Specified by:
        suspend in interface Job
      • background

        public void background()
        Specified by:
        background in interface Job
      • foreground

        public void foreground()
        Specified by:
        foreground in interface Job
      • interrupt

        public void interrupt()
        Specified by:
        interrupt in interface Job
      • done

        protected void done()
      • setStatus

        private void setStatus​(Job.Status newStatus)
      • setStatus

        private void setStatus​(Job.Status newStatus,
                               boolean callListeners)
      • parent

        public Job parent()
        Specified by:
        parent in interface Job
      • start

        public Pipe.Result start​(Job.Status status)
                          throws java.lang.InterruptedException
        Start the job. If the job is started in foreground, waits for the job to finish or to be suspended or moved to background.
        Parameters:
        status - the desired job status
        Returns:
        null if the job has been suspended or moved to background,
        Throws:
        java.lang.InterruptedException
      • processes

        public java.util.List<Process> processes()
        Specified by:
        processes in interface Job
      • run

        public void run()
        Specified by:
        run in interface java.lang.Runnable
      • add

        public void add​(Job child)