org.objectweb.proactive.core.node
Class NodeFactory

java.lang.Object
  |
  +--org.objectweb.proactive.core.node.NodeFactory

public class NodeFactory
extends java.lang.Object

The NodeFactory provides a generic way to create and lookup Node without protocol specific code (such as RMI or Jini).

NodeFactory provides a set of static methods to create and lookup Node. To create a node it is only necessary to associate the protocol in the node url. For instance :

    rmi://localhost/node1
    jini://localhost/node2
 

As long as a protocol specific factory has been registered for the given protocol, the creation of the node will be delegated to the right factory.

This class also provide the concept of default node and default protocol. When the protocol is not specified in the node URL, the default protocol is used. When an active object is created in the local JVM but without being attached to any node, a default node is created to hold that active object.

Since:
ProActive 0.9
Version:
1.1, 2002/08/28
Author:
ProActive Team

Field Summary
protected static org.apache.log4j.Logger logger
           
 
Constructor Summary
NodeFactory()
           
 
Method Summary
static Node createNode(java.lang.String nodeURL)
          Creates a new node on the local machine.
static Node createNode(java.lang.String url, boolean replacePreviousBinding, PolicyServer ps, java.lang.String vnname)
          Creates a new node on the local machine.
static Node getDefaultNode()
          Returns the reference to the default node associated to the current JVM If no default node yet exists, it creates a new one.
static Node getNode(java.lang.String nodeURL)
          Returns the reference to the node located at the given url.
static boolean isNodeLocal(Node node)
          Returns true if the given node belongs to this JVM false else.
static void killNode(java.lang.String nodeURL)
          Kills the node of the given url
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger
Constructor Detail

NodeFactory

public NodeFactory()
Method Detail

getDefaultNode

public static Node getDefaultNode()
                           throws NodeException
Returns the reference to the default node associated to the current JVM If no default node yet exists, it creates a new one.

Returns:
a reference to the default node associated to this JVM
Throws:
NodeException - if the default node cannot be instantiated

isNodeLocal

public static boolean isNodeLocal(Node node)
Returns true if the given node belongs to this JVM false else.

Returns:
true if the given node belongs to this JVM false else

createNode

public static Node createNode(java.lang.String nodeURL)
                       throws NodeException
Creates a new node on the local machine. This call can only be used to create a node on the local JVM on the local machine. The node URL can be in the form where <hostname> is the name of the localhost.

Returns:
the newly created node on the local JVM
Throws:
NodeException - if the node cannot be created

createNode

public static Node createNode(java.lang.String url,
                              boolean replacePreviousBinding,
                              PolicyServer ps,
                              java.lang.String vnname)
                       throws NodeException
Creates a new node on the local machine. This call can only be used to create a node on the local JVM on the local machine. The node URL can be in the form where <hostname> is the name of the localhost.

Returns:
the newly created node on the local JVM
Throws:
NodeException - if the node cannot be created

getNode

public static Node getNode(java.lang.String nodeURL)
                    throws NodeException
Returns the reference to the node located at the given url. This url can be either local or remote.

Returns:
Node. The reference of the node
Throws:
NodeException - if the node cannot be found

killNode

public static void killNode(java.lang.String nodeURL)
                     throws NodeException
Kills the node of the given url

Parameters:
nodeURL -
Throws:
NodeException - if a problem occurs when killing the node


Copyright © April 2004 INRIA All Rights Reserved.