org.objectweb.proactive.core.component.adl.vnexportation
Class ExportedVirtualNodesList

java.lang.Object
  extended byorg.objectweb.proactive.core.component.adl.vnexportation.ExportedVirtualNodesList

public class ExportedVirtualNodesList
extends java.lang.Object

A static container of exported / composed virtual nodes.
It could be refactored as a standard Fractal component.

The virtual nodes are organized in a set of linked list, where the base structural unit is a LinkedVirtualNode.

Author:
Matthieu Morel

Field Summary
static java.lang.String COMPOSING_VIRTUAL_NODES_REGEX
           
static java.lang.String EMPTY_COMPOSING_VIRTUAL_NODES
           
 
Method Summary
 void addExportedVirtualNode(java.lang.String componentName, java.lang.String virtualNode, java.lang.String composingVirtualNodes)
          Adds to the composition an exported virtual node with its composing virtual nodes as a String.
static void checkComposingVirtualNodesSyntax(java.lang.String composingVirtualNodes)
          Checks the syntax of the given String of composing virtual nodes
 void compose(java.lang.String componentName, ExportedVirtualNode exportedVN, ComposingVirtualNode composingVN, boolean composingVNIsMultiple)
          Links virtual nodes to composing nodes and to exporting node
 void compose(java.lang.String exportedVNComponent, java.lang.String exportedVN, java.lang.String baseVNComponent, java.lang.String baseVN, boolean composingVNIsMultiple)
          Links virtual nodes to composing nodes and to exporting node
 void empty()
          Empties the current composition
 java.util.List getComposingVirtualNodes(java.lang.String componentName, java.lang.String virtualNodeName)
          Returns the list of composing virtual nodes for the given exported virtual node as a list of linked virtual nodes
 java.util.List getExportedVirtualNodes(java.lang.String componentName)
          Builds a list of the exported (and only exported) linked virtual nodes for the component whose name is given
 java.lang.String getExportedVirtualNodesAsString(java.lang.String componentName)
          Returns a String representation of the exported virtual nodes for the named component.
 java.util.List getInconsistentExportedVirtualNodes()
          This method helps recognizing the exported virtual nodes causing problem in the composition
 java.util.Map getList()
           
 LinkedVirtualNode getNode(java.lang.String componentName, java.lang.String virtualNodeName, boolean createIfNotFound)
          Returns the linked virtual node corresponding to the given parameters.
static ExportedVirtualNodesList instance()
          Returns the unique instance
 void removeExportedVirtualNode(java.lang.String componentName, java.lang.String virtualNodeName)
          Removes a virtual node from the composition
 void setComposingVirtualNodes(java.lang.String componentName, java.lang.String virtualNodeName, java.lang.String composingVirtualNodes)
          Sets the composing virtual nodes for a given exported virtual node
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COMPOSING_VIRTUAL_NODES_REGEX

public static final java.lang.String COMPOSING_VIRTUAL_NODES_REGEX
See Also:
Constant Field Values

EMPTY_COMPOSING_VIRTUAL_NODES

public static final java.lang.String EMPTY_COMPOSING_VIRTUAL_NODES
See Also:
Constant Field Values
Method Detail

instance

public static ExportedVirtualNodesList instance()
Returns the unique instance

Returns:
a unique instance for the vm

getList

public java.util.Map getList()

compose

public void compose(java.lang.String exportedVNComponent,
                    java.lang.String exportedVN,
                    java.lang.String baseVNComponent,
                    java.lang.String baseVN,
                    boolean composingVNIsMultiple)
             throws org.objectweb.fractal.adl.ADLException
Links virtual nodes to composing nodes and to exporting node

Parameters:
exportedVNComponent - the name of the component of the exported virtual node
exportedVN - the name of the exported virtual node
baseVNComponent - the name of a component of the base (composing) virtual node
baseVN - the name of a base (composing) virtual node
composingVNIsMultiple - true if the virtual node is multiple, false if it is single
Throws:
org.objectweb.fractal.adl.ADLException

