org.apache.qpid.pool
Class ReadWriteJobQueue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<Runnable>
          extended by org.apache.qpid.pool.ReadWriteJobQueue
All Implemented Interfaces:
Iterable<Runnable>, Collection<Runnable>, BlockingQueue<Runnable>, Queue<Runnable>

public class ReadWriteJobQueue
extends AbstractQueue<Runnable>
implements BlockingQueue<Runnable>


Constructor Summary
ReadWriteJobQueue()
           
 
Method Summary
 int drainTo(Collection<? super Runnable> c)
           
 int drainTo(Collection<? super Runnable> c, int maxElements)
           
 Iterator<Runnable> iterator()
           
 boolean offer(Runnable runnable)
           
 boolean offer(Runnable runnable, long timeout, TimeUnit unit)
           
 Runnable peek()
           
 Runnable poll()
           
 Runnable poll(long timeout, TimeUnit unit)
           
 void put(Runnable runnable)
           
 int remainingCapacity()
           
 int size()
           
 Runnable take()
           
 
Methods inherited from class java.util.AbstractQueue
add, addAll, clear, element, remove
 
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
 
Methods inherited from interface java.util.concurrent.BlockingQueue
add, contains, remove
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

ReadWriteJobQueue

public ReadWriteJobQueue()
Method Detail

iterator

public Iterator<Runnable> iterator()
Specified by:
iterator in interface Iterable<Runnable>
Specified by:
iterator in interface Collection<Runnable>
Specified by:
iterator in class AbstractCollection<Runnable>

size

public int size()
Specified by:
size in interface Collection<Runnable>
Specified by:
size in class AbstractCollection<Runnable>

offer

public boolean offer(Runnable runnable)
Specified by:
offer in interface BlockingQueue<Runnable>
Specified by:
offer in interface Queue<Runnable>

put

public void put(Runnable runnable)
         throws InterruptedException
Specified by:
put in interface BlockingQueue<Runnable>
Throws:
InterruptedException

offer

public boolean offer(Runnable runnable,
                     long timeout,
                     TimeUnit unit)
              throws InterruptedException
Specified by:
offer in interface BlockingQueue<Runnable>
Throws:
InterruptedException

take

public Runnable take()
              throws InterruptedException
Specified by:
take in interface BlockingQueue<Runnable>
Throws:
InterruptedException

poll

public Runnable poll(long timeout,
                     TimeUnit unit)
              throws InterruptedException
Specified by:
poll in interface BlockingQueue<Runnable>
Throws:
InterruptedException

remainingCapacity

public int remainingCapacity()
Specified by:
remainingCapacity in interface BlockingQueue<Runnable>

drainTo

public int drainTo(Collection<? super Runnable> c)
Specified by:
drainTo in interface BlockingQueue<Runnable>

drainTo

public int drainTo(Collection<? super Runnable> c,
                   int maxElements)
Specified by:
drainTo in interface BlockingQueue<Runnable>

poll

public Runnable poll()
Specified by:
poll in interface Queue<Runnable>

peek

public Runnable peek()
Specified by:
peek in interface Queue<Runnable>


Licensed to the Apache Software Foundation