net.sf.mybatchfwk
Interface ITaskExecutor

All Known Implementing Classes:
PausableThreadPoolExecutor

public interface ITaskExecutor

The task executor service interface

Author:
Jérôme Bertèche (cyberteche@users.sourceforge.net)

Method Summary
 boolean execute(ITask task)
          Execute the given task, waiting for free space in blocking queue if necessary
 long getTaskCount()
          Returns the approximate total number of tasks that have been scheduled for execution.
 boolean isRunning()
          Indicate the running state of the executor (the user can shutdown this service through JMX).
 

Method Detail

execute

boolean execute(ITask task)
                throws BatchException
Execute the given task, waiting for free space in blocking queue if necessary

Parameters:
task - the task to execute
Returns:
true is the task has been added to the execution queue, false otherwise (the user can shutdown this service through JMX)
Throws:
BatchException

isRunning

boolean isRunning()
Indicate the running state of the executor (the user can shutdown this service through JMX). If false, then no more task must be execute.

Returns:
true is the service is running, false otherwise

getTaskCount

long getTaskCount()
Returns the approximate total number of tasks that have been scheduled for execution. Because the states of tasks and threads may change dynamically during computation, the returned value is only an approximation, but one that does not ever decrease across successive calls.

Returns:
the number of tasks


Copyright © 2006 null. All Rights Reserved.