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 enum 
    Job lifecycle status.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the command string associated with this job.
    long
    id()
    Returns the unique identifier for this job.
    void
    Interrupts this job.
    void
    resume(boolean foreground)
    Resumes this job.
    Returns the current status of this job.
    void
    Suspends this job.
  • Method Details

    • id

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

      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