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

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

public class LinkedVirtualNode
extends java.lang.Object

This class is a link of a chained list of virtual nodes. An instance specifies :
- the name of the component which defines it
- the name of this virtual node
- if it is part of a virtual node composition (i.e. a "composingVirtualNode in the ADL) : a reference on a "composer" virtual node
- if it is a composer of other virtual nodes (i.e. an "exportedVirtualNode" in the ADL) : references on "composing" virtual nodes

The highest virtual node in the hierarchy of composed virtual nodes gives its name to all underlying virtual nodes. This name can be retreived by the method getExportedVirtualNodeNameAfterComposition().

LinkedVirtualNode elements inherit from the multiplicity of their composing nodes : if at least one of them is multiple, then this LinkedVirtualNode is multiple

Author:
Matthieu Morel

Field Summary
static java.lang.String EMPTY_COMPONENT_NAME
           
static java.lang.String EMPTY_VIRTUAL_NODE_NAME
           
 
Constructor Summary
LinkedVirtualNode(java.lang.String componentName, java.lang.String virtualNodeName)
          Constructor
 
Method Summary
 boolean addComposingVirtualNode(LinkedVirtualNode vn)
          Adds a composing virtual node
 java.lang.String getCompleteNameBeforeComposition()
           
 LinkedVirtualNode getComposer()
           
 java.util.List getComposingVirtualNodes()
          Getter for the composing virtual nodes
 java.lang.String getComposingVirtualNodesAsString()
          Returns a String representation of the composing virtual nodes
 java.lang.String getDefiningComponentName()
          Returns the component that defined this linked virtual node
 java.lang.String getExportedVirtualNodeNameAfterComposition()
           
 java.lang.String getExportedVirtualNodeNameBeforeComposition()
           
 java.lang.String getVirtualNodeName()
           
 boolean isComposedFrom(java.lang.String componentName, java.lang.String virtualNodeName)
           
 boolean isExported()
          Checks whether this virtual node is exported
 boolean isLeaf()
           
 boolean isMultiple()
          Getter for cardinality
 boolean isSelfExported()
           
 void setIsLeaf()
           
 void setMultiple(boolean yes)
          Setter for cardinality
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EMPTY_COMPONENT_NAME

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

EMPTY_VIRTUAL_NODE_NAME

public static final java.lang.String EMPTY_VIRTUAL_NODE_NAME
See Also:
Constant Field Values
Constructor Detail

LinkedVirtualNode

public LinkedVirtualNode(java.lang.String componentName,
                         java.lang.String virtualNodeName)
Constructor

Parameters:
componentName - the name of the component which defines this virtual node
virtualNodeName - the name of the virtual node
Method Detail

addComposingVirtualNode

public boolean addComposingVirtualNode(LinkedVirtualNode vn)
Adds a composing virtual node

Parameters:
vn - a composing virtual node
Returns:
true if the virtual node was added, false if it was already present as a composing virtual node

getComposingVirtualNodes

public java.util.List getComposingVirtualNodes()
Getter for the composing virtual nodes

Returns:
the list of the composing virtual nodes for this virtual node

getComposingVirtualNodesAsString

public java.lang.String getComposingVirtualNodesAsString()
Returns a String representation of the composing virtual nodes

Returns:
a String representation of the composing virtual nodes

getVirtualNodeName

public java.lang.String getVirtualNodeName()
Returns:
the name of the virtual node given at construction time

getCompleteNameBeforeComposition

public java.lang.String getCompleteNameBeforeComposition()
Returns:
name_of_the_defining_component.name_of_the_virtual_node_at_construction_time

getExportedVirtualNodeNameAfterComposition

public java.lang.String getExportedVirtualNodeNameAfterComposition()
Returns:
the name resulting from the composition. It corresponds to the name of the highest virtual node in the hierarchy of composed virtual nodes

getExportedVirtualNodeNameBeforeComposition

public java.lang.String getExportedVirtualNodeNameBeforeComposition()
Returns:
the name

setMultiple

public void setMultiple(boolean yes)
Setter for cardinality

Parameters:
yes - if true the cardinality is set to multiple

isMultiple

public boolean isMultiple()
Getter for cardinality

Returns:
true if this virtual node is multiple

isExported

public boolean isExported()
Checks whether this virtual node is exported

Returns:
true if this virtual node is an exported virtual node (i.e. if it is holds composing virtual nodes)

getDefiningComponentName

public java.lang.String getDefiningComponentName()
Returns the component that defined this linked virtual node

Returns:
the component that defined this linked virtual node

isSelfExported

public boolean isSelfExported()
Returns:
true if the composing virtual node and the exported virtual node are defined in the same component.

isComposedFrom

public boolean isComposedFrom(java.lang.String componentName,
                              java.lang.String virtualNodeName)
Parameters:
componentName - name of the component
virtualNodeName - name of the virtual node
Returns:
true if the current component contains the specified virtual node as a composing element.

getComposer

public LinkedVirtualNode getComposer()
Returns:
the composer linked virtual node. null if this virtual node is not exported

setIsLeaf

public void setIsLeaf()

isLeaf

public boolean isLeaf()

toString

public java.lang.String toString()


Copyright 2001-2005 INRIA All Rights Reserved.