net.sf.doolin.gui.action.task
Class AbstractGUITask<B,R>

java.lang.Object
  extended by net.sf.doolin.gui.action.task.AbstractGUITask<B,R>
Type Parameters:
B - Type of bean sent to the task
R - Type of bean returned by the task
All Implemented Interfaces:
GUITask<B,R>
Direct Known Subclasses:
MethodGUITask

public abstract class AbstractGUITask<B,R>
extends Object
implements GUITask<B,R>

An abstract implementation for GUITask that provides a default support for the management of the exceptions.

Author:
Damien Coraboeuf

Constructor Summary
AbstractGUITask()
           
 
Method Summary
 void doOnException(ActionContext actionContext, B bean, Throwable th)
          If delegateException property is true, a RuntimeException is thrown.
 boolean isDelegateException()
          Checks if exception must be delegated to the caller.
 void setDelegateException(boolean delegateException)
          Sets if exception must be delegated to the caller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.doolin.gui.action.task.GUITask
doInBackground, doOnResult
 

Constructor Detail

AbstractGUITask

public AbstractGUITask()
Method Detail

doOnException

public void doOnException(ActionContext actionContext,
                          B bean,
                          Throwable th)
If delegateException property is true, a RuntimeException is thrown. Otherwise, the actionContext displays the error.

Specified by:
doOnException in interface GUITask<B,R>
Parameters:
actionContext - Initial action context
bean - Bean sent to the task
th - Error thrown by the task
See Also:
InfoService#error(ActionContext, Throwable, String, Object...)

isDelegateException

public boolean isDelegateException()
Checks if exception must be delegated to the caller.

Returns:
true if exception must be delegated to the caller.

setDelegateException

public void setDelegateException(boolean delegateException)
Sets if exception must be delegated to the caller.

Parameters:
delegateException - true if exception must be delegated to the caller.


Copyright © 2011. All Rights Reserved.