Class JobQueue
java.lang.Object
net.officefloor.frame.impl.spi.team.JobQueue
Queue of
Job instances.- Author:
- Daniel Sagenschneider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondequeue()Thread-safe dequeuing the nextJobto execute.dequeue(long timeout) Thread-safe dequeuing the nextJobto execute.voidThread-safe enqueues aJobto the queue.booleanisEmpty()Indicates if noJobinstances within the queue.voidwaitForTask(long timeout) Waits the input period of time for anotherJobto be added.voidwakeUp()Wakes up waiting on aJob.
-
Constructor Details
-
JobQueue
public JobQueue()Initiate with private lock. -
JobQueue
Initiate.- Parameters:
lock- Lock for coordinating thisJobQueue.
-
-
Method Details
-
isEmpty
public boolean isEmpty()Indicates if noJobinstances within the queue.- Returns:
- No
Jobinstances within the queue.
-
enqueue
Thread-safe enqueues aJobto the queue.- Parameters:
job-Jobto add to the queue.
-
dequeue
Thread-safe dequeuing the nextJobto execute. -
dequeue
-
wakeUp
public void wakeUp()Wakes up waiting on aJob. -
waitForTask
public void waitForTask(long timeout) Waits the input period of time for anotherJobto be added.- Parameters:
timeout- Time to wait in milliseconds.
-