Package ai.preferred.venom.job
Class FIFOJobQueue
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractQueue<Job>
-
- ai.preferred.venom.job.AbstractJobQueue
-
- ai.preferred.venom.job.FIFOJobQueue
-
- All Implemented Interfaces:
java.lang.Iterable<Job>
,java.util.Collection<Job>
,java.util.concurrent.BlockingQueue<Job>
,java.util.Queue<Job>
- Direct Known Subclasses:
FIFOQueueScheduler
public class FIFOJobQueue extends AbstractJobQueue
This class provides and implementation of scheduler with a first in first out queue.Jobs in queue will be processed first in order of insertion.
- Author:
- Ween Jiann Lee
-
-
Constructor Summary
Constructors Constructor Description FIFOJobQueue()
Constructs an instance of FIFOJobQueue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
offer(Job job)
boolean
offer(Job job, long timeout, java.util.concurrent.TimeUnit unit)
Job
poll()
Job
poll(long timeout, java.util.concurrent.TimeUnit unit)
void
put(Job job)
-
Methods inherited from class ai.preferred.venom.job.AbstractJobQueue
drainTo, drainTo, getQueue, iterator, peek, remainingCapacity, size, take
-
Methods inherited from class java.util.AbstractCollection
contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
-
-
-
Method Detail
-
put
public final void put(@Nonnull Job job) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
offer
public final boolean offer(Job job, long timeout, @Nonnull java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
offer
public final boolean offer(@Nonnull Job job)
-
poll
public final Job poll(long timeout, @Nonnull java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
poll
public final Job poll()
-
-