org.jppf.node
Class NodeRunner

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

public class NodeRunner
extends Object

Bootstrap class for lauching a JPPF node. The node class is dynamically loaded from a remote server.

Author:
Laurent Cohen

Nested Class Summary
static class NodeRunner.ShutdownOrRestart
          Task used to terminate the JVM.
 
Constructor Summary
NodeRunner()
           
 
Method Summary
static MonitoredNode createNode()
          Start the node.
static void discoverDriver()
          Automatically discover the server connection information using a datagram multicast.
static AbstractJPPFClassLoader getJPPFClassLoader()
          Get the main classloader for the node.
static MonitoredNode getNode()
          Get the JPPF node.
static Object getPersistentData(Object key)
          Get a persistent object given its key.
static String getUuid()
          This node's universal identifier.
static void main(String... args)
          Run a node as a standalone application.
static Object removePersistentData(Object key)
          Remove a persistent object.
static void setPersistentData(Object key, Object value)
          Set a persistent object with the specified key.
static void setSecurity()
          Set the security manager with the permission granted in the policy file.
static void shutdown(MonitoredNode node, boolean restart)
          Shutdown and eventually restart the node.
static void start(String... args)
          Run a node as a standalone application.
static void stop(String... args)
          Run a node as a standalone application.
static void unsetSecurity()
          Set the security manager with the permission granted in the policy file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeRunner

public NodeRunner()
Method Detail

main

public static void main(String... args)
Run a node as a standalone application.

Parameters:
args - not used.

start

public static void start(String... args)
Run a node as a standalone application.

Parameters:
args - not used.

stop

public static void stop(String... args)
Run a node as a standalone application.

Parameters:
args - not used.

createNode

public static MonitoredNode createNode()
                                throws Exception
Start the node.

Returns:
the node that was started, as a MonitoredNode instance.
Throws:
Exception - if the node failed to run or couldn't connect to the server.

discoverDriver

public static void discoverDriver()
Automatically discover the server connection information using a datagram multicast. Upon receiving the connection information, the JPPF configuration is modified to take into account the discovered information. If no information could be received, the node relies on the static information in the configuration file.


setSecurity

public static void setSecurity()
                        throws Exception
Set the security manager with the permission granted in the policy file.

Throws:
Exception - if the security could not be set.

unsetSecurity

public static void unsetSecurity()
Set the security manager with the permission granted in the policy file.


getJPPFClassLoader

public static AbstractJPPFClassLoader getJPPFClassLoader()
Get the main classloader for the node. This method performs a lazy initialization of the classloader.

Returns:
a AbstractJPPFClassLoader used for loading the classes of the framework.

setPersistentData

public static void setPersistentData(Object key,
                                     Object value)
Set a persistent object with the specified key.

Parameters:
key - the key associated with the object's value.
value - the object to persist.

getPersistentData

public static Object getPersistentData(Object key)
Get a persistent object given its key.

Parameters:
key - the key used to retrieve the persistent object.
Returns:
the value associated with the key.

removePersistentData

public static Object removePersistentData(Object key)
Remove a persistent object.

Parameters:
key - the key associated with the object to remove.
Returns:
the value associated with the key, or null if the key was not found.

getNode

public static MonitoredNode getNode()
Get the JPPF node.

Returns:
a MonitoredNode instance.

shutdown

public static void shutdown(MonitoredNode node,
                            boolean restart)
Shutdown and eventually restart the node.

Parameters:
node - the node to shutdown or restart.
restart - determines whether this node should be restarted by the node launcher.

getUuid

public static String getUuid()
This node's universal identifier.

Returns:
a uuid as a string.


Copyright © 2005-2010 JPPF Team.