Package org.jppf.node

Class AbstractNode

java.lang.Object
org.jppf.utils.concurrent.ThreadSynchronization
org.jppf.node.AbstractNode
All Implemented Interfaces:
Runnable, org.jppf.node.Node, NodeInternal
Direct Known Subclasses:
AbstractCommonNode

public abstract class AbstractNode extends org.jppf.utils.concurrent.ThreadSynchronization implements NodeInternal
Abstract implementation of the Node interface.
Author:
Laurent Cohen
  • Field Details

    • helper

      protected org.jppf.serialization.SerializationHelper helper
      Utility for deserialization and serialization.
    • serializer

      protected org.jppf.serialization.ObjectSerializer serializer
      Utility for deserialization and serialization.
    • uuid

      protected final String uuid
      This node's universal identifier.
    • systemInformation

      protected org.jppf.management.JPPFSystemInformation systemInformation
      This node's system information.
    • nodeConnection

      protected NodeConnection<?> nodeConnection
      Get the connection used by this node.
    • nodeIO

      protected NodeIO nodeIO
      The object responsible for this node's I/O.
    • configuration

      protected final org.jppf.utils.TypedProperties configuration
      The configuration of this node.
    • jmxEnabled

      protected boolean jmxEnabled
      Determines whether JMX management and monitoring is enabled for this node.
    • lifeCycleEventHandler

      protected LifeCycleEventHandler lifeCycleEventHandler
      Handles the firing of node life cycle events and the listeners that subscribe to these events.
    • jmxServer

      protected org.jppf.management.JMXServer jmxServer
      The jmx server that handles administration and monitoring functions for this node.
    • hookFactory

      protected final org.jppf.utils.hooks.HookFactory hookFactory
      To create and invoke hook instances.
  • Constructor Details

    • AbstractNode

      public AbstractNode(String uuid, org.jppf.utils.TypedProperties configuration, org.jppf.utils.hooks.HookFactory hookFactory)
      Initialize this node.
      Parameters:
      uuid - this node's uuid.
      configuration - the configuration of this node.
      hookFactory - used to create and invoke hook instances.
  • Method Details

    • getNodeConnection

      public NodeConnection<?> getNodeConnection()
      Get the connection used by this node.
      Specified by:
      getNodeConnection in interface NodeInternal
      Returns:
      a NodeConnection instance.
    • getExecutedTaskCount

      public int getExecutedTaskCount()
      Specified by:
      getExecutedTaskCount in interface org.jppf.node.Node
    • setExecutedTaskCount

      public void setExecutedTaskCount(int taskCount)
      Set the total number of tasks executed.
      Parameters:
      taskCount - the number of tasks as an int.
    • getHelper

      public org.jppf.serialization.SerializationHelper getHelper()
      Get the utility for deserialization and serialization.
      Returns:
      a SerializationHelper instance.
    • getJmxServer

      public org.jppf.management.JMXServer getJmxServer() throws Exception
      Get the JMX connector server associated with the node.

      The default implementation throws a JPPFUnsupportedOperationException. It is up to concrete implementations to override it.

      This implementation throws a JPPFUnsupportedOperationException. It is up to subclasses to implement it.

      Specified by:
      getJmxServer in interface NodeInternal
      Returns:
      a JMXServer instance.
      Throws:
      Exception - if any error occurs.
    • getUuid

      public String getUuid()
      Specified by:
      getUuid in interface org.jppf.node.Node
    • updateSystemInformation

      protected void updateSystemInformation()
      Update the current system information.
    • getSystemInformation

      public org.jppf.management.JPPFSystemInformation getSystemInformation()
      Specified by:
      getSystemInformation in interface org.jppf.node.Node
    • resetTaskClassLoader

      public AbstractJPPFClassLoader resetTaskClassLoader(Object... params)
      This implementation does nothing.
      Specified by:
      resetTaskClassLoader in interface org.jppf.node.Node
      Parameters:
      params - not used.
      Returns:
      null.
    • getShuttingDown

      public AtomicBoolean getShuttingDown()
      Determine whether this node is currently shutting down.
      Returns:
      an AtomicBoolean instance whose value is true</code> if the node is shutting down, <code>false otherwise.
    • getJPPFClassLoader

      public AbstractJPPFClassLoader getJPPFClassLoader()
      Returns:
      the main node class loader.
    • setJPPFClassLoader

      public void setJPPFClassLoader(AbstractJPPFClassLoader jppfClassLoader)
      Parameters:
      jppfClassLoader - the main node class loader.
    • getManagementInfo

      public org.jppf.management.JPPFManagementInfo getManagementInfo()
      Specified by:
      getManagementInfo in interface org.jppf.node.Node
    • getConfiguration

      public org.jppf.utils.TypedProperties getConfiguration()
      Specified by:
      getConfiguration in interface org.jppf.node.Node
    • isJmxEnabled

      protected boolean isJmxEnabled()
      Determines whether JMX management and monitoring is enabled for this node.
      Returns:
      true if JMX is enabled, false otherwise.
    • getLifeCycleEventHandler

      public LifeCycleEventHandler getLifeCycleEventHandler()
      Description copied from interface: NodeInternal
      Get the object that manages the node life cycle events.
      Specified by:
      getLifeCycleEventHandler in interface NodeInternal
      Returns:
      a LifeCycleEventHandler instance.
    • isMasterNode

      public boolean isMasterNode()
      Specified by:
      isMasterNode in interface org.jppf.node.Node
    • isSlaveNode

      public boolean isSlaveNode()
      Specified by:
      isSlaveNode in interface org.jppf.node.Node
    • getMasterNodeUuid

      public String getMasterNodeUuid()
      Specified by:
      getMasterNodeUuid in interface org.jppf.node.Node
    • getNodeIO

      public NodeIO getNodeIO()
      Returns:
      the object responsible for this node's I/O.
    • getHookFactory

      public org.jppf.utils.hooks.HookFactory getHookFactory()
      Get the factory that creates and invoke hook instances for this node.
      Returns:
      a HookFactory instance.