net.sourceforge.hiveutils.service
Interface AsynchronousTaskPerformer

All Known Implementing Classes:
AsynchronousTaskPerformerImpl

public interface AsynchronousTaskPerformer

Service executing tasks asynchronously. A task is an instance of any class implementing java.lang.Runnable.

This service must use the singleton service model.

Author:
Jean-Francois Poilpret

Method Summary
 void addTask(java.lang.Runnable task)
          Add a task to be executed asynchroneously.
 void executeNow()
          This method forces execution of all pending tasks.
 void executeNowAndWait()
          This method forces execution of all pending tasks.
 

Method Detail

addTask

void addTask(java.lang.Runnable task)
Add a task to be executed asynchroneously.

Parameters:
task - task to be added to the list of asynchroneous tasks

executeNow

void executeNow()
This method forces execution of all pending tasks. Note that the method does not wait until all pending tasks have finished executing before it returns.


executeNowAndWait

void executeNowAndWait()
This method forces execution of all pending tasks. Note that the method waits until all pending tasks have finished executing before it returns.