net.sf.tacos.ajax.components
Interface ProgressWorker

All Superinterfaces:
Runnable
All Known Implementing Classes:
ProgressWorkThread

public interface ProgressWorker
extends Runnable

Used by the ProgressBar component to manage a threaded piece of work in a tapestry page.

**Note:Most of the time your worker should be stored in the server's session by specifying persist="session", but it should be noted that if the server re-starts any workers that were executing will probably not be resumed or serialized into the long-term persistant storage of the managing servlet container.

Author:
jkuhnert

Method Summary
 void cancelTask()
          Can be invoked by a user inpatient to see the request completed.
 double getCurrentProgress()
          Should represent a number value indicating the current progress value out of the total derived in getTotalProgress().
 String getCurrentStatus()
          If value not null will be used to display any textual information that may be useful to see along with the basic numeric values.
 double getTotalProgress()
          The total value that this progress represents.
 boolean isComplete()
          Should return true once the task is completed.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

getTotalProgress

public double getTotalProgress()
The total value that this progress represents. This should be specific to your task, not in terms of percent complete, as the percentage values will be calculated automatically by the ProgressBar.

Returns:
Number representing the total value for this progress bar.

getCurrentProgress

public double getCurrentProgress()
Should represent a number value indicating the current progress value out of the total derived in getTotalProgress().

Returns:
The current progress value.

getCurrentStatus

public String getCurrentStatus()
If value not null will be used to display any textual information that may be useful to see along with the basic numeric values.

Returns:
String representation of what is currently being worked on by this task.

isComplete

public boolean isComplete()
Should return true once the task is completed.

Returns:
True, if and only if the thread represented by this task is complete.

cancelTask

public void cancelTask()
Can be invoked by a user inpatient to see the request completed. Method doesn't have to cancel exactly when called, or at all, but it is expected that this method will block at least until the task is complete. Only return from this call if calling isComplete() will return true.