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 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, ornull
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.
-
-
-
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, ornull
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.
-
batchLoad
public void batchLoad(List<J> jobEntries)
Batch load jobs. Retains any already enqueued jobs. Called onSchedulerService
start-up.- Parameters:
jobEntries
- A list of theJobEntry
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.
-
-