Package org.jppf.client.event
Class JobEvent
java.lang.Object
java.util.EventObject
org.jppf.client.event.JobEvent
- All Implemented Interfaces:
Serializable
Event emitted by a job when its execution starts or completes.
- Author:
- Laurent Cohen
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the remote driver connection through which the job dispatch was sent.getJob()Get the source of this event.List<org.jppf.node.protocol.Task<?>>Get the tasks that were dispatched or returned.booleanDetermine whether the current job dispatch is sent to a remote driver.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
JobEvent
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
Get the source of this event.- Returns:
- the source as a
JPPFJobobject.
-
getJobTasks
Get the tasks that were dispatched or returned.This method returns a non
nullvalue only forjobDispatched()andjobReturned()events.- Returns:
- a list of
Taskinstances. - 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 theJobListener.jobDispatched(JobEvent)andJobListener.jobReturned(JobEvent)notifications.- Returns:
trueif the current job dispatch is executed remotely or the job has not yet been dispatched,falseif the job dispatch is executed locally.- Since:
- 4.2
-
getConnection
Get the remote driver connection through which the job dispatch was sent. Note that this method is only useful in the scope of theJobListener.jobDispatched(JobEvent)andJobListener.jobReturned(JobEvent)notifications.- Returns:
- a
JPPFClientConnectioninstance, ornullifisRemoteExecution()returnsfalse. - Since:
- 4.2
-