com.faunos.util.cc
Interface Scheduler

All Known Implementing Classes:
CompoundScheduler

public interface Scheduler

An interface for interacting with an ExecutorService. A thread pool (ExecutorService) often encapsulates a set of background tasks. In many concurrent designs, these background tasks are themselves created and scheduled for execution by special background tasks dedicated to finding and scheduling the work. This interface is an abstraction of that scheduling task.

Author:
Babak Farhang

Method Summary
 int inProgressCount()
          Returns the number of tasks scheduled by this instance that have yet to complete.
 int schedule(ExecutorService service)
          Schedules work on the given ExecutorService.
 

Method Detail

schedule

int schedule(ExecutorService service)
Schedules work on the given ExecutorService.

Returns:
the number of new tasks (possibly zero) scheduled on this invocation, or -1 if this scheduler will not schedule any more tasks

inProgressCount

int inProgressCount()
Returns the number of tasks scheduled by this instance that have yet to complete.



SourceForge.net Logo