1 // NPCTE fix for bugId 4510777, esc 532372, MR October 2001
   2 // file TaskServer.java created for this bug fix
   3 
   4 /*
   5  * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved.
   6  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   7  *
   8  * This code is free software; you can redistribute it and/or modify it
   9  * under the terms of the GNU General Public License version 2 only, as
  10  * published by the Free Software Foundation.  Oracle designates this
  11  * particular file as subject to the "Classpath" exception as provided
  12  * by Oracle in the LICENSE file that accompanied this code.
  13  *
  14  * This code is distributed in the hope that it will be useful, but WITHOUT
  15  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  17  * version 2 for more details (a copy is included in the LICENSE file that
  18  * accompanied this code).
  19  *
  20  * You should have received a copy of the GNU General Public License version
  21  * 2 along with this work; if not, write to the Free Software Foundation,
  22  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  23  *
  24  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  25  * or visit www.oracle.com if you need additional information or have any
  26  * questions.
  27  */
  28 
  29 
  30 package com.sun.jmx.snmp.tasks;
  31 
  32 /**
  33  * This interface is implemented by objects that are able to execute
  34  * tasks. Whether the task is executed in the client thread or in another
  35  * thread depends on the TaskServer implementation.
  36  *
  37  * <p><b>This API is a Sun Microsystems internal API  and is subject
  38  * to change without notice.</b></p>
  39  * @see com.sun.jmx.snmp.tasks.Task
  40  *
  41  * @since 1.5
  42  **/
  43 public interface TaskServer {
  44     /**
  45      * Submit a task to be executed.
  46      * Once a task is submitted, it is guaranteed that either
  47      * {@link com.sun.jmx.snmp.tasks.Task#run() task.run()} or
  48      * {@link com.sun.jmx.snmp.tasks.Task#cancel() task.cancel()} will be called.
  49      * <p>Whether the task is executed in the client thread (e.g.
  50      * <code>public void submitTask(Task task) { task.run(); }</code>) or in
  51      * another thread (e.g. <code>
  52      * public void submitTask(Task task) { new Thrad(task).start(); }</code>)
  53      * depends on the TaskServer implementation.
  54      * @param task The task to be executed.
  55      **/
  56     public void submitTask(Task task);
  57 }