org.objectweb.proactive.core.descriptor.data
Interface VirtualNode

All Superinterfaces:
Job, java.io.Serializable
All Known Implementing Classes:
VirtualNodeImpl, VirtualNodeLookup

public interface VirtualNode
extends java.io.Serializable, Job

A VirtualNode is a conceptual entity that represents one or several nodes. After activation a VirtualNode represents one or several nodes.

Since:
ProActive 0.9.3
Version:
1.0, 2002/09/20
Author:
ProActive Team
See Also:
ProActiveDescriptor, VirtualMachine

Field Summary
static org.apache.log4j.Logger vnLogger
           
 
Method Summary
 void activate()
          Activates all the Nodes mapped to this VirtualNode in the XML Descriptor
 void addVirtualMachine(VirtualMachine virtualMachine)
          Adds a VirtualMachine entity to this VirtualNode
 int createdNodeCount()
          Deprecated. use getNumberOfCurrentlyCreatedNodes() or getNumberOfCreatedNodesAfterDeployment() instead
 void createNodeOnCurrentJvm(java.lang.String protocol)
          Creates a node with the given protocol(or null) on the current jvm, ie the jvm that originates the creation of this VirtualNode.
 int getMinNumberOfNodes()
          Returns the minimum number of nodes needed for this VirtualNode.
 java.lang.String getName()
          Returns the name of this VirtualNode
 Node getNode()
          Returns the first Node created among Nodes mapped to this VirtualNode in the XML Descriptor Another call to this method will return the following created node if any.
 Node getNode(int index)
          Returns the Node mapped to this VirtualNode with the specified index.
 Node getNode(java.lang.String url)
          Returns the node of the given url among nodes mapped to this VirtualNode in the xml descriptor or null if such node does not exist.
 int getNodeCount()
          Returns the number of Nodes mapped to this VirtualNode in the XML Descriptor
 Node[] getNodes()
          Returns all nodes mapped to this VirtualNode
 java.lang.String[] getNodesURL()
          Returns all nodes url mapped to this VirualNode
 int getNumberOfCreatedNodesAfterDeployment()
          Returns the number of Nodes that could successfully be created at the end of the deployment
 int getNumberOfCurrentlyCreatedNodes()
          Returns the number of Nodes already created (at the time of the reception of method call) among the Nodes mapped to this VirtualNode in the XML Descriptor
 java.lang.String getProperty()
          Returns the value of property attribute.
 long getTimeout()
          Returns the timeout of this VirtualNode
 java.lang.Object getUniqueAO()
          Returns the unique active object created on the unique node mapped to this VirtualNode.
 VirtualMachine getVirtualMachine()
          Returns the virtualMachine entity linked to this VirtualNode or if cyclic, returns one of the VirtualMachines linked to this VirtualNode with a cyclic manner(internal count incremented each time this method is called).
 boolean isActivated()
          Returns true is this VirtualNode is already activated, false otherwise
 boolean isLookup()
           
 boolean isMultiple()
          checks the cardinality of the virtual node (i.e. whether the node is mapped to several nodes or not)
 void killAll(boolean softly)
          Kills all nodes mapped to this VirtualNode.
 void setRuntimeInformations(java.lang.String information, java.lang.String value)
          Allows to set runtime informations for this VirtualNode activation.
 
Methods inherited from interface org.objectweb.proactive.Job
getJobID
 

Field Detail

vnLogger

public static final org.apache.log4j.Logger vnLogger
Method Detail

getProperty

public java.lang.String getProperty()
Returns the value of property attribute.

Returns:
String

getName

public java.lang.String getName()
Returns the name of this VirtualNode

Returns:
String

addVirtualMachine

public void addVirtualMachine(VirtualMachine virtualMachine)
Adds a VirtualMachine entity to this VirtualNode

Parameters:
virtualMachine -

getVirtualMachine

public VirtualMachine getVirtualMachine()
Returns the virtualMachine entity linked to this VirtualNode or if cyclic, returns one of the VirtualMachines linked to this VirtualNode with a cyclic manner(internal count incremented each time this method is called).

Returns:
VirtualMachine

getTimeout

public long getTimeout()
Returns the timeout of this VirtualNode

Returns:
the timeout of this VirtualNode

activate

public void activate()
Activates all the Nodes mapped to this VirtualNode in the XML Descriptor


getNodeCount

public int getNodeCount()
Returns the number of Nodes mapped to this VirtualNode in the XML Descriptor

Returns:
int

createdNodeCount

public int createdNodeCount()
Deprecated. use getNumberOfCurrentlyCreatedNodes() or getNumberOfCreatedNodesAfterDeployment() instead


getNumberOfCurrentlyCreatedNodes

