com.sun.jdmk.tasks
Interface Task

All Superinterfaces:
Runnable

public interface Task
extends Runnable

This interface is implemented by objects that can be executed by a TaskServer.

A Task object implements two methods:

An implementation of TaskServer shall call either run() or cancel(). Whether the task is executed synchronously in the current thread (when calling TaskServer.submitTask() or in a new thread dedicated to the task, or in a daemon thread, depends on the implementation of the TaskServer through which the task is executed.

The implementation of Task must not make any assumption on the implementation of the TaskServer through which it will be executed.

Since:
Java DMK 5.0
See Also:
TaskServer

Method Summary
 void cancel()
          Cancel the submitted task.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

cancel

void cancel()
Cancel the submitted task. The implementation of this method is Task-implementation dependent. It could involve some message logging, or even call the run() method. Note that only one of run() or cancel() will be called - and exactly one.


Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.