public abstract class Task
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Task() |
Modifier and Type | Method and Description |
---|---|
void |
addCompletedListener(CompletedListener listener) |
void |
addProgressUpdatedListener(ProgressUpdatedListener listener) |
void |
addStatusChangedListener(StatusChangedListener listener) |
abstract void |
execute()
Main entry point into Task when it is run on a Host.
|
java.util.UUID |
getId()
Gets the unique handle of task.
|
boolean |
getIsCancelling()
Gets a value indicating whether this task is cancelling.
|
boolean |
getIsFinishedTaskStatus()
Gets a value indicating whether this task has been finished.
|
java.lang.String |
getName()
Gets the display name of the task.
|
java.util.Hashtable |
getProperties()
Gets the properties of the task.
|
java.lang.Object |
getProperty(java.lang.String propertyName)
Returns property value by name.
|
java.lang.Object |
getResult()
Gets Task's execution result.
|
java.lang.String |
getStandardError()
Gets the standard error of the host that executed the task.
|
java.lang.String |
getStandardOutput()
Gets the standard output of the host that executed the task.
|
java.lang.String |
getTaskCancellationMessage()
Gets the optional task cancellation message.
|
TaskCancellationReason |
getTaskCancellationReason()
Gets the reason why the task was canceled.
|
TaskStatus |
getTaskStatus()
Gets the task status.
|
void |
removeProperty(java.lang.String propertyName)
Removes the property from the property bag.
|
void |
setName(java.lang.String value)
Sets the display name of the task.
|
void |
setProgress(int progress)
Sets progress of task.
|
void |
setProgress(int progress,
java.lang.Object additionalInformation)
Sets progress of task.
|
void |
setProperty(java.lang.String propertyName,
java.lang.Object value)
Sets properties on Task.
|
void |
setResult(java.lang.Object value)
Sets Task's execution result.
|
java.lang.String |
toString() |
public void addCompletedListener(CompletedListener listener)
public void addStatusChangedListener(StatusChangedListener listener)
public void addProgressUpdatedListener(ProgressUpdatedListener listener)
public java.lang.Object getResult()
Serializable
.public void setResult(java.lang.Object value)
Serializable
.public final TaskStatus getTaskStatus()
public final TaskCancellationReason getTaskCancellationReason()
public final java.lang.String getTaskCancellationMessage()
public final java.lang.String getStandardOutput()
public final java.lang.String getStandardError()
public final java.util.UUID getId()
public final java.lang.String getName()
public final void setName(java.lang.String value)
public final java.util.Hashtable getProperties()
public final boolean getIsCancelling()
true
if this instance is cancelling; otherwise, false
.public final boolean getIsFinishedTaskStatus()
true
if this task is finished; otherwise, false
.public abstract void execute()
public final void setProgress(int progress)
progress
- The progress of task.public final void setProgress(int progress, java.lang.Object additionalInformation)
additionalInformation
value must be a primitive type. For example, string, integer, double, or byte[].progress
- The progress of task.additionalInformation
- Aditional argument that will be marshalled to AGI.Parallel.Client.Job.TaskProgressUpdated event.public final void setProperty(java.lang.String propertyName, java.lang.Object value)
TaskProperties
.propertyName
- Property Name.value
- Property Value.public final java.lang.Object getProperty(java.lang.String propertyName)
TaskProperties
.propertyName
- Name of Property.public final void removeProperty(java.lang.String propertyName)
TaskProperties
.propertyName
- Name of the property to remove.public java.lang.String toString()
toString
in class java.lang.Object