1 6 7 package SOFA.Connector.EEG.EEM.Elements; 8 9 import SOFA.Connector.EEG.CodeWriter.JWriterDirectorException; 10 import SOFA.Connector.EEG.EEM.Actions.JIfaceCN; 11 import SOFA.Connector.EEG.EEM.Actions.JImplWriterDirectorBase; 12 import SOFA.SOFAnode.Made.TIR.OperationDef; 13 14 19 public class LocalStubGen extends JImplWriterDirectorBase { 20 21 22 public LocalStubGen(String provIfaceCDL, SOFA.Connector.Property[] params) { 23 super(provIfaceCDL,params); 24 } 25 26 public String [] getImplements() { 27 return new String [] {"SOFA.Connector.EEG.Types.Stub"}; 28 } 29 30 public String getClassBody() { 31 String reqIfaceMapped=SOFA.Connector.Property.findFirst(params,"reqIfaceMapped"); 32 return managerTieImpl() + "\n" + 33 "\tprotected "+reqIfaceMapped+" target;\n"+ 34 "\tpublic void link(SOFA.Connector.TaggedProfile target) {\n"+ 39 "\t\t\tthis.target=("+reqIfaceMapped+")((SOFA.Connector.ECG.Profiles.LocalProfile)target).link;\n"+ 41 "\t}\n\n"+ 49 "\tpublic String[] getSupportedProfiles() {\n"+ 50 "\t\treturn new String[] {\"LOCAL\"};\n"+ 51 "\t}\n\n"+ 52 "\tpublic org.objectweb.fractal.api.Type getFcItfType() { return null; }\n"+ 53 "\tpublic boolean isFcInternalItf() {return false; }\n"+ 54 "\tpublic String getFcItfName() { return this.target.getFcItfName(); }\n"+ 55 "\tpublic org.objectweb.fractal.api.Component getFcItfOwner() { return this.target.getFcItfOwner(); }\n\n"; 56 } 57 58 public String getMethodDef(OperationDef mt) throws JWriterDirectorException { 59 return JIfaceCN.getMethodDef(mt); 60 } 61 62 public String getMethodBody(OperationDef method) throws JWriterDirectorException { 63 return 64 "\t\t"+declareRet(method,"ret")+"\n"+ 66 "\t\t"+assignRet(method,"ret")+targetCall(method,JIfaceCN.targetCallParams(method))+";\n"+ 67 "\t\t"+returnRet(method,"ret")+"\n"; 68 } 72 73 74 203 } 204 | Popular Tags |