Jumpi v1.2.0

org.jumpi.spi.component
Interface Task

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
AbstractConnector, LoopbackConnector, OrderingController, TcpConnection, TcpConnectionAcceptor, TcpConnector, TimerImpl, UdpConnector, UdpTransceiver

public interface Task
extends java.lang.Runnable

A Task is a unit of work which is scheduled by the TaskScheduler to execute. The task informs the TaskScheduler whether it is schedulable or not with isSchedulable(). Tasks are named uniquely so that the TaskScheduler can identify them unambiguously.

See Also:
TaskScheduler

Method Summary
 java.lang.String getTaskId()
          A unique name for the task in the VM.
 boolean isLongRunning()
          Whether the task is a long running task or not.
 boolean isSchedulable()
          Whether the task is schedulable, i.e. run() should be called because there is work to do.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getTaskId

public java.lang.String getTaskId()
A unique name for the task in the VM.

Returns:
a unique name for the task in the VM.

isSchedulable

public boolean isSchedulable()
Whether the task is schedulable, i.e. run() should be called because there is work to do.

Returns:
true if the task is schedulable, else false.

isLongRunning

public boolean isLongRunning()
Whether the task is a long running task or not. Long running tasks are assigned their own thread to run the task. The long running status is invariant and may not change throughout the lifetime of the task. Long is considered to be in the order of seconds or more.

Returns:
true if the task work takes a time in the order of seconds or more to complete, else false.

Jumpi v1.2.0

Copyright 2003, Peter Jonathan Klauser.