org.jscience.util
Interface ThreadWorker.Listener

All Superinterfaces:
java.util.EventListener
Enclosing class:
ThreadWorker

public static interface ThreadWorker.Listener
extends java.util.EventListener

listens for tasks run by a ThreadWorker to be finished


Method Summary
 void taskPerformed(java.lang.Runnable task, long timeTaken, java.lang.Throwable exceptionIfAny)
          called after ThreadWorker has finished running the task.
 

Method Detail

taskPerformed

void taskPerformed(java.lang.Runnable task,
                   long timeTaken,
                   java.lang.Throwable exceptionIfAny)
called after ThreadWorker has finished running the task. The current task is not yet removed from the queue when this method is called. The running thread has ownership over the ThreadWorker when this method is called.

Parameters:
task - the task that just finished running
timeTaken - the time (in milliseconds) it took to run the task
exceptionIfAny - if an Exception was thrown during task execution, it will be held by this parameter. This should be null if the task ended normally.