Interface Job

  • All Known Implementing Classes:
    DefaultJob

    public interface Job
    Represents a job in the shell's job control system.

    A job tracks the execution of a command, including its lifecycle status. Jobs can be in foreground, background, suspended, or done states.

    Since:
    4.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Job.Status
      Job lifecycle status.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String command()
      Returns the command string associated with this job.
      long id()
      Returns the unique identifier for this job.
      void interrupt()
      Interrupts this job.
      void resume​(boolean foreground)
      Resumes this job.
      Job.Status status()
      Returns the current status of this job.
      void suspend()
      Suspends this job.
    • Method Detail

      • id

        long id()
        Returns the unique identifier for this job.
        Returns:
        the job id
      • command

        java.lang.String command()
        Returns the command string associated with this job.
        Returns:
        the command string
      • status

        Job.Status status()
        Returns the current status of this job.
        Returns:
        the job status
      • interrupt

        void interrupt()
        Interrupts this job.
      • suspend

        void suspend()
        Suspends this job.
      • resume

        void resume​(boolean foreground)
        Resumes this job.
        Parameters:
        foreground - if true, resume in foreground; otherwise resume in background