1 2 package SOFA.SOFAnode.Util.ConnectorProtocolGen; 3 4 import SOFA.SOFAnode.Made.CDL.BadBindException; 5 import SOFA.SOFAnode.Made.CDL.CompBind; 6 import SOFA.SOFAnode.Made.CDL.CompBindOper; 7 import SOFA.SOFAnode.Made.CDL.DetectedConnector; 8 import SOFA.SOFAnode.Made.CDL.DetectedConnectors; 9 10 public class CSProcCallBinding { 11 12 public static void addDetectedConnector(String [] connectorOperations, DetectedConnectors dc, CompBind cb) throws BadBindException { 13 CompBindOper rhs, lhs; 14 rhs = cb.rhs; 15 lhs = cb.lhs; 16 DetectedConnector cn = dc.containsConnWithSRole(rhs); 17 if (cn == null) { cn = new DetectedConnector(lhs, rhs, cb.mode, cb.using); 19 cn.operations = connectorOperations; 20 dc.add(cn); 21 } else { if ( (cb.using.compareTo("CSProcCall")!=0)) { 23 throw new BadBindException("One interface is connected by different types of connectors."); 24 } 25 if (cn.bindMode != cb.mode) { 26 throw new BadBindException("One interface is connected by different modes of ties."); 27 } 28 if ( !cn.containsSameCRole(lhs) ) { 29 cn.addCRole(lhs); 30 } 31 } 32 } 33 } 34 35 | Popular Tags |