net.sf.doolin.gui.action.task
Interface GUITask<B,R>

Type Parameters:
B - Type of bean sent to the task
R - Type of bean returned by the task
All Known Implementing Classes:
AbstractGUITask, MethodGUITask

public interface GUITask<B,R>

Defines a task that can run in a GUI application. It is not run directly but launched and monitored by a GUITaskExecutor.

Author:
Damien Coraboeuf

Method Summary
 R doInBackground(ActionContext actionContext, B bean)
          Performs the main task, outside of the EDT.
 void doOnException(ActionContext actionContext, B bean, Throwable th)
          This method is called by the task executor whenever that task has returned an error
 void doOnResult(ActionContext actionContext, B bean, R result)
          This method is called on the EDT when the task has completed its work.
 

Method Detail

doInBackground

R doInBackground(ActionContext actionContext,
                 B bean)
                 throws Exception
Performs the main task, outside of the EDT.

Parameters:
actionContext - Initial action context
bean - Bean sent to the task
Returns:
Bean returned by the task
Throws:
Exception - In case of failure

doOnException

void doOnException(ActionContext actionContext,
                   B bean,
                   Throwable th)
This method is called by the task executor whenever that task has returned an error

Parameters:
actionContext - Initial action context
bean - Bean sent to the task
th - Error thrown by the task

doOnResult

void doOnResult(ActionContext actionContext,
                B bean,
                R result)
This method is called on the EDT when the task has completed its work.

Parameters:
actionContext - Initial action context
bean - Bean sent to the task
result - Bean returned by the task


Copyright © 2011. All Rights Reserved.