com.liferay.portal.kernel.concurrent
Class TaskQueue<E>

java.lang.Object
  extended by com.liferay.portal.kernel.concurrent.TaskQueue<E>

public class TaskQueue<E>
extends java.lang.Object

Author:
Shuyang Zhou

Constructor Summary
TaskQueue()
           
TaskQueue(int capacity)
           
 
Method Summary
 int drainTo(java.util.Collection<E> collection)
           
protected  java.util.concurrent.locks.ReentrantLock getPutLock()
           
protected  java.util.concurrent.locks.ReentrantLock getTakeLock()
           
 boolean isEmpty()
           
 boolean offer(E element, boolean[] hasWaiterMarker)
           
 E poll()
           
 E poll(long timeout, java.util.concurrent.TimeUnit timeUnit)
           
 int remainingCapacity()
           
 boolean remove(E element)
           
 int size()
           
 E take()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskQueue

public TaskQueue()

TaskQueue

public TaskQueue(int capacity)
Method Detail

drainTo

public int drainTo(java.util.Collection<E> collection)

isEmpty

public boolean isEmpty()

offer

public boolean offer(E element,
                     boolean[] hasWaiterMarker)

poll

public E poll()

poll

public E poll(long timeout,
              java.util.concurrent.TimeUnit timeUnit)
       throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

remainingCapacity

public int remainingCapacity()

remove

public boolean remove(E element)

size

public int size()

take

public E take()
       throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException

getPutLock

protected java.util.concurrent.locks.ReentrantLock getPutLock()

getTakeLock

protected java.util.concurrent.locks.ReentrantLock getTakeLock()