Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/jet In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv12972/src/ccmtools/generator/java/templates/jet Modified Files: ProvidesDefEquivalentMethodAdapterLocal.jet ComponentDefAssemblyClass.jet ProvidesDefGetMethodAssemplyImplementation.jet Log Message: Java Assemblies: new design Index: ComponentDefAssemblyClass.jet =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/jet/ComponentDefAssemblyClass.jet,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** ComponentDefAssemblyClass.jet 20 Mar 2007 10:55:59 -0000 1.10 --- ComponentDefAssemblyClass.jet 21 Mar 2007 12:29:51 -0000 1.11 *************** *** 21,25 **** */ public class <%=component.getIdentifier()%>Impl ! implements <%=component.generateCcmIdentifier()%> { /** Supported interface attribute variables */ --- 21,25 ---- */ public class <%=component.getIdentifier()%>Impl ! implements <%=component.generateCcmIdentifier()%>, Components.ComponentDelegator { /** Supported interface attribute variables */ *************** *** 82,85 **** --- 82,133 ---- } } + + + /* + * Components.ComponentDelegator implementation + */ + + public Object provide( String name ) throws Components.InvalidName + { + <% + for(Iterator i=component.getAssemblyDynamicProvide(); i.hasNext();) + { + %> + <%=i.next().toString()%> + <% + } + %> + throw new Components.InvalidName("unknown facet: "+name); + } + + public Components.Cookie connect( String name, Object connection ) + throws Components.InvalidName, Components.InvalidConnection, + Components.AlreadyConnected, Components.ExceededConnectionLimit + { + <% + for(Iterator i=component.getAssemblyDynamicConnect(); i.hasNext();) + { + %> + <%=i.next().toString()%> + <% + } + %> + throw new Components.InvalidName("unknown receptacle: "+name); + } + + public void disconnect( String name, Components.Cookie ck ) + throws Components.InvalidName, Components.InvalidConnection, + Components.CookieRequired, Components.NoConnection + { + <% + for(Iterator i=component.getAssemblyDynamicDisconnect(); i.hasNext();) + { + %> + <%=i.next().toString()%> + <% + } + %> + throw new Components.InvalidName("unknown receptacle: "+name); + } *************** *** 161,165 **** // setup inner components <% ! for(Iterator i=component.getAssemblyAttributeSetup(); i.hasNext();) { %> --- 209,213 ---- // setup inner components <% ! for(Iterator i=component.getAssemblyActivate(); i.hasNext();) { %> *************** *** 181,185 **** ccm_activate_ok = true; } catch(Exception e) { ! throw new Components.CCMException(e.getMessage(), Components.CCMExceptionReason.CREATE_ERROR); } } --- 229,234 ---- ccm_activate_ok = true; } catch(Exception e) { ! throw new Components.CCMException(e.getMessage(), ! Components.CCMExceptionReason.CREATE_ERROR); } } *************** *** 204,208 **** %> } catch(Exception e) { ! throw new Components.CCMException(e.getMessage(), Components.CCMExceptionReason.REMOVE_ERROR); } } --- 253,258 ---- %> } catch(Exception e) { ! throw new Components.CCMException(e.getMessage(), ! Components.CCMExceptionReason.REMOVE_ERROR); } } Index: ProvidesDefEquivalentMethodAdapterLocal.jet =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/jet/ProvidesDefEquivalentMethodAdapterLocal.jet,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ProvidesDefEquivalentMethodAdapterLocal.jet 20 Mar 2007 14:05:21 -0000 1.3 --- ProvidesDefEquivalentMethodAdapterLocal.jet 21 Mar 2007 12:29:51 -0000 1.4 *************** *** 12,16 **** if(delegator!=null) { ! Object o = delegator.provide("<%=provides.getIdentifier()%>"); if(o!=null) { --- 12,21 ---- if(delegator!=null) { ! Object o; ! try { ! o = delegator.provide("<%=provides.getIdentifier()%>"); ! } catch(Components.InvalidName e) { ! throw new RuntimeException("internal error: "+e.getMessage()); ! } if(o!=null) { Index: ProvidesDefGetMethodAssemplyImplementation.jet =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/jet/ProvidesDefGetMethodAssemplyImplementation.jet,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ProvidesDefGetMethodAssemplyImplementation.jet 27 Feb 2007 08:28:16 -0000 1.4 --- ProvidesDefGetMethodAssemplyImplementation.jet 21 Mar 2007 12:29:51 -0000 1.5 *************** *** 11,18 **** public <%=provides.getInterface().generateAbsoluteJavaCcmName()%> get_<%=provides.getIdentifier()%>() { ! <%=provides.getIdentifier()%>_ = new <%=provides.generateJavaNamespace()%>.<%=provides.getComponent().getIdentifier()%><%=provides.getIdentifier()%>Impl(this); ! if(ccm_activate_ok) { ! <%=provides.getIdentifier()%>_.target = <%=provides.getComponent().getAssemblyInitFacetTargetValue(provides)%>; ! } return <%=provides.getIdentifier()%>_; } --- 11,16 ---- public <%=provides.getInterface().generateAbsoluteJavaCcmName()%> get_<%=provides.getIdentifier()%>() { ! if(<%=provides.getIdentifier()%>_ == null) ! <%=provides.getIdentifier()%>_ = new <%=provides.generateJavaNamespace()%>.<%=provides.getComponent().getIdentifier()%><%=provides.getIdentifier()%>Impl(this); return <%=provides.getIdentifier()%>_; } |