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 Description JobQueue()Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(J je)Add a job to the queue.voidbatchLoad(List<J> jobEntries)Batch load jobs.JgetJob(J je)Return a specific job.JgetNext()Return the next job off the top of the queue, ornullif there are no jobs in the queue.Vector<J>list()List jobs in the queue.voidmodify(J je)Modify a job on the queue.voidremove(J je)Remove a job from the queue.voidupdateQueue(J je)Update the job for its next run time.
-
-
-
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, ornullif 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
JobEntryobjects.
-
batchLoad
public void batchLoad(List<J> jobEntries)
Batch load jobs. Retains any already enqueued jobs. Called onSchedulerServicestart-up.- Parameters:
jobEntries- A list of theJobEntryobjects 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.
-
-