Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.util
Interface PollableRunnable

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
AbstractPollableRunnable, AbstractReportRunner, AttachmentUpgradeTask, DbDataExport, DbDataImport, ForumsReportRunner, QuickStats.QuickStatsGenerator, WikiSyntaxEscapeTask

public interface PollableRunnable
extends java.lang.Runnable

A simple extension of the Runnable class which adds the ability for a runnable to be monitored much like a progress meter. In fact, the design of the methods is borrowed from the JProgressBar class.


Method Summary
 void cancel()
          A method to cancel execution of the task.
 java.util.Date getEndDate()
          Returns the date the task ended.
 double getPercentComplete()
          Returns the percent complete of the task as a double value between 0.0 and 100.0.
 java.util.Date getStartDate()
          Returns the date the task was started.
 int getTaskMaximum()
          Returns the maximum value of task progress (default is 100).
 int getTaskMinimum()
          Returns the minimum value of task progress (default is 0).
 int getTaskValue()
          Returns the current value of the task's progress.
 boolean isFinished()
          A simple call back method which will be called when the task has completed.
 boolean isIndeterminate()
          Returns true if we are unable to determine the progress being made, false othewise.
 boolean isRunning()
          Returns true if the task is running, false otherwise.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

isRunning

boolean isRunning()
Returns true if the task is running, false otherwise.

Returns:
true if the task is running, false otherwise.

getTaskMinimum

int getTaskMinimum()
Returns the minimum value of task progress (default is 0). If this is in indeterminate mode then this will return -1.

Returns:
the minimum value of task progress.

getTaskMaximum

int getTaskMaximum()
Returns the maximum value of task progress (default is 100). If this is in indeterminate mode then this will return -1.

Returns:
the maximum value of task progress.

getTaskValue

int getTaskValue()
Returns the current value of the task's progress. This will be x where min <= x <= max. If this is in indeterminate mode then this will return -1.

Returns:
the current value of the task's progress.

getStartDate

java.util.Date getStartDate()
Returns the date the task was started.

Returns:
the date the task was started.

getEndDate

java.util.Date getEndDate()
Returns the date the task ended.

Returns:
the date the task ended.

getPercentComplete

double getPercentComplete()
Returns the percent complete of the task as a double value between 0.0 and 100.0. If this is an indeterminate mode then this will return -1.

Returns:
the percent complete of the task.

isIndeterminate

boolean isIndeterminate()
Returns true if we are unable to determine the progress being made, false othewise. This is useful to use when progress can't be determined but some indication of activity needs to be displayed.

Returns:
true if we are unable to determine the progress being made, false othewise.

isFinished

boolean isFinished()
A simple call back method which will be called when the task has completed.

Returns:
true if the task is finished, false otherwise.

cancel

void cancel()
A method to cancel execution of the task. Note, some implementations might not support this. In that case an UnsupportedOperationException should be thrown.


Jive Forums Project Page

Copyright © 1999-2006 Jive Software.