Class JobEvent

java.lang.Object
java.util.EventObject
org.jppf.client.event.JobEvent
All Implemented Interfaces:
Serializable

public class JobEvent extends EventObject
Event emitted by a job when its execution starts or completes.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • JobEvent

      public JobEvent(JPPFJob source)
      Initialize this event with the specified job as its source.
      Parameters:
      source - the source of this event.
    • JobEvent

      public JobEvent(JPPFJob source, org.jppf.execute.ExecutorChannel<?> channel, List<org.jppf.node.protocol.Task<?>> tasks)
      Initialize this event with the specified job as its source.
      Parameters:
      source - the source of this event.
      channel - the channel to which a job is dispatched or from which it returns.
      tasks - the tasks that were dispatched or returned.
  • Method Details

    • getJob

      public JPPFJob getJob()
      Get the source of this event.
      Returns:
      the source as a JPPFJob object.
    • getJobTasks

      public List<org.jppf.node.protocol.Task<?>> getJobTasks()
      Get the tasks that were dispatched or returned.

      This method returns a non null value only for jobDispatched() and jobReturned() events.

      Returns:
      a list of Task instances.
      Since:
      4.0
    • isRemoteExecution

      public boolean isRemoteExecution()
      Determine whether the current job dispatch is sent to a remote driver. Note that this method is only useful in the scope of the JobListener.jobDispatched(JobEvent) and JobListener.jobReturned(JobEvent) notifications.
      Returns:
      true if the current job dispatch is executed remotely or the job has not yet been dispatched, false if the job dispatch is executed locally.
      Since:
      4.2
    • getConnection

      public JPPFClientConnection getConnection()
      Get the remote driver connection through which the job dispatch was sent. Note that this method is only useful in the scope of the JobListener.jobDispatched(JobEvent) and JobListener.jobReturned(JobEvent) notifications.
      Returns:
      a JPPFClientConnection instance, or null if isRemoteExecution() returns false.
      Since:
      4.2