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 ConsoleLoggerGen extends JImplWriterDirectorBase { 20 21 22 public ConsoleLoggerGen(String provIfaceCDL, SOFA.Connector.Property[] params) { 23 super(provIfaceCDL,params); 24 } 25 26 public String [] getImplements() { 27 return new String [] {"SOFA.Connector.EEG.Types.Interceptor"}; 28 } 29 30 public String getMethodDef(OperationDef mt) throws JWriterDirectorException { 31 return JIfaceCN.getMethodDef(mt); 32 } 33 34 public String 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 e) { 42 throw new JWriterDirectorException("Cannot access TIR.",e); 43 } 44 } 45 } 46 | Popular Tags |