FileDocCategorySizeDatePackage
Task.javaAPI DocJava SE 5 API2154Fri Aug 26 14:55:06 BST 2005com.sun.jmx.snmp.tasks

Task

public interface Task implements Runnable
This interface is implemented by objects that can be executed by a {@link com.sun.jmx.snmp.tasks.TaskServer}.

A Task object implements two methods:

  • public void run(): from {@link java.lang.Runnable}
    • This method is called by the {@link com.sun.jmx.snmp.tasks.TaskServer} when the task is executed.
  • public void cancel():
    • This method is called by the {@link com.sun.jmx.snmp.tasks.TaskServer} if the TaskServer is stopped before the Task is executed.
An implementation of {@link com.sun.jmx.snmp.tasks.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.

This API is a Sun Microsystems internal API and is subject to change without notice.

see
com.sun.jmx.snmp.tasks.TaskServer
since
1.5

Fields Summary
Constructors Summary
Methods Summary
public voidcancel()
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.