org.glassfish.grizzly.asyncqueue
Class TaskQueue.QueueMonitor

java.lang.Object
  extended by org.glassfish.grizzly.asyncqueue.TaskQueue.QueueMonitor
Enclosing class:
TaskQueue<E>

public abstract static class TaskQueue.QueueMonitor
extends java.lang.Object

Notification mechanism which will be invoked when TaskQueue.releaseSpace(int) or TaskQueue.releaseSpaceAndNotify(int) is called.


Constructor Summary
TaskQueue.QueueMonitor()
           
 
Method Summary
abstract  void onNotify()
          Action(s) to perform when the current queue space meets the conditions mandated by shouldNotify().
abstract  boolean shouldNotify()
          This method will be invoked to determine if onNotify() should be called.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TaskQueue.QueueMonitor

public TaskQueue.QueueMonitor()
Method Detail

onNotify

public abstract void onNotify()
                       throws java.io.IOException
Action(s) to perform when the current queue space meets the conditions mandated by shouldNotify().

Throws:
java.io.IOException

shouldNotify

public abstract boolean shouldNotify()
This method will be invoked to determine if onNotify() should be called. It's recommended that implementations of this method be as light-weight as possible as this method may be invoked multiple times.

Returns:
true if onNotify() should be invoked on this QueueMonitor at the point in time shouldNotify was called, otherwise returns false


Copyright © 2011 Oracle Corpration. All Rights Reserved.