Package org.jppf.node.protocol
Class TaskExecutionDispatcher
java.lang.Object
org.jppf.node.protocol.TaskExecutionDispatcher
- Since:
- 4.0
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionTaskExecutionDispatcher(ClassLoader loader) Intialize this dispatcher with the specified class loader. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a task execution listener to the list of task execution listeners.voidclose()Release the resources used by this dispatcher.voidfireTaskEnded(Task<?> task, String jobId, String jobName, long cpuTime, long elapsedTime, boolean error) Fire an event to notify that a task has ended its execution.voidfireTaskNotification(Task<?> task, Object userObject, boolean sendViaJmx) Fire an event from a task.voidRemove a task execution listener from the list of task execution listeners.
-
Constructor Details
-
TaskExecutionDispatcher
Intialize this dispatcher with the specified class loader.- Parameters:
loader- the class loader used to discover listeners via SPI.
-
-
Method Details
-
addTaskExecutionListener
Add a task execution listener to the list of task execution listeners.- Parameters:
listener- the listener to add.
-
removeTaskExecutionListener
Remove a task execution listener from the list of task execution listeners.- Parameters:
listener- the listener to remove.
-
fireTaskEnded
public void fireTaskEnded(Task<?> task, String jobId, String jobName, long cpuTime, long elapsedTime, boolean error) Fire an event to notify that a task has ended its execution.- Parameters:
task- the JPPF task from which the event originates.jobId- the id of the job this task belongs to.jobName- the name of the job this task belongs to.cpuTime- the cpu time taken by the task.elapsedTime- the wall clock time taken by the task.error- determines whether the task had an exception.
-
fireTaskNotification
Fire an event from a task.- Parameters:
task- the JPPF task from which the event originates.userObject- a user-defined object to send as part of the notification.sendViaJmx- iftruethen also send this notification via the JMX MBean, otherwise only send to local listeners.
-
close
public void close()Release the resources used by this dispatcher.
-