Class BackgroundTaskImpl
- java.lang.Object
-
- jetbrains.buildServer.backgroundTasks.impl.BackgroundTaskImpl
-
- All Implemented Interfaces:
ActivityProgress,BackgroundTask
public class BackgroundTaskImpl extends Object implements BackgroundTask, ActivityProgress
Created by IntelliJ IDEA. User: kir Date: Oct 28, 2008
-
-
Constructor Summary
Constructors Constructor Description BackgroundTaskImpl(String id, BackgroundActivity action)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckCanceled()This method checks if underlying process should be cancelled without completion.floatgetFraction()FuturegetFuture()StringgetId()Task identifier, which was used when task were createdStringgetProgressText()Get current progress text, which was set by ActivityProgress#setProgressTextbooleanisDone()voidsetFraction(float completed)Allows to set the completion of the task (should be between 0 and 1 inclusive)voidsetProgressText(String progressText)Set current progress text
-
-
-
Constructor Detail
-
BackgroundTaskImpl
public BackgroundTaskImpl(String id, BackgroundActivity action)
-
-
Method Detail
-
getId
public String getId()
Description copied from interface:BackgroundTaskTask identifier, which was used when task were created- Specified by:
getIdin interfaceBackgroundTask- Returns:
- see above
-
getProgressText
public String getProgressText()
Description copied from interface:BackgroundTaskGet current progress text, which was set by ActivityProgress#setProgressText- Specified by:
getProgressTextin interfaceBackgroundTask- Returns:
- see above
-
getFraction
public float getFraction()
- Specified by:
getFractionin interfaceBackgroundTask- Returns:
- completion percentage, see ActivityProgress#setFraction
-
getFuture
public Future getFuture()
- Specified by:
getFuturein interfaceBackgroundTask- Returns:
- future object, associated with the given task
-
isDone
public boolean isDone()
- Specified by:
isDonein interfaceBackgroundTask- Returns:
- true if task has finished or canceled
-
setFraction
public void setFraction(float completed)
Description copied from interface:ActivityProgressAllows to set the completion of the task (should be between 0 and 1 inclusive)- Specified by:
setFractionin interfaceActivityProgress- Parameters:
completed- number 0..1 to specify completed percent
-
setProgressText
public void setProgressText(String progressText)
Description copied from interface:ActivityProgressSet current progress text- Specified by:
setProgressTextin interfaceActivityProgress- Parameters:
progressText- short description of the current operation
-
checkCanceled
public void checkCanceled() throws InterruptedExceptionDescription copied from interface:ActivityProgressThis method checks if underlying process should be cancelled without completion. It should be checked periodically during the action run.- Specified by:
checkCanceledin interfaceActivityProgress- Throws:
InterruptedException- when progress is interrupted
-
-