com.samskivert.util
Interface SerialExecutor.ExecutorTask

All Known Implementing Classes:
SerialExecutorTest.Sleeper
Enclosing class:
SerialExecutor

public static interface SerialExecutor.ExecutorTask

A task to run in serial on the executor.


Method Summary
 void executeTask()
          The portion of the task that will be executed on the executor's thread.
 long getTimeout()
          Returns the number of milliseconds after which this task should be considered a lost cause.
 boolean merge(SerialExecutor.ExecutorTask other)
          This will be called when one task is on the queue to be processed and another task is going to be added to the queue.
 void resultReceived()
          After the task has been executed, this will be called on the ResultReceiver thread to post-process the results of the task.
 void timedOut()
          This method is called instead of resultReceived() if the task does not complete within the requisite time.
 

Method Detail

merge

boolean merge(SerialExecutor.ExecutorTask other)
This will be called when one task is on the queue to be processed and another task is going to be added to the queue.

Returns:
true if the tasks were merged and the other task does not need to be added to the queue.

getTimeout

long getTimeout()
Returns the number of milliseconds after which this task should be considered a lost cause. If the task times out, timedOut() will be called instead of resultReceived().


executeTask

void executeTask()
The portion of the task that will be executed on the executor's thread. This method should handle InterruptedException as meaning that the task should be aborted.


resultReceived

void resultReceived()
After the task has been executed, this will be called on the ResultReceiver thread to post-process the results of the task.


timedOut

void timedOut()
This method is called instead of resultReceived() if the task does not complete within the requisite time.



Copyright © 2000-2008 Michael Bayne. All Rights Reserved.