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.JIfaceNormal; 12 import SOFA.Connector.EEG.EEM.Actions.JImplWriterDirectorBase; 13 import SOFA.SOFAnode.Made.TIR.OperationDef; 14 15 20 public class SRoleImplGen extends JImplWriterDirectorBase { 21 22 23 public SRoleImplGen(String provIfaceCDL, SOFA.Connector.Property[] params) { 24 super(provIfaceCDL,params); 25 } 26 27 public String [] getImplements() { 28 return new String [] {"SOFA.Connector.EEG.Types.SRole"}; 29 } 30 31 public String getExtends() { 32 return "SOFA.Connector.EEG.ElementRoleBase"; 33 } 34 35 public String getClassBody() { 36 return linkImpl()+"\n"+ 37 "\tpublic static final String _CDLID = \""+provIfaceCDL+"\";\n\n"+ 38 "\tpublic org.objectweb.fractal.api.Type getFcItfType() {return new SOFA.Util.FcTypeImpl(); }\n\n"+ 39 "\tpublic boolean isFcInternalItf() { return false; }\n\n"+ 40 "\tpublic String getFcItfName() { return getConnectorName(); }\n\n"+ 41 "\tpublic org.objectweb.fractal.api.Component getFcItfOwner() { return (org.objectweb.fractal.api.Component) this.getComponentManager(); }\n\n"; 42 } 43 44 public String getMethodDef(OperationDef mt) throws JWriterDirectorException { 45 return JIfaceCN.getMethodDef(mt); 46 } 47 48 public String getMethodBody(OperationDef method) throws JWriterDirectorException { 49 return 50 "\t\t"+declareRet(method,"ret")+"\n"+ 51 "\t\tSOFA.Component.ThreadIDRegistry thrReg=manager.getThrIDRegistry();\n"+ 52 "\t\tthrReg.threadInCall(thr_id);\n"+ 53 "\n"+ 54 "\t\t"+assignRet(method,"ret")+targetCall(method,JIfaceNormal.targetCallParams(method))+";\n"+ 55 "\n"+ 56 "\t\tthrReg.threadOutReturn(thr_id);\n"+ 57 "\t\t"+returnRet(method,"ret"); 58 } 59 60 } 61 | Popular Tags |