Package org.jppf.node.protocol
Class JPPFExceptionResult
- All Implemented Interfaces:
Serializable,Runnable,Interruptibility,PositionalElement<Task<Object>>,Task<Object>
- Direct Known Subclasses:
JPPFExceptionResultEx
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor provided as a convenience for subclassing.JPPFExceptionResult(Throwable throwable, Object object) Initialize this task with the specified error context. -
Method Summary
Modifier and TypeMethodDescriptionGet a string describing the object on which the error occurred.Get the fully qualified class name of the intiial task object on which the error occurred.voidrun()Display the error context captured in this task.toString()Construct a string representation of this object.Methods inherited from class org.jppf.node.protocol.AbstractTask
compute, fireNotification, getDataProvider, getId, getJob, getMaxResubmits, getNode, getPosition, getResult, getTaskClassLoader, getTaskObject, getThrowable, getTimeoutSchedule, isInNode, isInterruptible, isResubmit, onCancel, onTimeout, setDataProvider, setExecutionDispatcher, setId, setInNode, setJob, setMaxResubmits, setNode, setPosition, setResubmit, setResult, setThrowable, setTimeoutSchedule
-
Field Details
-
objectDescriptor
This captures the result of ("" + object). -
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
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:
runin interfaceRunnable- Overrides:
runin classAbstractTask<Object>
-
toString
Construct a string representation of this object. -
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
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.
-