KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * ConsoleLoggerGen.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.JImplWriterDirectorBase;
12 import SOFA.SOFAnode.Made.TIR.OperationDef;
13
14 /**
15  *
16  * @author ghort
17  * @version
18  */

19 public class ConsoleLoggerGen extends JImplWriterDirectorBase {
20
21     /** Creates new ConsoleLoggerGen */
22     public ConsoleLoggerGen(String JavaDoc provIfaceCDL, SOFA.Connector.Property[] params) {
23         super(provIfaceCDL,params);
24     }
25
26     public String JavaDoc[] getImplements() {
27         return new String JavaDoc[] {"SOFA.Connector.EEG.Types.Interceptor"};
28     }
29     
30     public String JavaDoc getMethodDef(OperationDef mt) throws JWriterDirectorException {
31         return JIfaceCN.getMethodDef(mt);
32     }
33     
34     public String JavaDoc getMethodBody(OperationDef method) throws JWriterDirectorException {
35         try {
36             return
37                 "\t\tSystem.out.println(\"calling method '"+method.get_identification().absolute_name().name()+"'\");\n"+
38                 "\t\t"+declareRet(method,"ret")+"\n"+
39                 "\t\t"+assignRet(method,"ret")+targetCall(method,JIfaceCN.targetCallParams(method))+";\n"+
40                 "\t\t"+returnRet(method,"ret");
41         } catch (java.rmi.RemoteException JavaDoc e) {
42             throw new JWriterDirectorException("Cannot access TIR.",e);
43         }
44     }
45 }
46
Popular Tags