com.atlassian.core.task.longrunning
Class AbstractLongRunningTask

java.lang.Object
  extended by com.atlassian.core.task.longrunning.AbstractLongRunningTask
All Implemented Interfaces:
LongRunningTask, java.lang.Runnable

public abstract class AbstractLongRunningTask
extends java.lang.Object
implements LongRunningTask


Field Summary
static org.apache.log4j.Category log
           
protected  ProgressMeter progress
           
 
Constructor Summary
protected AbstractLongRunningTask()
           
 
Method Summary
 java.lang.String getCurrentStatus()
           
 long getElapsedTime()
           
 long getEstimatedTimeRemaining()
           
 java.lang.String getNameKey()
          Internationalisation key for the name of the task, so that the task's name can be displayed in the User Interface.
 int getPercentageComplete()
           
 java.lang.String getPrettyElapsedTime()
           
 java.lang.String getPrettyTimeRemaining()
           
protected abstract  java.util.ResourceBundle getResourceBundle()
           
 boolean isComplete()
           
 boolean isSuccessful()
           
 void run()
           
protected  void stopTimer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.core.task.longrunning.LongRunningTask
getName
 

Field Detail

log

public static final org.apache.log4j.Category log

progress

protected ProgressMeter progress
Constructor Detail

AbstractLongRunningTask

protected AbstractLongRunningTask()
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

getNameKey

public java.lang.String getNameKey()
Internationalisation key for the name of the task, so that the task's name can be displayed in the User Interface. Default implementation returns null, since some uses of LongRunningTask may not require internationalisation of the name (eg if the name of the task is never displayed in the UI).

Specified by:
getNameKey in interface LongRunningTask
Returns:
I18n key as a string, or null if no key defined. Null if not overridden.

getPercentageComplete

public int getPercentageComplete()
Specified by:
getPercentageComplete in interface LongRunningTask

getCurrentStatus

public java.lang.String getCurrentStatus()
Specified by:
getCurrentStatus in interface LongRunningTask

getElapsedTime

public long getElapsedTime()
Specified by:
getElapsedTime in interface LongRunningTask

getEstimatedTimeRemaining

public long getEstimatedTimeRemaining()
Specified by:
getEstimatedTimeRemaining in interface LongRunningTask

isComplete

public boolean isComplete()
Specified by:
isComplete in interface LongRunningTask

getPrettyElapsedTime

public java.lang.String getPrettyElapsedTime()
Specified by:
getPrettyElapsedTime in interface LongRunningTask

getResourceBundle

protected abstract java.util.ResourceBundle getResourceBundle()

getPrettyTimeRemaining

public java.lang.String getPrettyTimeRemaining()
Specified by:
getPrettyTimeRemaining in interface LongRunningTask

isSuccessful

public boolean isSuccessful()
Specified by:
isSuccessful in interface LongRunningTask

stopTimer

protected void stopTimer()


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.