org.glassbox.executor
Class TaskQueue

java.lang.Object
  extended by org.glassbox.executor.TaskQueue
All Implemented Interfaces:
Executor
Direct Known Subclasses:
StatusBarExecutor, VisibleExecutor

public class TaskQueue
extends java.lang.Object
implements Executor

This is a variation of Eric Crahen's ConcurrentExecutor. The executor pattern was published by Eric Crahen. Take a look at his paper to learn more about it.


Field Summary
protected  Handler handler
           
protected  java.util.LinkedList queue
           
protected  java.lang.Thread runner
           
 
Constructor Summary
TaskQueue()
           
TaskQueue(Handler handler)
           
 
Method Summary
 void execute(java.lang.Runnable task)
           
protected  boolean isEmpty()
           
protected  void setHandler(Handler handler)
           
protected  void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

queue

protected java.util.LinkedList queue

handler

protected Handler handler

runner

protected java.lang.Thread runner
Constructor Detail

TaskQueue

public TaskQueue()

TaskQueue

public TaskQueue(Handler handler)
Method Detail

execute

public void execute(java.lang.Runnable task)
Specified by:
execute in interface Executor

setHandler

protected void setHandler(Handler handler)

isEmpty

protected boolean isEmpty()

stop

protected void stop()


Copyright © 2005-2010 The K-Wf Grid Consortium. All Rights Reserved.