org.lwes.listener
Class DatagramDequeuer

java.lang.Object
  extended by org.lwes.listener.ThreadedDequeuer
      extended by org.lwes.listener.DatagramDequeuer
All Implemented Interfaces:
java.lang.Runnable

public class DatagramDequeuer
extends ThreadedDequeuer


Field Summary
 
Fields inherited from class org.lwes.listener.ThreadedDequeuer
queue
 
Constructor Summary
DatagramDequeuer()
           
 
Method Summary
protected  void handleElement(DatagramQueueElement element)
           
protected  boolean hasPending()
          Determines whether the collection of pending tasks has any elements.
 void initialize()
          Default initialize() method.
 void run()
          Default run loop.
 void shutdown()
          Default shutdown() method.
 
Methods inherited from class org.lwes.listener.ThreadedDequeuer
addHandler, addHandler, dispatchEvent, getHandler, getIdleProcessor, getMaxThreads, getQueue, makeAvailable, removeHandler, removeHandler, setMaxThreads, setQueue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatagramDequeuer

public DatagramDequeuer()
Method Detail

initialize

public void initialize()
                throws java.io.IOException
Description copied from class: ThreadedDequeuer
Default initialize() method. Should be overridden by classes extending ThreadedEnqueuer.

Overrides:
initialize in class ThreadedDequeuer
Throws:
java.io.IOException

shutdown

public void shutdown()
Description copied from class: ThreadedDequeuer
Default shutdown() method. Should be overridden by classes extending ThreadedDequeuer.

Overrides:
shutdown in class ThreadedDequeuer

run

public void run()
Description copied from class: ThreadedDequeuer
Default run loop. Should be overridden by classes extending ThreadedDequeuer

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class ThreadedDequeuer

hasPending

protected final boolean hasPending()
Determines whether the collection of pending tasks has any elements. Note that if this returns false at some point and then someone calls addTask() the state will change to true. Do not use this function to determine when there cannot be any more tasks.

Returns:
true iff there are any pending tasks.

handleElement

protected void handleElement(DatagramQueueElement element)