From: Robert L. <rle...@us...> - 2007-02-16 12:30:27
|
Update of /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/jet In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv1558/src/ccmtools/generator/java/templates/jet Modified Files: ComponentDefAssemblyClass.jet Added Files: OperationDefAssemblyImplementation.jet ProvidesDefGetMethodAssemplyImplementation.jet ProvidesDefAssemblyClass.jet Log Message: Java assemblies Index: ComponentDefAssemblyClass.jet =================================================================== RCS file: /cvsroot/ccmtools/ccmtools/src/ccmtools/generator/java/templates/jet/ComponentDefAssemblyClass.jet,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ComponentDefAssemblyClass.jet 15 Feb 2007 16:46:42 -0000 1.2 --- ComponentDefAssemblyClass.jet 16 Feb 2007 12:30:13 -0000 1.3 *************** *** 134,138 **** ProvidesDef provides = (ProvidesDef)i.next(); %> ! <%=provides.generateGetMethodImplementation()%> <% } --- 134,138 ---- ProvidesDef provides = (ProvidesDef)i.next(); %> ! <%=provides.generateGetMethodAssemblyImplementation(component.getInnerFacet(provides))%> <% } *************** *** 150,154 **** throws CCMException { ! // OPTIONAL: IMPLEMENT ME HERE ! } --- 150,184 ---- throws CCMException { ! try { ! <% ! for(Iterator i=component.getAssemblyAttributeInitialisation(); i.hasNext();) ! { ! %> ! <%=i.next().toString()%> ! <% ! } ! %> ! ! <% ! for(Iterator i=component.getAssemblyAttributeSetup(); i.hasNext();) ! { ! %> ! <%=i.next().toString()%> ! <% ! } ! %> ! ! // finish configuration ! <% ! for (String key : component.getAssemblyLocalComponents().keySet()) ! { ! %> ! <%=key%>_.configuration_complete(); ! <% ! } ! %> ! } catch(Exception e) { ! throw new CCMException(e.getMessage(), CCMExceptionReason.CREATE_ERROR); ! } } --- NEW FILE: OperationDefAssemblyImplementation.jet --- <%@ jet package="ccmtools.generator.java.templates" class="OperationDefAssemblyImplementationTemplate" imports="ccmtools.generator.java.metamodel.* " %> <% OperationDef op = (OperationDef) argument; %> public <%=op.generateReturnType()%> <%=op.getIdentifier()%>(<%=op.generateParameterDeclarationList()%>) <%=op.generateThrowsStatementLocal()%> { <%=op.generateAssemblyReturnStatement()%> } --- NEW FILE: ProvidesDefGetMethodAssemplyImplementation.jet --- <%@ jet package="ccmtools.generator.java.templates" class="ProvidesDefGetMethodAssemblyImplementationTemplate" imports="ccmtools.generator.java.metamodel.* " %> <% ProvidesDef provides = (ProvidesDef) argument; %> public <%=provides.getInterface().generateAbsoluteJavaCcmName()%> get_<%=provides.getIdentifier()%>() { return new <%=provides.generateJavaNamespace()%>.<%=provides.getComponent().getIdentifier()%><%=provides.getIdentifier()%>Impl(this, <%=provides.getAssemblyFacet()%>); } --- NEW FILE: ProvidesDefAssemblyClass.jet --- <%@ jet package="ccmtools.generator.java.templates" class="ProvidesDefAssemblyClassTemplate" imports="java.util.Iterator ccmtools.generator.java.metamodel.* " %> <% ProvidesDef provides = (ProvidesDef) argument; InterfaceDef iface = provides.getInterface(); %> /** * This file was automatically generated by <%=iface.generateCcmtoolsVersion()%> * <http://ccmtools.sourceforge.net> * * <%=iface.generateCcmIdentifier()%>Impl facet implementation. * */ package <%=provides.generateJavaNamespace()%>; <%=provides.generateJavaImportStatements(provides.generateJavaNamespace())%> /** * This class implements a component facet's methods. * */ public class <%=provides.getComponent().getIdentifier()%><%=provides.getIdentifier()%>Impl implements <%=iface.generateCcmIdentifier()%> { /** Reference to the facet's component implementation */ private <%=provides.getComponent().getIdentifier()%>Impl component; /** the facet of the inner component we delegate to */ private <%=iface.generateAbsoluteJavaName()%> target; public <%=provides.getComponent().getIdentifier()%><%=provides.getIdentifier()%>Impl( <%=provides.getComponent().getIdentifier()%>Impl component, <%=iface.generateAbsoluteJavaName()%> target) { this.component = component; this.target = target; } <% for(Iterator i=iface.getBaseInterfaces().iterator(); i.hasNext();) { InterfaceDef baseIface = (InterfaceDef)i.next(); for(Iterator j=baseIface.getAttributes().iterator(); j.hasNext(); ) { AttributeDef attr = (AttributeDef)j.next(); %> // TODO: assembly implementation <%=attr.generateApplicationDeclaration()%> <% } } %> <% for(Iterator i=iface.getAttributes().iterator(); i.hasNext();) { AttributeDef attr = (AttributeDef)i.next(); %> // TODO: assembly implementation <%=attr.generateApplicationDeclaration()%> <% } %> /** Business logic implementations */ <% for(Iterator i=iface.getBaseInterfaces().iterator(); i.hasNext();) { InterfaceDef baseIface = (InterfaceDef)i.next(); for(Iterator j=baseIface.getAttributes().iterator(); j.hasNext(); ) { AttributeDef attr = (AttributeDef)j.next(); %> // TODO: assembly implementation <%=attr.generateApplicationImplementation()%> <% } } %> <% for(Iterator i=iface.getAttributes().iterator(); i.hasNext();) { AttributeDef attr = (AttributeDef)i.next(); %> // TODO: assembly implementation <%=attr.generateApplicationImplementation()%> <% } %> <% for(Iterator i=iface.getBaseInterfaces().iterator(); i.hasNext();) { InterfaceDef baseIface = (InterfaceDef)i.next(); for(Iterator j=baseIface.getOperations().iterator(); j.hasNext(); ) { OperationDef op = (OperationDef)j.next(); %> <%=op.generateAssemblyImplementation()%> <% } } %> <% for(Iterator i=iface.getOperations().iterator(); i.hasNext();) { OperationDef op = (OperationDef)i.next(); %> <%=op.generateAssemblyImplementation()%> <% } %> } |