Class GTaskResult


  • public class GTaskResult
    extends java.lang.Object
    Class to represent the result state of a GTask, such as whether it was cancelled or an exception happened.
    • Constructor Summary

      Constructors 
      Constructor Description
      GTaskResult​(GTaskGroup group, GScheduledTask task, java.lang.Exception e, java.lang.Integer transactionID)
      Constructs a GTaskResult for a completed GTask with an optional exception.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDescription()
      Returns a description of the task that was run.
      java.lang.Exception getException()
      Returns the exception generated by the task, or null if no exception was generated.
      java.lang.String getGroupDescription()
      Returns the description for the group for which this task belonged.
      int getPriority()
      Returns the priority at which the task was run within its group.
      boolean hasSameTransaction​(GTaskResult result)
      Returns true if the task represented by this result was executed in the same transaction as the task represented by the given GTaskResult.
      java.lang.String toString()  
      boolean wasCancelled()
      Returns true if the task for this result was cancelled.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • GTaskResult

        public GTaskResult​(GTaskGroup group,
                           GScheduledTask task,
                           java.lang.Exception e,
                           java.lang.Integer transactionID)
        Constructs a GTaskResult for a completed GTask with an optional exception.
        Parameters:
        group - The GTaskGroup that the completed GTask belonged to.
        task - the GScheduledTask which contains the actual GTask that has completed.
        e - optional exception recorded if an exception occurred while processing the task. If the task was cancelled, there should be a CancelledException passed in here.
        transactionID - The transaction id for the transaction that was open when the task was executed. Used by the results GUI to indicate when transactions are opened and closed between tasks.
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Returns a description of the task that was run.
        Returns:
        a description of the task that was run.
      • wasCancelled

        public boolean wasCancelled()
        Returns true if the task for this result was cancelled.
        Returns:
        true if the task for this result was cancelled.
      • getException

        public java.lang.Exception getException()
        Returns the exception generated by the task, or null if no exception was generated. If the task was cancelled, this will return a CancelledException.
        Returns:
        the exception generated by this task or null.
      • getPriority

        public int getPriority()
        Returns the priority at which the task was run within its group.
        Returns:
        the priority at which the task was run within its group.
      • getGroupDescription

        public java.lang.String getGroupDescription()
        Returns the description for the group for which this task belonged.
        Returns:
        the description for the group for which this task belonged.
      • hasSameTransaction

        public boolean hasSameTransaction​(GTaskResult result)
        Returns true if the task represented by this result was executed in the same transaction as the task represented by the given GTaskResult.
        Parameters:
        result - the result to check if it was executed in the same transaction as this task result.
        Returns:
        true if same transaction.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object