Package org.jppf.job

Class ServerTaskInformation

java.lang.Object
org.jppf.job.ServerTaskInformation
All Implemented Interfaces:
Serializable

public class ServerTaskInformation extends Object implements 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 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 int index value.
    • getThrowable

      public Throwable getThrowable()
      Get the throwable raised during execution of the task.
      Returns:
      a Throwable instance, or null if 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 int value.
    • getMaxResubmits

      public int getMaxResubmits()
      Get the maximum number of times the task can be resubmitted.
      Returns:
      the max number of resubmits as an int value.
    • getResubmitCount

      public int getResubmitCount()
      Get the number of times the task was resubmitted.
      Returns:
      the number of resubmits as an int value.
    • getResultAsStream

      public InputStream getResultAsStream() throws Exception
      Get an input stream of the task's result data, which can be desrialized as a Task.
      Returns:
      an InputStream, or null if no result could be obtained.
      Throws:
      Exception - if any error occurs getting the stream.
    • getResultAsTask

      public Task<?> getResultAsTask() throws Exception
      Deserialize the result into a Task object.
      Returns:
      a Task, or null if no result could be obtained.
      Throws:
      Exception - if any error occurs deserializing the result.
    • toString

      public String toString()
      Overrides:
      toString in class Object