public int getNumberOfCurrentlyCreatedNodes()
Returns the number of Nodes already created (at the time of the reception of method call) among the Nodes mapped to this VirtualNode in the XML Descriptor

Returns:
int the number of nodes created at the time of the method call

getNumberOfCreatedNodesAfterDeployment

public int getNumberOfCreatedNodesAfterDeployment()
Returns the number of Nodes that could successfully be created at the end of the deployment

Returns:
int the number of nodes effectively created

getNode

public Node getNode()
             throws NodeException
Returns the first Node created among Nodes mapped to this VirtualNode in the XML Descriptor Another call to this method will return the following created node if any. Note that the order in which Nodes are created has nothing to do with the order defined in the XML descriptor.

Returns:
Node
Throws:
NodeException

getNode

public Node getNode(int index)
             throws NodeException
Returns the Node mapped to this VirtualNode with the specified index. There is no relationship between, the order in the xml descriptor and the order in the array.

Parameters:
index -
Returns:
Node the node at the specified index in the array of nodes mapped to this VirtualNode
Throws:
NodeException

getNodesURL

public java.lang.String[] getNodesURL()
                               throws NodeException
Returns all nodes url mapped to this VirualNode

Returns:
String[]. An array of string containing the url of all nodes mapped to this VirtualNode in the XML descriptor.
Throws:
NodeException

getNodes

public Node[] getNodes()
                throws NodeException
Returns all nodes mapped to this VirtualNode

Returns:
Node[] An array of Node conataining all the nodes mapped to this VirtualNode in the XML descriptor
Throws:
NodeException

getNode

public Node getNode(java.lang.String url)
             throws NodeException
Returns the node of the given url among nodes mapped to this VirtualNode in the xml descriptor or null if such node does not exist.

Parameters:
url -
Returns:
Node the node of the given url or null if such node does not exist
Throws:
NodeException

createNodeOnCurrentJvm

public void createNodeOnCurrentJvm(java.lang.String protocol)
Creates a node with the given protocol(or null) on the current jvm, ie the jvm that originates the creation of this VirtualNode. This newly created node will is mapped on this VirtualNode

Parameters:
protocol - the protocol to create the node. If null protocol will be set to the system property: proactive.communication.protocol.

killAll

public void killAll(boolean softly)
Kills all nodes mapped to this VirtualNode. It is in fact the runtime(so the jvm) on which the node is running that is killed. Nodes are previously unregistered from any registry.

Parameters:
softly - if false, all jvms created when activating this VirtualNode are killed abruptely if true a jvm that originates the creation of a rmi registry waits until registry is empty before dying. To be more precise a thraed is created to ask periodically the registry if objects are still registered.

getUniqueAO

public java.lang.Object getUniqueAO()
                             throws ProActiveException
Returns the unique active object created on the unique node mapped to this VirtualNode. This method should be called on a virtualNode, with unique_singleAO property defined in the XML descriptor. If more than one active object are found, a warning is generated, and the first active object found is returned

Returns:
Object the unique active object created on the unique node mapped to this VirtualNode. If many active objects are found, the first one is returned
Throws:
ProActiveException - if no active objects are created on this VirtualNode.

isActivated

public boolean isActivated()
Returns true is this VirtualNode is already activated, false otherwise


isLookup

public boolean isLookup()
Returns:
true if this VirtualNode is a VirtualNodeLookup, false if it is a VirtualNodeImpl

setRuntimeInformations

public void setRuntimeInformations(java.lang.String information,
                                   java.lang.String value)
                            throws ProActiveException
Allows to set runtime informations for this VirtualNode activation. This method allows to give to this VirtualNode some informations retrieved at runtime and not defined in the XML descriptor. In the current release, this method can be called on a VirtualNode resulting from a lookup. The only one information that can be set is LOOKUP_HOST. This information has a sense if in the XML descriptor this VirtualNode is defined with the line:
 lookup virtualNode="vnName" host="*" protocol="rmi or jini", ie the name of the host where to perform the lookup
 will be known at runtime.
 
We expect to implement several runtime informations. If this method fails, for instance, if the property does not exist or has already been set, or is performed on a VirtualNode not resulting from a lookup, an exception will be thrown but the application will carry on.

Parameters:
information - the information to be set at runtime
value - the value of the information
Throws:
ProActiveException - if the given information does not exist or has alredy been set

getMinNumberOfNodes

public int getMinNumberOfNodes()
Returns the minimum number of nodes needed for this VirtualNode. This number represents the minimum number of nodes, this VirtualNode needs in order to be suitable for the application. Default value is the total number of nodes requested in the XML file


isMultiple

public boolean isMultiple()
checks the cardinality of the virtual node (i.e. whether the node is mapped to several nodes or not)

Returns:
true if the virtual node is mapped to several nodes, false otherwise


Copyright 2001-2005 INRIA All Rights Reserved.