com.mindbright.nio
Class NQueue

java.lang.Object
  extended by com.mindbright.nio.NQueue

public class NQueue
extends java.lang.Object

Queue to use together with nio handling. This is a first-in first-out queue where handling can be stopped. The handling of objects is started automatically when the queue is created.

See Also:
NQueueCallback

Constructor Summary
NQueue(NQueueCallback callback)
          Create a new queue which is going to use the provided switchboard and call the provided callback with new objects.
 
Method Summary
 void append(java.lang.Object obj)
          Append an object to the tail of this queue
 void restart()
          Resume handling of objects.
 void stop()
          Stop the processing of objects on this queue.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NQueue

public NQueue(NQueueCallback callback)
Create a new queue which is going to use the provided switchboard and call the provided callback with new objects.

Parameters:
callback - interface to call once new object arrive
Method Detail

append

public void append(java.lang.Object obj)
Append an object to the tail of this queue

Parameters:
obj - object to append

stop

public void stop()
Stop the processing of objects on this queue. This just means that new objects are "queued" up instead of beeing processed.


restart

public void restart()
Resume handling of objects. This will release all objects on the queue at the moment.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object