org.apache.turbine.services.schedule

## Class JobQueue<J extends JobEntry>

- java.lang.Object
- - org.apache.turbine.services.schedule.JobQueue<J>

- Type Parameters:
    `J` - a specialized job entry type

      public class JobQueue<J extends JobEntry>
      extends Object

  Queue for the scheduler.
  Version:
    $Id: JobQueue.java 615328 2008-01-25 20:25:05Z tv $
  Author:
    Dave Bryson, Quinton McCombs

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JobQueue()` Creates a new instance.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(J je)` Add a job to the queue.
    `void` | `batchLoad(List<J> jobEntries)` Batch load jobs.
    `J` | `getJob(J je)` Return a specific job.
    `J` | `getNext()` Return the next job off the top of the queue, or `null` if there are no jobs in the queue.
    `Vector<J>` | `list()` List jobs in the queue.
    `void` | `modify(J je)` Modify a job on the queue.
    `void` | `remove(J je)` Remove a job from the queue.
    `void` | `updateQueue(J je)` Update the job for its next run time.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JobQueue

          public JobQueue()

      Creates a new instance.

  - ### Method Detail

    - #### getNext

          public J getNext()

      Return the next job off the top of the queue, or `null` if there are no jobs in the queue.
      Returns:
        The next job in the queue.

    - #### getJob

          public J getJob(J je)

      Return a specific job.
      Parameters:
        `je` - The JobEntry we are looking for.
      Returns:
        A JobEntry.

    - #### list

          public Vector<J> list()

      List jobs in the queue. This is used by the scheduler UI.
      Returns:
        A Vector of `JobEntry` objects.

    - #### add

          public void add(J je)

      Add a job to the queue.
      Parameters:
        `je` - A JobEntry job.

    - #### batchLoad

          public void batchLoad(List<J> jobEntries)

      Batch load jobs. Retains any already enqueued jobs. Called on `SchedulerService` start-up.
      Parameters:
        `jobEntries` - A list of the `JobEntry` objects to load.

    - #### remove

          public void remove(J je)

      Remove a job from the queue.
      Parameters:
        `je` - A JobEntry with the job to remove.

    - #### modify

          public void modify(J je)
                      throws TurbineException

      Modify a job on the queue.
      Parameters:
        `je` - A JobEntry with the job to modify
      Throws:
        `TurbineException` - if the runtime calculation fails

    - #### updateQueue

          public void updateQueue(J je)
                           throws TurbineException

      Update the job for its next run time.
      Parameters:
        `je` - A JobEntry to be updated.
      Throws:
        `TurbineException` - a generic exception.

Copyright © 2000–2018 The Apache Software Foundation. All rights reserved.