Class PeerAttributesHandler

java.lang.Object
org.jppf.server.nio.nodeserver.PeerAttributesHandler
All Implemented Interfaces:
EventListener, NotificationListener

public class PeerAttributesHandler extends Object implements NotificationListener
Author:
Laurent Cohen
  • Field Details

    • PEER_TOTAL_NODES

      public static final String PEER_TOTAL_NODES
      Property for total nodes attached to a peer driver.
      See Also:
    • PEER_TOTAL_THREADS

      public static final String PEER_TOTAL_THREADS
      Property for total threads for the nodes attached to a peer driver.
  • Constructor Details

    • PeerAttributesHandler

      public PeerAttributesHandler(JPPFDriver driver, int nbThreads)
      Initialize this handler.
      Parameters:
      driver - reference to the JPPF driver.
      nbThreads - the number of threads in the thread pool.
  • Method Details

    • getTotalNodes

      public int getTotalNodes()
      Get the total number of fully connected nodes.
      Returns:
      the total number of nodes.
    • getTotalThreads

      public int getTotalThreads()
      Get the total number of processing threads for all fully connected nodes.
      Returns:
      the total number of threads.
    • onCloseNode

      public void onCloseNode(BaseNodeContext context)
      Called when a node gets closed.
      Parameters:
      context - the node context.
    • onNodeConnected

      public void onNodeConnected(BaseNodeContext context)
      Called when a node gets connected to the server.
      Parameters:
      context - the node context.
    • handleNotification

      public void handleNotification(Notification notification, Object handback)
      Specified by:
      handleNotification in interface NotificationListener