1. // NPCTE fix for bugId 4510777, esc 532372, MR October 2001
  2. // file TaskServer.java created for this bug fix
  3. /*
  4. * @(#)file TaskServer.java
  5. * @(#)author Sun Microsystems, Inc.
  6. * @(#)version 1.2
  7. * @(#)date 01/10/03
  8. *
  9. * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
  10. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  11. */
  12. package com.sun.jmx.snmp.tasks;
  13. /**
  14. * This interface is implemented by objects that are able to execute
  15. * tasks. Whether the task is executed in the client thread or in another
  16. * thread depends on the TaskServer implementation.
  17. *
  18. * <p><b>This API is a Sun Microsystems internal API and is subject
  19. * to change without notice.</b></p>
  20. * @see com.sun.jmx.snmp.tasks.Task
  21. *
  22. * @since 1.5
  23. **/
  24. public interface TaskServer {
  25. /**
  26. * Submit a task to be executed.
  27. * Once a task is submitted, it is guaranteed that either
  28. * {@link com.sun.jmx.snmp.tasks.Task#run() task.run()} or
  29. * {@link com.sun.jmx.snmp.tasks.Task#cancel() task.cancel()} will be called.
  30. * <p>Whether the task is executed in the client thread (e.g.
  31. * <code>public void submitTask(Task task) { task.run(); }</code>) or in
  32. * another thread (e.g. <code>
  33. * public void submitTask(Task task) { new Thrad(task).start(); }</code>)
  34. * depends on the TaskServer implementation.
  35. * @param task The task to be executed.
  36. **/
  37. public void submitTask(Task task);
  38. }