Class ChannelRegistry

java.lang.Object
  |
  +--ChannelRegistry

public class ChannelRegistry
extends java.lang.Object

This class stores information about cannel communication, that is needed for Phase III of translation, i.e., duplication of channels if necessary.

Conventionally,

Version:
Vanilla-1 Mon Apr 9 13:44:10 2001
Author:
M. Oliver Möller

Field Summary
private static long channelCopyCounter
          Counter used for @{link newPostfix}
private  java.util.Hashtable mapTinstToHashtable
          Maps Textual instantiations to hashtables, that contain the syncs occuring in this particular tinst as keys and Vectors of transitions as elements
protected  java.util.Stack possibleConflicts
          Stack of synchronisations that might cause conflicts.
Use method addConflict(java.lang.String, org.w3c.dom.Element, TextualInstantiation) to access it.
private  InstantiationTree rootOfInstTree
          (completed) tree of textual instantiations
Needed to compute father/child replation
private static java.lang.String uniquePostfix
          Postfix for channel copies NOTE:!!! Should contain some chars that the user cannot use !!!
 
Constructor Summary
ChannelRegistry(InstantiationTree theInstTree)
          Default Constructor: Needs references
 
Method Summary
 void addConflict(java.lang.String sync, org.w3c.dom.Element transition, TextualInstantiation tinst)
          Adds the synchronization from a global join, that might cause a conflict.

Note that the TextualInstantiaton handed over is not where the transition lives in, but the tinst of the component, where it originates from.
 void addConflictsForNewSync(java.lang.String oldSync, java.lang.String newSync)
          Go through the conflicts;

If there was a conflict entry for oldSync, add a new conflict entry for newSync

(Necessary, see ChannelManager Handnotes)
private  java.util.Vector allTransitionsWithSyncInTinst(java.lang.String sync, TextualInstantiation tinst)
          Return vector of entires, of empty vector if there are none.
static java.lang.String chanOfSync(java.lang.String sync)
          Return channel of sync (handshake)
Throw Exception, if the input is not a sync.
private  java.util.Enumeration enumTinstsOutsideTinst(TextualInstantiation tinst)
          Enumerate textual Instantiations (including root) outside a specific one, i.e., above and incomparable to it.
 java.util.Enumeration enumTinstTransitionsWithSyncOutsideTinst(java.lang.String sync, TextualInstantiation tinst)
          The transitions OUTSIDE a tinst (those have to be cloned in phase III) Return enumeration of TinstElementPairs
 java.util.Enumeration enumTransitionsWithSyncOusideTinst(java.lang.String sync, TextualInstantiation tinst)
          Returns an enumeration of all (flat) transtions, that carry the specified sync and reside outside the specific tinst.
(possibly the empty enumeration).

Only works properly, if all transitions were registered with registerSync(java.lang.String, org.w3c.dom.Element, TextualInstantiation).
static java.lang.String matchingSync(java.lang.String sync)
          Return matching sync (handshake)
Throw Exception, if the input is not a sync.
static int max(int a, int b)
          MAXimum of two integers.
static java.lang.String newPostfix()
          New (uniquifying) postfix to keep track of channel copies
private  boolean occursIn(java.lang.String sync, TextualInstantiation tinst)
          Check Hashtable for entry
 boolean occursInOrBelow(java.lang.String sync, TextualInstantiation tinst)
          Checks, whether there exist an entry for sync in the textual instantiation or in any descendand of it
 void registerSync(java.lang.String sync, org.w3c.dom.Element transition, TextualInstantiation tinst)
          Regiser a sync occuring on a specific transition in a specific texual instantiation

(I.e., create appropriate hashtable entries)
static java.lang.String typeOfSync(java.lang.String sync)
          Return 'type' of sync (handshake), i.e.
 void unregisterSync(java.lang.String sync, org.w3c.dom.Element transition, TextualInstantiation tinst)
          UNRegiser a sync occuring on a specific transition in a specific texual instantiation, i.e., remove from database
(Needed if the synchronization changes)
Throws exception, if there was no registration entry.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

rootOfInstTree

private InstantiationTree rootOfInstTree
(completed) tree of textual instantiations
Needed to compute father/child replation

mapTinstToHashtable

