com.parabon.client
Interface TaskResultEvent

All Superinterfaces:
TaskEvent

public interface TaskResultEvent
extends TaskEvent

A TaskResultEvent is generated is when a task completes without throwing an exception. Once a task completes successfully, it is guaranteed that at least one TaskResultEvent will be generated and propogated back to the client application representing the final state of the task.


Method Summary
 java.io.InputStream getResultsData()
          Returns an InputStream from which a task's final results can be read, as returned from Task.run.
 java.io.Serializable getResultsObject()
          Returns an object representing the task's final results, as returned from Task.run.
 java.net.URL getResultsURL()
          Returns a URL from which a task's final results data can be read, as returned from Task.run.
 
Methods inherited from interface com.parabon.client.TaskEvent
getProgress, getRunMode, getTaskAttributes, getTaskProxy, isActive, isComplete
 

Method Detail

getResultsData

java.io.InputStream getResultsData()
Returns an InputStream from which a task's final results can be read, as returned from Task.run. If the results were instead returned from SerializableTask.run, this InputStream will contain a bytestream representing the serialized form of the object, accessable via ObjectInputStream.

This InputStream instance is valid only for the lifetime of the event listener method invocation, and it should not be maintained or accessed outside this scope or used after the method completes; any attempt to do so will result in undefined behaviour.

See Also:
Task.run(com.parabon.runtime.TaskContext, com.parabon.runtime.DataBuffer)

getResultsObject

java.io.Serializable getResultsObject()
                                      throws DeserializationException
Returns an object representing the task's final results, as returned from Task.run. If the results were instead returned from SerializbleTask.run and the contents are a bytestream readable via ObjectInputStream, then the returned Object will be equal to that returned by the first call to ObjectInputStream.readObject. If the contents are not in this format, do not start with a valid Object, or the object cannot be deserialized, then this method will throw a DeserializationException.

This Object instance may be maintained and read indefinitely, but should not be modified; any attempt to do so will result in undefined behaviour.

Throws:
DeserializationException
See Also:
SerializableTask.run(com.parabon.client.SerializableTaskContext)

getResultsURL

java.net.URL getResultsURL()
Returns a URL from which a task's final results data can be read, as returned from Task.run. If the results were instead returned from SerializableTask.run, this URL will point to a data file representing the serialized form of the object, accessable via ObjectInputStream.

See Also:
Task.run(com.parabon.runtime.TaskContext, com.parabon.runtime.DataBuffer)