Package org.jppf.job
Class ServerTaskInformation
java.lang.Object
org.jppf.job.ServerTaskInformation
- All Implemented Interfaces:
Serializable
Instances of this class provide information about tasks that were dispatched to a node,
at the time they are returned from the node.
- Since:
- 5.0
- Author:
- Laurent Cohen
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionServerTaskInformation(int jobPosition, Throwable throwable, int expirationCount, int maxResubmits, int resubmitCount) Initialize this object.ServerTaskInformation(int jobPosition, Throwable throwable, int expirationCount, int maxResubmits, int resubmitCount, DataLocation result) Initialize this object. -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of times a dispatch of the task has expired.intGet the position of this task within the job submitted by the client.intGet the maximum number of times the task can be resubmitted.intGet the number of times the task was resubmitted.Get an input stream of the task's result data, which can be desrialized as aTask.Task<?>Deserialize the result into a Task object.Get the throwable raised during execution of the task.toString()
-
Constructor Details
-
ServerTaskInformation
public ServerTaskInformation(int jobPosition, Throwable throwable, int expirationCount, int maxResubmits, int resubmitCount) Initialize this object.- Parameters:
jobPosition- the position of this task within the job submitted by the client.throwable- the throwble rraised during execution.expirationCount- number of times a dispatch of this task has expired.maxResubmits- maximum number of times the task can be resubmitted.resubmitCount- number of times the task was resubmitted.
-
ServerTaskInformation
public ServerTaskInformation(int jobPosition, Throwable throwable, int expirationCount, int maxResubmits, int resubmitCount, DataLocation result) Initialize this object.- Parameters:
jobPosition- the position of this task within the job submitted by the client.throwable- the throwble rraised during execution.expirationCount- number of times a dispatch of this task has expired.maxResubmits- maximum number of times the task can be resubmitted.resubmitCount- number of times the task was resubmitted.result- holds the result of the task.
-
-
Method Details
-
getJobPosition
public int getJobPosition()Get the position of this task within the job submitted by the client.- Returns:
- the position of the task in the job as an
intindex value.
-
getThrowable
Get the throwable raised during execution of the task.- Returns:
- a
Throwableinstance, ornullif no throwable was raised.
-
getExpirationCount
public int getExpirationCount()Get the number of times a dispatch of the task has expired.- Returns:
- the number of dispatches as an
intvalue.
-
getMaxResubmits
public int getMaxResubmits()Get the maximum number of times the task can be resubmitted.- Returns:
- the max number of resubmits as an
intvalue.
-
getResubmitCount
public int getResubmitCount()Get the number of times the task was resubmitted.- Returns:
- the number of resubmits as an
intvalue.
-
getResultAsStream
Get an input stream of the task's result data, which can be desrialized as aTask.- Returns:
- an
InputStream, ornullif no result could be obtained. - Throws:
Exception- if any error occurs getting the stream.
-
getResultAsTask
Deserialize the result into a Task object. -
toString
-