//
// $Id: Task.java,v 1.1 2000/12/06 03:25:19 mdb Exp $

package com.samskivert.swing.util;

/**
 * A swing application requests that a task be invoked by the task
 * master. The task master invokes the task on a separate thread and
 * informs the swing application when the task has completed via the task
 * observer interface. It does so in a way that plays nicely with the
 * swing event dispatch thread (the swing application is notified of the
 * task's completion on the event dispatch thread so that it can wiggle
 * its user interface elements to its heart's desire).
 */
public interface Task
{
    /**
     * This method is called by the task master to invoke the task. The
     * task should run to completion and return some value.
     */
    public Object invoke ();

    /**
     * This method is called by the task master when it has received a
     * request to cancel this task. If the task can be cancelled, abort
     * should return true and the currently running call to
     * <code>invoke()</code> should immediately return (the return value
     * will be ignored). If the task cannot be cancelled, abort should
     * return false and the task master will simply abandon the task and
     * the thread on which it is running.
     */
    public boolean abort ();
}

@@ -18,17 +18,17 @@
 ava,v 1.
-1
+2
  2000/12
@@ -33,18 +33,18 @@
 12/0
-6 03:25:19
+7 05:41:30
  mdb
@@ -774,16 +774,33 @@
 nvoke ()
+ throws Exception
 ;%0A%0A    /

Allow tasks to throw an exception so that it can be caught and passed to the task observer.