Package org.jppf.node.event
Class NodeLifeCycleEvent
java.lang.Object
java.util.EventObject
org.jppf.node.event.NodeLifeCycleEvent
- All Implemented Interfaces:
Serializable
Instances of this class represent node life cycle events.
- Author:
- Laurent Cohen
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionNodeLifeCycleEvent(org.jppf.node.Node node, NodeLifeCycleEventType type) Initialize this event with the specified execution manager.NodeLifeCycleEvent(org.jppf.node.Node node, NodeLifeCycleEventType type, org.jppf.node.protocol.JPPFDistributedJob job, AbstractJPPFClassLoader cl) Initialize this event with the specified job, task class loader and tasks.NodeLifeCycleEvent(org.jppf.node.Node node, NodeLifeCycleEventType type, org.jppf.node.protocol.JPPFDistributedJob job, AbstractJPPFClassLoader cl, List<org.jppf.node.protocol.Task<?>> tasks, org.jppf.node.protocol.DataProvider dataProvider) Initialize this event with the specified job, task class loader and tasks. -
Method Summary
Modifier and TypeMethodDescriptionorg.jppf.node.protocol.DataProviderGet the data provider for the current job, if any.org.jppf.node.protocol.JPPFDistributedJobgetJob()Get the job currently being executed.org.jppf.node.NodegetNode()Get the object representing the current JPPF node.Get the class loader used to load the tasks and the classes they need from the client.List<org.jppf.node.protocol.Task<?>>getTasks()Get the tasks currently being executed.getType()Get the type of this event.toString()Methods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
NodeLifeCycleEvent
Initialize this event with the specified execution manager.
This constructor is used fornodeStarting()andnodeEnding()notifications only.- Parameters:
node- an object representing the JPPF node. If theNodeLifeCycleListenerwas deployed in the server's classpath, then it can be safely cast to aorg.jppf.server.node.JPPFNodeinstance.type- the type of this event.
-
NodeLifeCycleEvent
public NodeLifeCycleEvent(org.jppf.node.Node node, NodeLifeCycleEventType type, org.jppf.node.protocol.JPPFDistributedJob job, AbstractJPPFClassLoader cl) Initialize this event with the specified job, task class loader and tasks.
This constructor is used forjobHeaderLoaded()notifications only.- Parameters:
node- an object representing the JPPF node.type- the type of this event.job- the job that is about to be or has been executed.cl- the class loader used to load the tasks and the classes they need from the client.
-
NodeLifeCycleEvent
public NodeLifeCycleEvent(org.jppf.node.Node node, NodeLifeCycleEventType type, org.jppf.node.protocol.JPPFDistributedJob job, AbstractJPPFClassLoader cl, List<org.jppf.node.protocol.Task<?>> tasks, org.jppf.node.protocol.DataProvider dataProvider) Initialize this event with the specified job, task class loader and tasks.
This constructor is used forjobStarting()andjobEnding()notifications only.- Parameters:
node- an object representing the JPPF node.type- the type of this event.job- the job that is about to be or has been executed.cl- the class loader used to load the tasks and the classes they need from the client.tasks- the tasks about to be or which have been executed.dataProvider- the data provider for the current job, if any.
-
-
Method Details
-
getNode
public org.jppf.node.Node getNode()Get the object representing the current JPPF node.
The node is available for all notifications.- Returns:
- a
Nodeinstance, or null if this event isn't part of anodeStarting()ornodeEnding()notification. If theNodeLifeCycleListenerwas deployed in the server's classpath, then this return value can be safely cast to aorg.jppf.server.node.JPPFNodeinstance.
-
getJob
public org.jppf.node.protocol.JPPFDistributedJob getJob()Get the job currently being executed.
The job is available withinjobHeaderLoaded(),jobStarting()andjobEnding()notifications only. It will benullin all other cases.- Returns:
- a
JPPFDistributedJobinstance, or null if no job is being executed.
-
getTasks
Get the tasks currently being executed.
The tasks are available withinjobStarting()andjobEnding()notifications only. This method will returnnullin all other cases.- Returns:
- a list of
Taskinstances, or null if the node is idle.
-
getTaskClassLoader
Get the class loader used to load the tasks and the classes they need from the client.
The task class loader is available withinjobHeaderLoaded(),jobStarting()andjobEnding()notifications only. It will benullin all other cases.- Returns:
- an instance of
AbstractJPPFClassLoader.
-
getDataProvider
public org.jppf.node.protocol.DataProvider getDataProvider()Get the data provider for the current job, if any.
The data provider is available withinjobStarting()andjobEnding()notifications only. It will benullin all other cases.- Returns:
- a
DataProviderinstance.
-
toString
- Overrides:
toStringin classEventObject
-
getType
Get the type of this event.- Returns:
- the event type as an instance of the typesafe enum
NodeLifeCycleEventType.
-