compose

public void compose(java.lang.String componentName,
                    ExportedVirtualNode exportedVN,
                    ComposingVirtualNode composingVN,
                    boolean composingVNIsMultiple)
             throws org.objectweb.fractal.adl.ADLException
Links virtual nodes to composing nodes and to exporting node

Parameters:
componentName - the name of the current component defining the exportation
exportedVN - the name of the exported virtual node
composingVN - the name of the component containing a composing virtual node
composingVNIsMultiple - the name of the composing virtual node inside the
Throws:
org.objectweb.fractal.adl.ADLException

getNode

public LinkedVirtualNode getNode(java.lang.String componentName,
                                 java.lang.String virtualNodeName,
                                 boolean createIfNotFound)
Returns the linked virtual node corresponding to the given parameters.

Parameters:
componentName - the name of the component
virtualNodeName - the name of the linked virtual node
createIfNotFound - if true, a LinkedVirtualNode is created with the given component name and virtual node name. Exportation and composition is still empty for this newly created virtual node.
Returns:
a linked virtual node

getExportedVirtualNodes

public java.util.List getExportedVirtualNodes(java.lang.String componentName)
Builds a list of the exported (and only exported) linked virtual nodes for the component whose name is given

Parameters:
componentName - the name of the component whose exported virtual nodes we want
Returns:
the exported virtual nodes for that named component

getExportedVirtualNodesAsString

public java.lang.String getExportedVirtualNodesAsString(java.lang.String componentName)
Returns a String representation of the exported virtual nodes for the named component.

Parameters:
componentName - the name of the component we are interested in
Returns:
a String representation of the exported virtual nodes.

addExportedVirtualNode

public void addExportedVirtualNode(java.lang.String componentName,
                                   java.lang.String virtualNode,
                                   java.lang.String composingVirtualNodes)
Adds to the composition an exported virtual node with its composing virtual nodes as a String.

Parameters:
componentName - the name of the component
virtualNode - the name of the virtual node
composingVirtualNodes - a String of composing virtual nodes, which should match the following regular expression : [^.;]+[.][^.;]+[;]? (example : comp1.VN1 ; comp2.VN2)

removeExportedVirtualNode

public void removeExportedVirtualNode(java.lang.String componentName,
                                      java.lang.String virtualNodeName)
Removes a virtual node from the composition

Parameters:
componentName - the name of the component
virtualNodeName - the name of the virtual node

getComposingVirtualNodes

public java.util.List getComposingVirtualNodes(java.lang.String componentName,
                                               java.lang.String virtualNodeName)
Returns the list of composing virtual nodes for the given exported virtual node as a list of linked virtual nodes

Parameters:
componentName - the name of the component
virtualNodeName - the name of the exported virtual node
Returns:
a list of linked virtual nodes corresponding to the virtual nodes composing the specified exported virtual node

setComposingVirtualNodes

public void setComposingVirtualNodes(java.lang.String componentName,
                                     java.lang.String virtualNodeName,
                                     java.lang.String composingVirtualNodes)
Sets the composing virtual nodes for a given exported virtual node

Parameters:
componentName - the name of the component
virtualNodeName - the name of the exported virtual node
composingVirtualNodes - the list of composing virtual nodes as a String matching the following regular expression : "[^.;]+[.][^.;]+[;]?" (example : comp1.VN1 ; comp2.VN2)

checkComposingVirtualNodesSyntax

public static void checkComposingVirtualNodesSyntax(java.lang.String composingVirtualNodes)
Checks the syntax of the given String of composing virtual nodes

Parameters:
composingVirtualNodes - a String of composing virtual nodes

getInconsistentExportedVirtualNodes

public java.util.List getInconsistentExportedVirtualNodes()
This method helps recognizing the exported virtual nodes causing problem in the composition

Returns:
a list of exported virtual nodes causing problem

empty

public void empty()
Empties the current composition


toString

public java.lang.String toString()


Copyright ? October 2004 INRIA All Rights Reserved.