com.samskivert.swing.util
Class RetryableTask

java.lang.Object
  extended by com.samskivert.swing.util.RetryableTask

public abstract class RetryableTask
extends Object

A retryable task is one that is allowed to fail at which point a dialog is presented to the user asking them if they would like to retry the task. In general, such practices are discouraged because the software should handle retrying itself, but in cases where failure results in the abandonment of a lot of work and automatic retries have already been tried, it can be reasonable to give the user one last chance to remedy any problems that are causing the error.


Constructor Summary
RetryableTask()
           
 
Method Summary
abstract  void invoke()
          This should be implemented by the retryable task user to perform whatever they wish to be done in a retryable manner.
 void invokeTask(Component parent, String retryMessage)
          Invokes the supplied task and catches any thrown exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RetryableTask

public RetryableTask()
Method Detail

invoke

public abstract void invoke()
                     throws Exception
This should be implemented by the retryable task user to perform whatever they wish to be done in a retryable manner.

Throws:
Exception

invokeTask

public void invokeTask(Component parent,
                       String retryMessage)
                throws Exception
Invokes the supplied task and catches any thrown exceptions. In the event of an exception, the provided message is displayed to the user and the are allowed to retry the task or allow it to fail.

Throws:
Exception


Copyright © 2000-2008 Michael Bayne. All Rights Reserved.