// NPCTE fix for bugId 4510777, esc 532372, MR October 2001 // file Task.java created for this bug fix /* * @(#)file Task.java * @(#)author Sun Microsystems, Inc. * @(#)version 1.2 * @(#)date 01/10/03 * * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. */ package com.sun.jmx.snmp.tasks; /** * 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}public void cancel():
TaskServer
is stopped before the
* Task
is executed.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 **/ public interface Task extends Runnable { /** * 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. **/ public void cancel(); }