Calypso Gateway v1.0

codec.dyntree
Class DynDependencyManager

java.lang.Object
  |
  +--codec.dyntree.DynDependencyManager

public final class DynDependencyManager
extends java.lang.Object

Class performing updates of interrelated Any and DynAny components. The reason for introducing this class is that during e.g. preparing a request by VisitorAdapter & ServerCallVisitor they may initialize the values of Any objects derived by contents, not by reference from DynAny objects originally represented in request. These DynAny objects, in their turn, might have been derived by contents, not by reference from original Any objects represented in the request. Thus, initialization done by e.g. ServerCallVisitor does not affect the original data contained in NVList. This class registers dependencies between Any and DynAny objects and then makes the content update of the original values after all derived values are initialized by e.g. ServerCallVisitor.


Field Summary
private  org.omg.CORBA.ORB orb
           
private  DynTree relations
           
 
Constructor Summary
DynDependencyManager()
           
 
Method Summary
 void setContainerDependency(java.lang.Object container, java.lang.Object contained)
          The relationship between two objects set by this method means that "contained" is encapsulated into "container", thus "container" content is incomplete unless all its "contained" values are properly updated.
 void setContentDependency(java.lang.Object origin, java.lang.Object dependent)
          The relation between two objects set by this method means that "dependent" has been created from "origin" by content, not by reference, that is, contents of "origin" has been copied to "dependent".
 void updateContents()
          Perform an update of tree hierarchy created by set() methods of the class, starting from leaves and going up along the tree.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

relations

private DynTree relations

orb

private org.omg.CORBA.ORB orb
Constructor Detail

DynDependencyManager

public DynDependencyManager()
Method Detail

setContentDependency

public void setContentDependency(java.lang.Object origin,
                                 java.lang.Object dependent)
The relation between two objects set by this method means that "dependent" has been created from "origin" by content, not by reference, that is, contents of "origin" has been copied to "dependent". After the "dependent" is properly initialized, its contents must be copied back to "origin". Only two ways of calling this method are allowed: (a) "origin" is an instance of DynAny, "dependent" is an instance of Any; (b) "origin" is an instance of Any, "dependent" is an instance of DynAny. Note that relationship between "origin" and "dependent" is one-to-one, that is, "origin" may have exactly one "dependent".

setContainerDependency

public void setContainerDependency(java.lang.Object container,
                                   java.lang.Object contained)
The relationship between two objects set by this method means that "contained" is encapsulated into "container", thus "container" content is incomplete unless all its "contained" values are properly updated. Establishing such relationship prevents use of "container" as "dependent" for content update of its "origin", unless all members of "container" are properly updated. Unlike setContentDependency(), this relationship sets only order of updates, not actors of updates. Note that this is a "one-to-many" relationship, that is "container" may be associated with several "contained" objects. Both "container" and "contained" shall be either DynAny or Any.

updateContents

public void updateContents()
Perform an update of tree hierarchy created by set() methods of the class, starting from leaves and going up along the tree. Cycles are not allowed and detected during update, resulting in fail fast. At the very first stage of the iteration, all leaves are considered to be already updated.

Calypso Gateway v1.0