Class JPPFExceptionResult

java.lang.Object
org.jppf.node.protocol.AbstractTask<Object>
org.jppf.node.protocol.JPPFExceptionResult
All Implemented Interfaces:
Serializable, Runnable, Interruptibility, PositionalElement<Task<Object>>, Task<Object>
Direct Known Subclasses:
JPPFExceptionResultEx

public class JPPFExceptionResult extends AbstractTask<Object>
Instances of this class are used to signal that a task could not be sent back by the node to the server.

This generally happens when a task cannot be serialized after its execution, or if a data transformation is applied and fails with an exception. An instance of this class captures the context of the error, including the exception that occurred, the object's toString() descriptor and its class name.

When such an error occurs, an instance of this class will be sent instead of the initial JPPF task.

Author:
Laurent Cohen
See Also:
  • Field Details

    • objectDescriptor

      protected String objectDescriptor
      This captures the result of ("" + object).
    • className

      protected String className
      The fully qualified class name of the object that triggered the error.
  • Constructor Details

    • JPPFExceptionResult

      public JPPFExceptionResult()
      Default constructor provided as a convenience for subclassing.
    • JPPFExceptionResult

      public JPPFExceptionResult(Throwable throwable, Object object)
      Initialize this task with the specified error context.
      Parameters:
      throwable - the throwable that is to be captured.
      object - the object on which the throwable applies.
  • Method Details

    • run

      public void run()
      Display the error context captured in this task.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class AbstractTask<Object>
    • toString

      public String toString()
      Construct a string representation of this object.
      Overrides:
      toString in class Object
      Returns:
      a string representing this JPPFExceptionResult.
    • getObjectDescriptor

      public String getObjectDescriptor()
      Get a string describing the object on which the error occurred.
      Returns:
      "null" if the task was null, the result of its toString() method otherwise.
    • getTaskClassName

      public String getTaskClassName()
      Get the fully qualified class name of the intiial task object on which the error occurred.
      Returns:
      "unknown class" if the task object was null, its class name otherwise.