blob: 0a5fe11de794840117cdd7e9d05d255aa8038f6d [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001// NPCTE fix for bugId 4510777, esc 532372, MR October 2001
2// file TaskServer.java created for this bug fix
3
4/*
5 * Copyright 2002-2003 Sun Microsystems, Inc. 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. Sun designates this
11 * particular file as subject to the "Classpath" exception as provided
12 * by Sun 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
25 * CA 95054 USA or visit www.sun.com if you need additional information or
26 * have any questions.
27 */
28
29
30package 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 **/
43public 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}