Class NodeLifeCycleEvent

java.lang.Object
java.util.EventObject
org.jppf.node.event.NodeLifeCycleEvent
All Implemented Interfaces:
Serializable

public class NodeLifeCycleEvent extends EventObject
Instances of this class represent node life cycle events.
Author:
Laurent Cohen
See Also:
  • Constructor Details

    • NodeLifeCycleEvent

      public NodeLifeCycleEvent(org.jppf.node.Node node, NodeLifeCycleEventType type)
      Initialize this event with the specified execution manager.
      This constructor is used for nodeStarting() and nodeEnding() notifications only.
      Parameters:
      node - an object representing the JPPF node. If the NodeLifeCycleListener was deployed in the server's classpath, then it can be safely cast to a org.jppf.server.node.JPPFNode instance.
      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 for jobHeaderLoaded() 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 for jobStarting() and jobEnding() 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 Node instance, or null if this event isn't part of a nodeStarting() or nodeEnding() notification. If the NodeLifeCycleListener was deployed in the server's classpath, then this return value can be safely cast to a org.jppf.server.node.JPPFNode instance.
    • getJob

      public org.jppf.node.protocol.JPPFDistributedJob getJob()
      Get the job currently being executed.
      The job is available within jobHeaderLoaded(), jobStarting() and jobEnding() notifications only. It will be null in all other cases.
      Returns:
      a JPPFDistributedJob instance, or null if no job is being executed.
    • getTasks

      public List<org.jppf.node.protocol.Task<?>> getTasks()
      Get the tasks currently being executed.
      The tasks are available within jobStarting() and jobEnding() notifications only. This method will return null in all other cases.
      Returns:
      a list of Task instances, or null if the node is idle.
    • getTaskClassLoader

      public AbstractJPPFClassLoader getTaskClassLoader()
      Get the class loader used to load the tasks and the classes they need from the client.
      The task class loader is available within jobHeaderLoaded(), jobStarting() and jobEnding() notifications only. It will be null in 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 within jobStarting() and jobEnding() notifications only. It will be null in all other cases.
      Returns:
      a DataProvider instance.
    • toString

      public String toString()
      Overrides:
      toString in class EventObject
    • getType

      public NodeLifeCycleEventType getType()
      Get the type of this event.
      Returns:
      the event type as an instance of the typesafe enum NodeLifeCycleEventType.