private java.util.Hashtable mapTinstToHashtable
Maps Textual instantiations to hashtables, that contain the syncs occuring in this particular tinst as keys and Vectors of transitions as elements

possibleConflicts

protected java.util.Stack possibleConflicts
Stack of synchronisations that might cause conflicts.
Use method addConflict(java.lang.String, org.w3c.dom.Element, TextualInstantiation) to access it.

uniquePostfix

private static final java.lang.String uniquePostfix
Postfix for channel copies NOTE:!!! Should contain some chars that the user cannot use !!!

channelCopyCounter

private static long channelCopyCounter
Counter used for @{link newPostfix}
Constructor Detail

ChannelRegistry

public ChannelRegistry(InstantiationTree theInstTree)
Default Constructor: Needs references
Method Detail

occursInOrBelow

public boolean occursInOrBelow(java.lang.String sync,
                               TextualInstantiation tinst)
Checks, whether there exist an entry for sync in the textual instantiation or in any descendand of it

registerSync

public void registerSync(java.lang.String sync,
                         org.w3c.dom.Element transition,
                         TextualInstantiation tinst)
Regiser a sync occuring on a specific transition in a specific texual instantiation

(I.e., create appropriate hashtable entries)

unregisterSync

public void unregisterSync(java.lang.String sync,
                           org.w3c.dom.Element transition,
                           TextualInstantiation tinst)
                    throws java.lang.Exception
UNRegiser a sync occuring on a specific transition in a specific texual instantiation, i.e., remove from database
(Needed if the synchronization changes)
Throws exception, if there was no registration entry.

enumTransitionsWithSyncOusideTinst

public java.util.Enumeration enumTransitionsWithSyncOusideTinst(java.lang.String sync,
                                                                TextualInstantiation tinst)
Returns an enumeration of all (flat) transtions, that carry the specified sync and reside outside the specific tinst.
(possibly the empty enumeration).

Only works properly, if all transitions were registered with registerSync(java.lang.String, org.w3c.dom.Element, TextualInstantiation).

addConflict

public void addConflict(java.lang.String sync,
                        org.w3c.dom.Element transition,
                        TextualInstantiation tinst)
Adds the synchronization from a global join, that might cause a conflict.

Note that the TextualInstantiaton handed over is not where the transition lives in, but the tinst of the component, where it originates from.

addConflictsForNewSync

public void addConflictsForNewSync(java.lang.String oldSync,
                                   java.lang.String newSync)
Go through the conflicts;

If there was a conflict entry for oldSync, add a new conflict entry for newSync

(Necessary, see ChannelManager Handnotes)

matchingSync

public static java.lang.String matchingSync(java.lang.String sync)
                                     throws java.lang.Exception
Return matching sync (handshake)
Throw Exception, if the input is not a sync.

chanOfSync

public static java.lang.String chanOfSync(java.lang.String sync)
                                   throws java.lang.Exception
Return channel of sync (handshake)
Throw Exception, if the input is not a sync.

typeOfSync

public static java.lang.String typeOfSync(java.lang.String sync)
                                   throws java.lang.Exception
Return 'type' of sync (handshake), i.e. the string "!" or "?"
Throw Exception, if the input is not a sync.

max

public static int max(int a,
                      int b)
MAXimum of two integers.

newPostfix

public static java.lang.String newPostfix()
New (uniquifying) postfix to keep track of channel copies

occursIn

private boolean occursIn(java.lang.String sync,
                         TextualInstantiation tinst)
Check Hashtable for entry

enumTinstsOutsideTinst

private java.util.Enumeration enumTinstsOutsideTinst(TextualInstantiation tinst)
Enumerate textual Instantiations (including root) outside a specific one, i.e., above and incomparable to it.

allTransitionsWithSyncInTinst

private java.util.Vector allTransitionsWithSyncInTinst(java.lang.String sync,
                                                       TextualInstantiation tinst)
Return vector of entires, of empty vector if there are none.

enumTinstTransitionsWithSyncOutsideTinst

public java.util.Enumeration enumTinstTransitionsWithSyncOutsideTinst(java.lang.String sync,
                                                                      TextualInstantiation tinst)
The transitions OUTSIDE a tinst (those have to be cloned in phase III) Return enumeration of TinstElementPairs