com.sun.grizzly.asyncqueue
Class AsyncQueue<E>

java.lang.Object
  extended by com.sun.grizzly.asyncqueue.AsyncQueue<E>

public class AsyncQueue<E>
extends Object

Class represents common implementation of asynchronous processing queue.

Author:
Alexey Stashok

Field Summary
protected  AtomicReference<E> currentElement
          Current processing task
protected  LinkedTransferQueue<E> queue
          The queue of tasks, which will be processed asynchrounously
protected  ReentrantLock queuedActionLock
          Locker object, which could be used by a queue processors
 
Constructor Summary
AsyncQueue()
           
 
Method Summary
 AtomicReference<E> getCurrentElement()
          Get the current processing task
 LinkedTransferQueue<E> getQueue()
          Get the queue of tasks, which will be processed asynchrounously
 ReentrantLock getQueuedActionLock()
          Get the locker object, which could be used by a queue processors
 void setCurrentElement(AtomicReference<E> currentElement)
          Set the current processing task
 void setQueue(LinkedTransferQueue<E> queue)
          Set the queue of tasks, which will be processed asynchrounously
 void setQueuedActionLock(ReentrantLock queuedActionLock)
          Set the locker object, which could be used by a queue processors
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queue

protected LinkedTransferQueue<E> queue
The queue of tasks, which will be processed asynchrounously


currentElement

protected AtomicReference<E> currentElement
Current processing task


queuedActionLock

protected ReentrantLock queuedActionLock
Locker object, which could be used by a queue processors

Constructor Detail

AsyncQueue

public AsyncQueue()
Method Detail

getCurrentElement

public AtomicReference<E> getCurrentElement()
Get the current processing task

Returns:
the current processing task

setCurrentElement

public void setCurrentElement(AtomicReference<E> currentElement)
Set the current processing task

Parameters:
currentElement - the current processing task

getQueue

public LinkedTransferQueue<E> getQueue()
Get the queue of tasks, which will be processed asynchrounously

Returns:
the queue of tasks, which will be processed asynchrounously

setQueue

public void setQueue(LinkedTransferQueue<E> queue)
Set the queue of tasks, which will be processed asynchrounously

Parameters:
queue - the queue of tasks, which will be processed asynchrounously

getQueuedActionLock

public ReentrantLock getQueuedActionLock()
Get the locker object, which could be used by a queue processors

Returns:
the locker object, which could be used by a queue processors

setQueuedActionLock

public void setQueuedActionLock(ReentrantLock queuedActionLock)
Set the locker object, which could be used by a queue processors

Parameters:
queuedActionLock - the locker object, which could be used by a queue processors


Copyright © 2009 SUN Microsystems. All Rights Reserved.