From: Robert L. <rle...@us...> - 2007-03-20 14:05:25
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv3367/src/ccmtools/generator/java/templates Modified Files: UsesDefMultipleEquivalentMethodAdapterLocalTemplate.java UsesDefEquivalentMethodAdapterLocalTemplate.java ProvidesDefEquivalentMethodAdapterLocalTemplate.java Log Message: component adapter now uses ComponentDelegator Index: UsesDefMultipleEquivalentMethodAdapterLocalTemplate.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/UsesDefMultipleEquivalentMethodAdapterLocalTemplate.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UsesDefMultipleEquivalentMethodAdapterLocalTemplate.java 20 Mar 2007 10:56:01 -0000 1.5 --- UsesDefMultipleEquivalentMethodAdapterLocalTemplate.java 20 Mar 2007 14:05:21 -0000 1.6 *************** *** 17,36 **** protected final String TEXT_1 = NL + " public Components.Cookie connect_"; protected final String TEXT_2 = "("; ! protected final String TEXT_3 = " obj)" + NL + " throws Components.ExceededConnectionLimit, " + NL + " Components.InvalidConnection" + NL + " {" + NL + " logger.fine(\"Object reference = \" + obj);" + NL + " if(obj == null)" + NL + " {" + NL + " throw new Components.InvalidConnection();" + NL + " }\t" + NL + " else" + NL + " {" + NL + " Components.Cookie ck = new Components.CookieImpl(); "; ! protected final String TEXT_4 = NL + " "; ! protected final String TEXT_5 = "ReceptacleMap.put(ck, obj);" + NL + " return ck;" + NL + " }" + NL + " }" + NL + "" + NL + " public "; ! protected final String TEXT_6 = " disconnect_"; ! protected final String TEXT_7 = "(Components.Cookie ck)" + NL + " throws Components.InvalidConnection" + NL + " {" + NL + "\t logger.fine(\"Cookie = \" + ck); " + NL + " if(ck == null || !"; ! protected final String TEXT_8 = "ReceptacleMap.containsKey(ck))" + NL + " {" + NL + " throw new Components.InvalidConnection();" + NL + " }" + NL + " else" + NL + " {"; ! protected final String TEXT_9 = NL + " "; ! protected final String TEXT_10 = " f = "; ! protected final String TEXT_11 = "ReceptacleMap.get(ck);"; ! protected final String TEXT_12 = NL + " "; ! protected final String TEXT_13 = "ReceptacleMap.remove(ck);" + NL + " return f;" + NL + " }" + NL + " }" + NL + " " + NL + " public java.util.Map<Components.Cookie, "; ! protected final String TEXT_14 = "> get_connections_"; ! protected final String TEXT_15 = "()" + NL + " {" + NL + " logger.fine(\"\");" + NL + " // return a copy of the receptacle map" + NL + " return new java.util.HashMap<Components.Cookie, "; ! protected final String TEXT_16 = ">("; ! protected final String TEXT_17 = "ReceptacleMap);" + NL + " }"; ! protected final String TEXT_18 = NL; public String generate(Object argument) --- 17,38 ---- protected final String TEXT_1 = NL + " public Components.Cookie connect_"; protected final String TEXT_2 = "("; ! protected final String TEXT_3 = " obj)" + NL + " throws Components.ExceededConnectionLimit, " + NL + " Components.InvalidConnection" + NL + " {" + NL + " logger.fine(\"Object reference = \" + obj);" + NL + " if(obj == null)" + NL + " {" + NL + " throw new Components.InvalidConnection();" + NL + " }" + NL + " Components.Cookie ck;" + NL + " if(delegator!=null)" + NL + " {" + NL + " \ttry" + NL + " \t{" + NL + " \t\tck = delegator.connect(\""; ! protected final String TEXT_4 = "\", obj);" + NL + " \t}" + NL + " \tcatch(Components.InvalidName e)" + NL + " \t{" + NL + " \t\tthrow new Components.InvalidConnection(e.getMessage());" + NL + " \t}" + NL + " \tcatch(Components.AlreadyConnected e)" + NL + " \t{" + NL + " \t\tthrow new Components.ExceededConnectionLimit(e.getMessage());" + NL + " \t}" + NL + " }" + NL + " else" + NL + " {" + NL + " ck = new Components.CookieImpl(); " + NL + " }"; ! protected final String TEXT_5 = NL + " "; ! protected final String TEXT_6 = "ReceptacleMap.put(ck, obj);" + NL + " return ck;" + NL + " }" + NL + "" + NL + " public "; ! protected final String TEXT_7 = " disconnect_"; ! protected final String TEXT_8 = "(Components.Cookie ck)" + NL + " throws Components.InvalidConnection" + NL + " {" + NL + "\t logger.fine(\"Cookie = \" + ck); " + NL + " if(!"; ! protected final String TEXT_9 = "ReceptacleMap.containsKey(ck))" + NL + " {" + NL + " throw new Components.InvalidConnection();" + NL + " }" + NL + " if(delegator!=null)" + NL + " {" + NL + " \ttry" + NL + " \t{" + NL + " \t\tdelegator.disconnect(\""; ! protected final String TEXT_10 = "\", ck);" + NL + " \t}" + NL + " \tcatch(Components.InvalidName e)" + NL + " \t{" + NL + " \t\tthrow new Components.InvalidConnection(e.getMessage());" + NL + " \t}" + NL + " \tcatch(Components.CookieRequired e)" + NL + " \t{" + NL + " \t\tthrow new Components.InvalidConnection(e.getMessage());" + NL + " \t}" + NL + " \tcatch(Components.NoConnection e)" + NL + " \t{" + NL + " \t\tthrow new Components.InvalidConnection(e.getMessage());" + NL + " \t}" + NL + " }"; ! protected final String TEXT_11 = NL + " "; ! protected final String TEXT_12 = " f = "; ! protected final String TEXT_13 = "ReceptacleMap.get(ck);"; ! protected final String TEXT_14 = NL + " "; ! protected final String TEXT_15 = "ReceptacleMap.remove(ck);" + NL + " return f;" + NL + " }" + NL + " " + NL + " public java.util.Map<Components.Cookie, "; ! protected final String TEXT_16 = "> get_connections_"; ! protected final String TEXT_17 = "()" + NL + " {" + NL + " logger.fine(\"\");" + NL + " // return a copy of the receptacle map" + NL + " return new java.util.HashMap<Components.Cookie, "; ! protected final String TEXT_18 = ">("; ! protected final String TEXT_19 = "ReceptacleMap);" + NL + " }"; ! protected final String TEXT_20 = NL; public String generate(Object argument) *************** *** 46,67 **** stringBuffer.append(iface.generateAbsoluteJavaName()); stringBuffer.append(TEXT_3); - stringBuffer.append(TEXT_4); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_5); - stringBuffer.append(iface.generateAbsoluteJavaName()); - stringBuffer.append(TEXT_6); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_7); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_8); stringBuffer.append(TEXT_9); - stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); - stringBuffer.append(TEXT_10); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_11); stringBuffer.append(TEXT_12); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_13); - stringBuffer.append(iface.generateAbsoluteJavaName()); stringBuffer.append(TEXT_14); stringBuffer.append(uses.getIdentifier()); --- 48,69 ---- stringBuffer.append(iface.generateAbsoluteJavaName()); stringBuffer.append(TEXT_3); stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_4); stringBuffer.append(TEXT_5); stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_6); + stringBuffer.append(iface.generateAbsoluteJavaName()); stringBuffer.append(TEXT_7); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_8); + stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_9); stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_10); stringBuffer.append(TEXT_11); + stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); stringBuffer.append(TEXT_12); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_13); stringBuffer.append(TEXT_14); stringBuffer.append(uses.getIdentifier()); *************** *** 71,75 **** --- 73,81 ---- stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_17); + stringBuffer.append(iface.generateAbsoluteJavaName()); stringBuffer.append(TEXT_18); + stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_20); return stringBuffer.toString(); } Index: UsesDefEquivalentMethodAdapterLocalTemplate.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/UsesDefEquivalentMethodAdapterLocalTemplate.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** UsesDefEquivalentMethodAdapterLocalTemplate.java 20 Mar 2007 10:56:00 -0000 1.5 --- UsesDefEquivalentMethodAdapterLocalTemplate.java 20 Mar 2007 14:05:21 -0000 1.6 *************** *** 17,36 **** protected final String TEXT_1 = NL + " public void connect_"; protected final String TEXT_2 = "("; ! protected final String TEXT_3 = " localObj)" + NL + " throws Components.AlreadyConnected, " + NL + " Components.InvalidConnection" + NL + " {" + NL + " logger.fine(\"obj = \" + localObj);" + NL + " if("; ! protected final String TEXT_4 = "Receptacle != null)" + NL + " {" + NL + " throw new Components.AlreadyConnected();" + NL + " }\t" + NL + " else" + NL + " {"; ! protected final String TEXT_5 = NL + " "; ! protected final String TEXT_6 = "Receptacle = localObj;" + NL + " }" + NL + " }" + NL + "" + NL + " public "; ! protected final String TEXT_7 = " disconnect_"; ! protected final String TEXT_8 = "()" + NL + " throws Components.NoConnection" + NL + " {" + NL + " logger.fine(\"\");" + NL + " if("; ! protected final String TEXT_9 = "Receptacle == null)" + NL + " {" + NL + " throw new Components.NoConnection();" + NL + " }" + NL + " else" + NL + " {"; ! protected final String TEXT_10 = NL + " "; ! protected final String TEXT_11 = " f = "; ! protected final String TEXT_12 = "Receptacle;"; ! protected final String TEXT_13 = NL + " "; ! protected final String TEXT_14 = "Receptacle = null;" + NL + " return f;" + NL + " }" + NL + " }" + NL + " " + NL + " public "; ! protected final String TEXT_15 = " get_connection_"; ! protected final String TEXT_16 = "()" + NL + " {" + NL + " logger.fine(\"\");" + NL + " return "; ! protected final String TEXT_17 = "Receptacle;" + NL + " }"; ! protected final String TEXT_18 = NL; public String generate(Object argument) --- 17,38 ---- protected final String TEXT_1 = NL + " public void connect_"; protected final String TEXT_2 = "("; ! protected final String TEXT_3 = " localObj)" + NL + " throws Components.AlreadyConnected, " + NL + " Components.InvalidConnection" + NL + " {" + NL + " logger.fine(\"obj = \" + localObj);" + NL + " if(delegator!=null)" + NL + " {" + NL + " \ttry" + NL + " \t{" + NL + " \t\tdelegator.connect(\""; ! protected final String TEXT_4 = "\", localObj);" + NL + " \t}" + NL + " \tcatch(Components.InvalidName e)" + NL + " \t{" + NL + " \t\tthrow new Components.InvalidConnection(e.getMessage());" + NL + " \t}" + NL + " \tcatch(Components.ExceededConnectionLimit e)" + NL + " \t{" + NL + " \t\tthrow new Components.AlreadyConnected(e.getMessage());" + NL + " \t}" + NL + " }" + NL + " else" + NL + " {" + NL + " if("; ! protected final String TEXT_5 = "Receptacle != null)" + NL + " {" + NL + " throw new Components.AlreadyConnected();" + NL + " }\t" + NL + " }"; ! protected final String TEXT_6 = NL + " "; ! protected final String TEXT_7 = "Receptacle = localObj;" + NL + " }" + NL + "" + NL + " public "; ! protected final String TEXT_8 = " disconnect_"; ! protected final String TEXT_9 = "()" + NL + " throws Components.NoConnection" + NL + " {" + NL + " logger.fine(\"\");" + NL + " if(delegator!=null)" + NL + " {" + NL + " \ttry" + NL + " \t{" + NL + " \t\tdelegator.disconnect(\""; ! protected final String TEXT_10 = "\", null);" + NL + " \t}" + NL + " \tcatch(Components.InvalidName e)" + NL + " \t{" + NL + " \t\tthrow new Components.NoConnection(e.getMessage());" + NL + " \t}" + NL + " \tcatch(Components.InvalidConnection e)" + NL + " \t{" + NL + " \t\tthrow new Components.NoConnection(e.getMessage());" + NL + " \t}" + NL + " \tcatch(Components.CookieRequired e)" + NL + " \t{" + NL + " \t\tthrow new Components.NoConnection(e.getMessage());" + NL + " \t}" + NL + " }" + NL + " else" + NL + " {" + NL + " if("; ! protected final String TEXT_11 = "Receptacle == null)" + NL + " {" + NL + " throw new Components.NoConnection();" + NL + " }" + NL + " }"; ! protected final String TEXT_12 = NL + " "; ! protected final String TEXT_13 = " f = "; ! protected final String TEXT_14 = "Receptacle;"; ! protected final String TEXT_15 = NL + " "; ! protected final String TEXT_16 = "Receptacle = null;" + NL + " return f;" + NL + " }" + NL + " " + NL + " public "; ! protected final String TEXT_17 = " get_connection_"; ! protected final String TEXT_18 = "()" + NL + " {" + NL + " logger.fine(\"\");" + NL + " return "; ! protected final String TEXT_19 = "Receptacle;" + NL + " }"; ! protected final String TEXT_20 = NL; public String generate(Object argument) *************** *** 45,72 **** stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_4); - stringBuffer.append(TEXT_5); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_6); - stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); - stringBuffer.append(TEXT_7); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_8); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_9); stringBuffer.append(TEXT_10); - stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); - stringBuffer.append(TEXT_11); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_12); stringBuffer.append(TEXT_13); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_14); - stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); stringBuffer.append(TEXT_15); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_16); ! stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_17); stringBuffer.append(TEXT_18); return stringBuffer.toString(); } --- 47,78 ---- stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_4); stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_5); stringBuffer.append(TEXT_6); stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_7); + stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); stringBuffer.append(TEXT_8); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_9); + stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_10); stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_11); stringBuffer.append(TEXT_12); + stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); stringBuffer.append(TEXT_13); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_14); stringBuffer.append(TEXT_15); stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_16); ! stringBuffer.append(uses.getInterface().generateAbsoluteJavaName()); stringBuffer.append(TEXT_17); + stringBuffer.append(uses.getIdentifier()); stringBuffer.append(TEXT_18); + stringBuffer.append(uses.getIdentifier()); + stringBuffer.append(TEXT_19); + stringBuffer.append(TEXT_20); return stringBuffer.toString(); } Index: ProvidesDefEquivalentMethodAdapterLocalTemplate.java =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/ProvidesDefEquivalentMethodAdapterLocalTemplate.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ProvidesDefEquivalentMethodAdapterLocalTemplate.java 17 Jul 2006 07:28:08 -0000 1.3 --- ProvidesDefEquivalentMethodAdapterLocalTemplate.java 20 Mar 2007 14:05:21 -0000 1.4 *************** *** 18,28 **** protected final String TEXT_2 = " provide_"; protected final String TEXT_3 = "()" + NL + " {" + NL + " logger.fine(\"\");" + NL + " if("; ! protected final String TEXT_4 = "FacetAdapter == null)" + NL + " {"; ! protected final String TEXT_5 = NL + " "; ! protected final String TEXT_6 = "FacetAdapter = " + NL + " new "; ! protected final String TEXT_7 = "Adapter(localInterface.get_"; ! protected final String TEXT_8 = "());" + NL + " }" + NL + " return "; ! protected final String TEXT_9 = "FacetAdapter;" + NL + " }"; ! protected final String TEXT_10 = NL; public String generate(Object argument) --- 18,32 ---- protected final String TEXT_2 = " provide_"; protected final String TEXT_3 = "()" + NL + " {" + NL + " logger.fine(\"\");" + NL + " if("; ! protected final String TEXT_4 = "FacetAdapter == null)" + NL + " {" + NL + " \tif(delegator!=null)" + NL + " \t{" + NL + " \t\tObject o = delegator.provide(\""; ! protected final String TEXT_5 = "\");" + NL + " \t\tif(o!=null)" + NL + " \t\t{" + NL + " \t\t\t"; ! protected final String TEXT_6 = "FacetAdapter =" + NL + " \t\t\t\t("; ! protected final String TEXT_7 = ")o;" + NL + " \t\t\treturn "; ! protected final String TEXT_8 = "FacetAdapter;" + NL + " \t\t}" + NL + " \t}"; ! protected final String TEXT_9 = NL + " "; ! protected final String TEXT_10 = "FacetAdapter = " + NL + " new "; ! protected final String TEXT_11 = "Adapter(localInterface.get_"; ! protected final String TEXT_12 = "());" + NL + " }" + NL + " return "; ! protected final String TEXT_13 = "FacetAdapter;" + NL + " }"; ! protected final String TEXT_14 = NL; public String generate(Object argument) *************** *** 37,40 **** --- 41,45 ---- stringBuffer.append(provides.getIdentifier()); stringBuffer.append(TEXT_4); + stringBuffer.append(provides.getIdentifier()); stringBuffer.append(TEXT_5); stringBuffer.append(provides.getIdentifier()); *************** *** 44,50 **** stringBuffer.append(provides.getIdentifier()); stringBuffer.append(TEXT_8); - stringBuffer.append(provides.getIdentifier()); stringBuffer.append(TEXT_9); stringBuffer.append(TEXT_10); return stringBuffer.toString(); } --- 49,62 ---- stringBuffer.append(provides.getIdentifier()); stringBuffer.append(TEXT_8); stringBuffer.append(TEXT_9); + stringBuffer.append(provides.getIdentifier()); stringBuffer.append(TEXT_10); + stringBuffer.append(provides.getInterface().generateAbsoluteJavaName()); + stringBuffer.append(TEXT_11); + stringBuffer.append(provides.getIdentifier()); + stringBuffer.append(TEXT_12); + stringBuffer.append(provides.getIdentifier()); + stringBuffer.append(TEXT_13); + stringBuffer.append(TEXT_14); return stringBuffer.toString(); } |