|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.asyncqueue.TaskQueue<E>
public final class TaskQueue<E>
Class represents common implementation of asynchronous processing queue.
| Nested Class Summary | |
|---|---|
static interface |
TaskQueue.MutableMaxQueueSize
|
| Field Summary | |
|---|---|
protected java.util.Queue<org.glassfish.grizzly.asyncqueue.TaskQueue.WriteHandlerQueueRecord> |
writeHandlersQueue
|
| Constructor Summary | |
|---|---|
protected |
TaskQueue(TaskQueue.MutableMaxQueueSize maxQueueSizeHolder)
|
| Method Summary | ||
|---|---|---|
static
|
createTaskQueue(TaskQueue.MutableMaxQueueSize maxQueueSizeHolder)
|
|
protected void |
doNotify()
|
|
boolean |
forgetWritePossible(WriteHandler writeHandler)
|
|
java.util.Queue<E> |
getQueue()
Get the queue of tasks, which will be processed asynchronously |
|
java.util.concurrent.atomic.AtomicInteger |
getRefusedBytes()
Get refused bytes counter. |
|
boolean |
isEmpty()
|
|
void |
notifyWritePossible(WriteHandler writeHandler,
int size)
|
|
E |
obtainCurrentElement()
Get the current processing task, if the current in not set, take the task from the queue. |
|
E |
obtainCurrentElementAndReserve()
Gets the current processing task and reserves its place. |
|
void |
offer(E task)
Add the new task into the task queue. |
|
void |
onClose()
|
|
int |
releaseSpace(int amount)
Releases memory space in the queue. |
|
int |
releaseSpaceAndNotify(int amount)
Releases memory space in the queue and notifies registered QueueMonitors about the update. |
|
boolean |
remove(E task)
Remove the task from queue. |
|
int |
reserveSpace(int amount)
Reserves memory space in the queue. |
|
void |
setCurrentElement(E task)
Set current task element. |
|
int |
spaceInBytes()
Returns the number of queued bytes. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.Queue<org.glassfish.grizzly.asyncqueue.TaskQueue.WriteHandlerQueueRecord> writeHandlersQueue
| Constructor Detail |
|---|
protected TaskQueue(TaskQueue.MutableMaxQueueSize maxQueueSizeHolder)
| Method Detail |
|---|
public static <E> TaskQueue<E> createTaskQueue(TaskQueue.MutableMaxQueueSize maxQueueSizeHolder)
public int reserveSpace(int amount)
public int releaseSpace(int amount)
public int releaseSpaceAndNotify(int amount)
QueueMonitors about the update.
public int spaceInBytes()
public java.util.concurrent.atomic.AtomicInteger getRefusedBytes()
public E obtainCurrentElement()
public E obtainCurrentElementAndReserve()
public java.util.Queue<E> getQueue()
public void notifyWritePossible(WriteHandler writeHandler,
int size)
public final boolean forgetWritePossible(WriteHandler writeHandler)
protected void doNotify()
public void setCurrentElement(E task)
task - current element.public boolean remove(E task)
task - the task to remove.
public void offer(E task)
task - new task.public boolean isEmpty()
public void onClose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||