Package org.jppf.node

Class NodeRunner

java.lang.Object
org.jppf.node.NodeRunner

public class NodeRunner extends Object
Bootstrap class for launching a JPPF node. The node class is dynamically loaded from a remote server.
Author:
Laurent Cohen
  • Constructor Summary

    Constructors
    Constructor
    Description
    NodeRunner(org.jppf.utils.TypedProperties configuration)
    Initialize this node runner with the specified configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.jppf.node.Node
    Get the actual node started by this node runner, if any.
    Get the node's universal unique identifier.
    boolean
    Determine whether the node is offline.
    static void
    main(String... args)
    Run a node as a standalone application.
    void
    Shutdown the node.
    void
    start(String... args)
    Run a node embedded in the current JVM.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NodeRunner

      public NodeRunner(org.jppf.utils.TypedProperties configuration)
      Initialize this node runner with the specified configuration.
      Parameters:
      configuration - the configuration of the node.
  • Method Details

    • main

      public static void main(String... args)
      Run a node as a standalone application.
      Parameters:
      args - not used.
    • start

      public void start(String... args)
      Run a node embedded in the current JVM.
      Important note: when starting a node programmatically, you should ensure that this method is called from a separate thread, to avoid the current thread being blocked indefinitely. For example:
       TypedProperties nodeConfig = ...;
       NodeRunner nodeRunner = new NodeRunner(nodeConfig);
       new Thread(() -> nodeRunner.start());
      Parameters:
      args - the first argument, if any, must represent a valid TCP port to a socket opened by the process that launched this node.
    • shutdown

      public void shutdown()
      Shutdown the node.
    • getUuid

      public String getUuid()
      Get the node's universal unique identifier.
      Returns:
      a uuid as a string.
    • isOffline

      public boolean isOffline()
      Determine whether the node is offline.
      Returns:
      true if the node is offline, false otherwise.
    • getNode

      public org.jppf.node.Node getNode()
      Get the actual node started by this node runner, if any.
      Returns:
      the current JPPF node, or null if no node is started.