Package org.jppf.node
Class NodeRunner
java.lang.Object
org.jppf.node.NodeRunner
Bootstrap class for launching a JPPF node. The node class is dynamically loaded from a remote server.
- Author:
- Laurent Cohen
-
Constructor Summary
ConstructorsConstructorDescriptionNodeRunner(org.jppf.utils.TypedProperties configuration) Initialize this node runner with the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionorg.jppf.node.NodegetNode()Get the actual node started by this node runner, if any.getUuid()Get the node's universal unique identifier.booleanDetermine whether the node is offline.static voidRun a node as a standalone application.voidshutdown()Shutdown the node.voidRun a node embedded in the current JVM.
-
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
Run a node as a standalone application.- Parameters:
args- not used.
-
start
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
Get the node's universal unique identifier.- Returns:
- a uuid as a string.
-
isOffline
public boolean isOffline()Determine whether the node is offline.- Returns:
trueif the node is offline,falseotherwise.
-
getNode
public org.jppf.node.Node getNode()Get the actual node started by this node runner, if any.- Returns:
- the current JPPF node, or
nullif no node is started.
-