KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > SOFA > Connector > EEG > EEM > Elements > SRoleImplGen


1 /*
2  * SRoleImplGen.java
3  *
4  * Created on 13. duben 2002, 21:08
5  */

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 /**
16  *
17  * @author ghort
18  * @version
19  */

20 public class SRoleImplGen extends JImplWriterDirectorBase {
21
22     /** Creates new SRoleImplGen */
23     public SRoleImplGen(String JavaDoc provIfaceCDL, SOFA.Connector.Property[] params) {
24         super(provIfaceCDL,params);
25     }
26
27     public String JavaDoc[] getImplements() {
28         return new String JavaDoc[] {"SOFA.Connector.EEG.Types.SRole"};
29     }
30
31     public String JavaDoc getExtends() {
32         return "SOFA.Connector.EEG.ElementRoleBase";
33     }
34
35     public String JavaDoc 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 JavaDoc getMethodDef(OperationDef mt) throws JWriterDirectorException {
45         return JIfaceCN.getMethodDef(mt);
46     }
47     
48     public String JavaDoc 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