org.apache.turbine.services.schedule
Class JobQueue

java.lang.Object
  extended byorg.apache.turbine.services.schedule.JobQueue

public class JobQueue
extends java.lang.Object

Queue for the scheduler.

Version:
$Id: JobQueue.java 534527 2007-05-02 16:10:59Z tv $
Author:
Dave Bryson, Quinton McCombs

Constructor Summary
JobQueue()
          Creates a new instance.
 
Method Summary
 void add(JobEntry je)
          Add a job to the queue.
 void batchLoad(java.util.List jobEntries)
          Batch load jobs.
 JobEntry getJob(JobEntry je)
          Return a specific job.
 JobEntry getNext()
          Return the next job off the top of the queue, or null if there are no jobs in the queue.
 java.util.Vector list()
          List jobs in the queue.
 void modify(JobEntry je)
          Modify a job on the queue.
 void remove(JobEntry je)
          Remove a job from the queue.
 void updateQueue(JobEntry 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 JobEntry 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 JobEntry getJob(JobEntry je)
Return a specific job.

Parameters:
je - The JobEntry we are looking for.
Returns:
A JobEntry.

list

public java.util.Vector list()
List jobs in the queue. This is used by the scheduler UI.

Returns:
A Vector of JobEntry objects.

add

public void add(JobEntry je)
Add a job to the queue.

Parameters:
je - A JobEntry job.

batchLoad

public void batchLoad(java.util.List 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(JobEntry je)
Remove a job from the queue.

Parameters:
je - A JobEntry with the job to remove.

modify

public void modify(JobEntry je)
            throws TurbineException
Modify a job on the queue.

Parameters:
je - A JobEntry with the job to modify
Throws:
TurbineException

updateQueue

public void updateQueue(JobEntry 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-2008 Apache Software Foundation. All Rights Reserved.