Jumpi v1.2.0

org.jumpi.spi.component
Interface TaskScheduler

All Superinterfaces:
Component, Configurable, Manageable
All Known Implementing Classes:
TaskSchedulerImpl

public interface TaskScheduler
extends Component

A TaskScheduler manages the execution of Tasks, by scheduling them to run as soon as possible. A TaskScheduler manages java Threads to perform the Task execution for as long as the Tasks are schedulable. In the interests of performance, it is expected that any threads used are pooled.

See Also:
Task

Method Summary
 void schedule(Task task)
           Schedule a Task for execution, as soon as possible.
 
Methods inherited from interface org.jumpi.spi.Configurable
configure, getName
 
Methods inherited from interface org.jumpi.spi.Manageable
manage
 

Method Detail

schedule

public void schedule(Task task)

Schedule a Task for execution, as soon as possible.

The caller must never have a lock on the task itself when calling schedule. in particular any lock which is required by the task.isSchedulable() to complete.

Parameters:
task - the Task to schedule as soon as possible.
Throws:
java.lang.IllegalArgumentException - if task is null.
java.lang.IllegalStateException - if the component is not started.

Jumpi v1.2.0

Copyright 2003, Peter Jonathan Klauser.