org.jppf.client.event
Class TaskResultEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.jppf.client.event.TaskResultEvent
All Implemented Interfaces:
Serializable

public class TaskResultEvent
extends EventObject

Event object used to notify interested listeners that a list of task results have been received from the server.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
TaskResultEvent(List<JPPFTask> taskList)
          Initialize this event with a specified list of tasks.
TaskResultEvent(List<JPPFTask> taskList, int startIndex)
          Deprecated. the startIndex is not used any more to determine each task's position. Use JPPFTask.getPosition() instead.
TaskResultEvent(Throwable throwable)
          Initialize this event with a throwable eventually raised while receiving the results.
 
Method Summary
 int getStartIndex()
          Deprecated. use JPPFTask.getPosition() instead.
 List<JPPFTask> getTaskList()
          Get the list of tasks whose results have been received from the server.
 Throwable getThrowable()
          Get the throwable eventually raised while receiving the results.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TaskResultEvent

public TaskResultEvent(List<JPPFTask> taskList)
Initialize this event with a specified list of tasks.

Parameters:
taskList - the list of tasks whose results have been received from the server.

TaskResultEvent

public TaskResultEvent(Throwable throwable)
Initialize this event with a throwable eventually raised while receiving the results. A TaskResultListener can use this information to reset its state before the job is resubmitted.

Parameters:
throwable - the throwable that was raised while receiving the results.

TaskResultEvent

public TaskResultEvent(List<JPPFTask> taskList,
                       int startIndex)
Deprecated. the startIndex is not used any more to determine each task's position. Use JPPFTask.getPosition() instead.

Initialize this event with a specified list of tasks and start index.

Parameters:
taskList - the list of tasks whose results have been received from the server.
startIndex - index of the first task in the list, relative to the initial execution request. Used to enable proper ordering of the results.
Method Detail

getTaskList

public List<JPPFTask> getTaskList()
Get the list of tasks whose results have been received from the server. To properly order the results, developers should use JPPFTask.getPosition() for each task.

Returns:
a list of JPPFTask instances.

getStartIndex

public int getStartIndex()
Deprecated. use JPPFTask.getPosition() instead.

Get the index of the first task in the list, relative to the initial execution request.

Returns:
the index as an int value.

getThrowable

public Throwable getThrowable()
Get the throwable eventually raised while receiving the results.

Returns:
a Throwable instance, or null if no exception or error was raised.


Copyright © 2005-2010 JPPF Team.