[openrtm-commit:03125] r794 - in trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java: manager template/java template/java/test

openrtm @ openrtm.org openrtm @ openrtm.org
2018年 1月 23日 (火) 22:47:36 JST


Author: ga
Date: 2018-01-23 22:47:36 +0900 (Tue, 23 Jan 2018)
New Revision: 794

Added:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_Comp.java.vsl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_RTC.java.vsl
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_RTC_Impl.java.vsl
Modified:
   trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager/JavaGenerateManager.java
Log:
Added function to output test RTC. #4433

Modified: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager/JavaGenerateManager.java
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager/JavaGenerateManager.java	2018-01-23 13:47:23 UTC (rev 793)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/manager/JavaGenerateManager.java	2018-01-23 13:47:36 UTC (rev 794)
@@ -152,7 +152,23 @@
 				result.add(gr);
 			}
 		}
+		/////
+		gr = generateTestCompSource(contextMap);
+		result.add(gr);
+		gr = generateTestRTCSource(contextMap);
+		result.add(gr);
+		gr = generateTestRTCImplSource(contextMap);
+		result.add(gr);
+		for (IdlFileParam idl : rtcParam.getConsumerIdlPathes()) {
+			contextMap.put("idlFileParam", idl);
+			for (ServiceClassParam svc : idl.getTestServiceClassParams()) {
+				contextMap.put("serviceClassParam", svc);
+				gr = generateTestSVCSource(contextMap);
+				result.add(gr);
+			}
+		}
 
+
 		return result;
 	}
 
@@ -237,7 +253,46 @@
 		String infile = "java/build.xml.vsl";
 		return generate(infile, outfile, contextMap);
 	}
+	
+	//////////
+	public GeneratedResult generateTestCompSource(Map<String, Object> contextMap) {
+		RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+		String outfile = "test/src/" + rtcParam.getName() + "TestComp.java";
+		String infile = "java/test/Java_Test_Comp.java.vsl";
+		GeneratedResult result = generate(infile, outfile, contextMap);
+		result.setNotBom(true);
+		return result;
+	}
 
+	public GeneratedResult generateTestRTCSource(Map<String, Object> contextMap) {
+		RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+		String outfile = "test/src/" + rtcParam.getName() + "Test.java";
+		String infile = "java/test/Java_Test_RTC.java.vsl";
+		GeneratedResult result = generate(infile, outfile, contextMap);
+		result.setNotBom(true);
+		return result;
+	}
+	
+	public GeneratedResult generateTestRTCImplSource(Map<String, Object> contextMap) {
+		RtcParam rtcParam = (RtcParam) contextMap.get("rtcParam");
+		String outfile = "test/src/" + rtcParam.getName() + "TestImpl.java";
+		String infile = "java/test/Java_Test_RTC_Impl.java.vsl";
+		GeneratedResult result = generate(infile, outfile, contextMap);
+		result.setNotBom(true);
+		return result;
+	}
+	
+	public GeneratedResult generateTestSVCSource(Map<String, Object> contextMap) {
+		ServiceClassParam svc = (ServiceClassParam) contextMap
+				.get("serviceClassParam");
+		String outfile = "test/src/" + TemplateHelper.getBasename(svc.getName())
+				+ TemplateHelper.getServiceImplSuffix() + ".java";
+		String infile = "java/Java_SVC.java.vsl";
+		GeneratedResult result = generate(infile, outfile, contextMap);
+		result.setNotBom(true);
+		return result;
+	}
+	
 	public GeneratedResult generate(String infile, String outfile,
 			Map<String, Object> contextMap) {
 		try {

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_Comp.java.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_Comp.java.vsl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_Comp.java.vsl	2018-01-23 13:47:36 UTC (rev 794)
@@ -0,0 +1,110 @@
+// -*- Java -*-
+/*!
+ * @file ${rtcParam.name}TestComp.java
+ * @brief Standalone component
+#set( $Date$ = "dummy" )
+ * @date \$Date$
+#if( ${rtcParam.docCreator.length()} > 0 )
+ *
+ * @author ${tmpltHelper.convertAuthorDoc(${rtcParam.docCreator})}
+#end
+#if( ${rtcParam.docLicense.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docLicense})}
+#end
+ *
+#set( $Id$ = "dummy" )
+ * \$Id$
+ */
+
+import jp.go.aist.rtm.RTC.Manager;
+import jp.go.aist.rtm.RTC.ModuleInitProc;
+import jp.go.aist.rtm.RTC.RTObject_impl;
+import jp.go.aist.rtm.RTC.util.Properties;
+
+/*!
+ * @class ${rtcParam.name}TestComp
+ * @brief Standalone component Class
+ *
+ */
+public class ${rtcParam.name}TestComp implements ModuleInitProc {
+
+    public void myModuleInit(Manager mgr) {
+      Properties prop = new Properties(${rtcParam.name}Test.component_conf);
+      mgr.registerFactory(prop, new ${rtcParam.name}Test(), new ${rtcParam.name}Test());
+
+      // Create a component
+      RTObject_impl comp = mgr.createComponent("${rtcParam.name}Test");
+      if( comp==null ) {
+    	  System.err.println("Component create failed.");
+    	  System.exit(0);
+      }
+      
+      // Example
+      // The following procedure is examples how handle RT-Components.
+      // These should not be in this function.
+
+//      // Get the component's object reference
+//      Manager manager = Manager.instance();
+//      RTObject rtobj = null;
+//      try {
+//          rtobj = RTObjectHelper.narrow(manager.getPOA().servant_to_reference(comp));
+//      } catch (ServantNotActive e) {
+//          e.printStackTrace();
+//      } catch (WrongPolicy e) {
+//          e.printStackTrace();
+//      }
+//
+//      // Get the port list of the component
+//      PortListHolder portlist = new PortListHolder();
+//      portlist.value = rtobj.get_ports();
+//
+//      // getting port profiles
+//      System.out.println( "Number of Ports: " );
+//      System.out.println( portlist.value.length );
+//      for( int intIdx=0;intIdx<portlist.value.length;++intIdx ) {
+//          Port port = portlist.value[intIdx];
+//          System.out.println( "Port" + intIdx + " (name): ");
+//          System.out.println( port.get_port_profile().name );
+//        
+//          PortInterfaceProfileListHolder iflist = new PortInterfaceProfileListHolder();
+//          iflist.value = port.get_port_profile().interfaces;
+//          System.out.println( "---interfaces---" );
+//          for( int intIdx2=0;intIdx2<iflist.value.length;++intIdx2 ) {
+//              System.out.println( "I/F name: " );
+//              System.out.println( iflist.value[intIdx2].instance_name  );
+//              System.out.println( "I/F type: " );
+//              System.out.println( iflist.value[intIdx2].type_name );
+//              if( iflist.value[intIdx2].polarity==PortInterfacePolarity.PROVIDED ) {
+//                  System.out.println( "Polarity: PROVIDED" );
+//              } else {
+//                  System.out.println( "Polarity: REQUIRED" );
+//              }
+//          }
+//          System.out.println( "---properties---" );
+//          NVUtil.dump( new NVListHolder(port.get_port_profile().properties) );
+//          System.out.println( "----------------" );
+//      }
+    }
+
+    public static void main(String[] args) {
+        // Initialize manager
+        final Manager manager = Manager.init(args);
+
+        // Set module initialization proceduer
+        // This procedure will be invoked in activateManager() function.
+        ${rtcParam.name}TestComp init = new ${rtcParam.name}TestComp();
+        manager.setModuleInitProc(init);
+
+        // Activate manager and register to naming service
+        manager.activateManager();
+
+        // run the manager in blocking mode
+        // runManager(false) is the default.
+        manager.runManager();
+
+        // If you want to run the manager in non-blocking mode, do like this
+        // manager.runManager(true);
+    }
+
+}

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_RTC.java.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_RTC.java.vsl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_RTC.java.vsl	2018-01-23 13:47:36 UTC (rev 794)
@@ -0,0 +1,93 @@
+// -*- Java -*-
+/*!
+ * @file ${rtcParam.name}Test.java
+#set( $Date$ = "dummy" )
+ * @date \$Date$
+#if( ${rtcParam.docCreator.length()} > 0 )
+ *
+ * @author ${tmpltHelper.convertAuthorDoc(${rtcParam.docCreator})}
+#end
+#if( ${rtcParam.docLicense.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docLicense})}
+#end
+ *
+#set( $Id$ = "dummy" )
+ * \$Id$
+ */
+
+import jp.go.aist.rtm.RTC.Manager;
+import jp.go.aist.rtm.RTC.RTObject_impl;
+import jp.go.aist.rtm.RTC.RtcDeleteFunc;
+import jp.go.aist.rtm.RTC.RtcNewFunc;
+import jp.go.aist.rtm.RTC.RegisterModuleFunc;
+import jp.go.aist.rtm.RTC.util.Properties;
+
+/*!
+ * @class ${rtcParam.name}Test
+ * @brief ${rtcParam.description}
+ */
+public class ${rtcParam.name}Test implements RtcNewFunc, RtcDeleteFunc, RegisterModuleFunc {
+
+//  Module specification
+//  <rtc-template block="module_spec">
+    public static String component_conf[] = {
+    	    "implementation_id", "${rtcParam.name}Test",
+    	    "type_name",         "${rtcParam.name}Test",
+    	    "description",       "${rtcParam.description}",
+    	    "version",           "${rtcParam.version}",
+    	    "vendor",            "${rtcParam.vender}",
+    	    "category",          "${rtcParam.category}",
+    	    "activity_type",     "${rtcParam.componentType}",
+    	    "max_instance",      "${rtcParam.maxInstance}",
+    	    "language",          "Java",
+    	    "lang_type",         "compile",
+#if( ${rtcParam.configParams.size()} > 0 )
+            // Configuration variables
+#foreach($configParam in ${rtcParam.configParams})  
+            "conf.default.${configParam.name}", "${configParam.defaultVal}",
+#end
+
+            // Widget
+#foreach($configParam in ${rtcParam.configParams})
+#if( ${configParam.widget.length()} > 0 )
+            "conf.__widget__.${configParam.name}", "${configParam.widget}#if( ${configParam.step.length()} > 0 ).${configParam.step}#end",
+#end
+#end
+            // Constraints
+#foreach($configParam in ${rtcParam.configParams})
+#if( ${configParam.constraint.length()} > 0 )
+            "conf.__constraints__.${configParam.name}", "${configParam.constraint}",
+#end
+#end
+
+#foreach($configParam in ${rtcParam.configParams})
+            "conf.__type__.${configParam.name}", "${configParam.type}",
+#end
+
+#end
+#if( ${rtcParam.configParameterParams.size()} > 0 )
+            // System Configuration
+#foreach($parameterParam in ${rtcParam.configParameterParams})  
+#if( ${parameterParam.isNonPeriodic()} )
+            "${parameterParam.configName}", "${parameterParam.defaultVal}",
+#end
+#end
+#end
+    	    ""
+            };
+//  </rtc-template>
+
+    public RTObject_impl createRtc(Manager mgr) {
+        return new ${rtcParam.name}TestImpl(mgr);
+    }
+
+    public void deleteRtc(RTObject_impl rtcBase) {
+        rtcBase = null;
+    }
+    public void registerModule() {
+        Properties prop = new Properties(component_conf);
+        final Manager manager = Manager.instance();
+        manager.registerFactory(prop, new ${rtcParam.name}Test(), new ${rtcParam.name}Test());
+    }
+}

Added: trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_RTC_Impl.java.vsl
===================================================================
--- trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_RTC_Impl.java.vsl	                        (rev 0)
+++ trunk/rtmtools/jp.go.aist.rtm.rtcbuilder.java/src/jp/go/aist/rtm/rtcbuilder/java/template/java/test/Java_Test_RTC_Impl.java.vsl	2018-01-23 13:47:36 UTC (rev 794)
@@ -0,0 +1,689 @@
+// -*- Java -*-
+/*!
+ * @file  ${rtcParam.name}TestImpl.java
+ * @brief ${rtcParam.description}
+#set( $Date$ = "dummy" )
+ * @date  \$Date$
+#if( ${rtcParam.docCreator.length()} > 0 )
+ *
+ * @author ${tmpltHelper.convertAuthorDoc(${rtcParam.docCreator})}
+#end
+#if( ${rtcParam.docLicense.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docLicense})}
+#end
+ *
+#set( $Id$ = "dummy" )
+ * \$Id$
+ */
+
+#if( ${rtcParam.inports.size()} > 0 || ${rtcParam.outports.size()} > 0 )
+import java.lang.reflect.Array;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+#end
+
+#foreach($type in ${javaConv.getPortTypes(${rtcParam})})  
+${javaConv.getDataportPackageName(${type})}
+#end
+import jp.go.aist.rtm.RTC.DataFlowComponentBase;
+import jp.go.aist.rtm.RTC.Manager;
+#if( ${rtcParam.outports.size()} > 0 )
+import jp.go.aist.rtm.RTC.port.InPort;
+#end
+#if( ${rtcParam.inports.size()} > 0 )
+import jp.go.aist.rtm.RTC.port.OutPort;
+#end
+#if( ${rtcParam.inports.size()} > 0 || ${rtcParam.outports.size()} > 0 )
+import jp.go.aist.rtm.RTC.util.DataRef;
+#end
+#if( ${rtcParam.originalConsumerIdls.size()} > 0 )
+import jp.go.aist.rtm.RTC.port.CorbaConsumer;
+#end
+#if( ${rtcParam.originalProviderIdls.size()} > 0 || ${rtcParam.originalConsumerIdls.size()} > 0 )
+import jp.go.aist.rtm.RTC.port.CorbaPort;
+#end
+#if( ${rtcParam.originalProviderIdls.size()} > 0 )
+import org.omg.PortableServer.POAPackage.ObjectNotActive;
+import org.omg.PortableServer.POAPackage.ServantAlreadyActive;
+import org.omg.PortableServer.POAPackage.WrongPolicy;
+#end
+#if( ${rtcParam.configParams.size()} > 0 )
+#foreach($type in ${javaConv.getParamTypes(${rtcParam})})  
+import jp.go.aist.rtm.RTC.util.${type};
+#end
+#end
+#if( ${javaConv.useReturnCode(${rtcParam})} )
+import RTC.ReturnCode_t;
+#end
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+#if(${tmpltHelper.isModule(${serviceInterface.interfaceType})})import ${tmpltHelper.convFormat(${serviceInterface.interfaceType})};
+#end#end#end#end#end#end
+
+/*!
+ * @class ${rtcParam.name}TestImpl
+ * @brief ${rtcParam.description}
+#if( ${rtcParam.docDescription.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docDescription})}
+#end
+#if( ${rtcParam.docInOut.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docInOut})}
+#end
+#if( ${rtcParam.docAlgorithm.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docAlgorithm})}
+#end
+#if( ${rtcParam.docReference.length()} > 0 )
+ *
+ * ${tmpltHelper.convertDoc(${rtcParam.docReference})}
+#end
+ *
+ */
+public class ${rtcParam.name}TestImpl extends DataFlowComponentBase {
+
+  /*!
+   * @brief constructor
+   * @param manager Maneger Object
+   */
+	public ${rtcParam.name}TestImpl(Manager manager) {  
+        super(manager);
+        // <rtc-template block="initializer">
+#foreach($port in ${rtcParam.outports})  
+        m_${port.tmplVarName}_val = new ${javaConv.getDataTypeName(${port.type})}();
+        initializeParam(m_${port.tmplVarName}_val);
+        m_${port.tmplVarName} = new DataRef<${javaConv.getDataTypeName(${port.type})}>(m_${port.tmplVarName}_val);
+        m_${port.name}In = new InPort<${javaConv.getDataTypeName(${port.type})}>("${port.name}", m_${port.tmplVarName});
+#end
+#foreach($port in ${rtcParam.inports})  
+        m_${port.tmplVarName}_val = new ${javaConv.getDataTypeName(${port.type})}();
+        m_${port.tmplVarName} = new DataRef<${javaConv.getDataTypeName(${port.type})}>(m_${port.tmplVarName}_val);
+        m_${port.name}Out = new OutPort<${javaConv.getDataTypeName(${port.type})}>("${port.name}", m_${port.tmplVarName});
+#end
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+        m_${servicePort.name}Port = new CorbaPort("${servicePort.name}");
+#end#end#end
+        // </rtc-template>
+
+    }
+
+    /*#if(${rtcParam.configParams.size()}==0)*#else!#end
+
+#if(${rtcParam.getDocActionOverView(0).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(0)})}
+#end
+     *
+     * The initialize action (on CREATED->ALIVE transition)
+     * formaer rtc_init_entry() 
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(0).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(0)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(0).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(0)})}
+#end
+     * 
+     */
+#if( ${rtcParam.configParams.size()}>0 || ${rtcParam.inports.size()}>0 || ${rtcParam.outports.size()}>0 || ${rtcParam.servicePorts.size()}>0 || !${rtcParam.IsNotImplemented(0)} )
+    @Override
+    protected ReturnCode_t onInitialize() {
+        // Registration: InPort/OutPort/Service
+        // <rtc-template block="registration">
+#if( ${rtcParam.outports.size()} > 0 )
+        // Set InPort buffers
+#foreach($port in ${rtcParam.outports})  
+        addInPort("${port.name}", m_${port.name}In);
+#end
+#end
+#if( ${rtcParam.inports.size()} > 0 )
+        
+        // Set OutPort buffer
+#foreach($port in ${rtcParam.inports})  
+        addOutPort("${port.name}", m_${port.name}Out);
+#end
+#end
+#if( ${rtcParam.providerIdlPathes.size()} > 0 )
+        
+        // Set service provider to Ports
+#if(${rtcParam.servicePorts.size()}>0)
+        try {
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==1)
+        	m_${servicePort.name}Port.registerProvider("${serviceInterface.name}", "${tmpltHelper.convFormat(${serviceInterface.interfaceType})}", m_${serviceInterface.tmplVarName});
+#end#end#end#end#end
+        } catch (ServantAlreadyActive e) {
+            e.printStackTrace();
+        } catch (WrongPolicy e) {
+            e.printStackTrace();
+        } catch (ObjectNotActive e) {
+            e.printStackTrace();
+        }
+#end
+#if(${rtcParam.servicePorts.size()}>0)
+        
+        // Set service consumers to Ports
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+        m_${servicePort.name}Port.registerConsumer("${serviceInterface.name}", "${tmpltHelper.convFormat(${serviceInterface.interfaceType})}", m_${serviceInterface.tmplVarName}Base);
+#end#end#end#end#end
+#if(${rtcParam.servicePorts.size()}>0)
+        
+        // Set CORBA Service Ports
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+        addPort(m_${servicePort.name}Port);
+#end#end#end
+        // </rtc-template>
+#foreach($configParam in ${rtcParam.configParams})  
+        bindParameter("${configParam.name}", m_${configParam.tmplVarName}, "${configParam.defaultVal}");
+#end
+#if(${tmpltHelper.checkDetailContent(0,${rtcParam})})${rtcParam.getDetailContent(0)}
+#end
+        return super.onInitialize();
+    }
+#else
+//    @Override
+//    protected ReturnCode_t onInitialize() {
+        // Registration: InPort/OutPort/Service
+        // <rtc-template block="registration">
+        // </rtc-template>
+//        return super.onInitialize();
+//    }
+#end
+
+    /***
+#if(${rtcParam.getDocActionOverView(1).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(1)})}
+#end
+     *
+     * The finalize action (on ALIVE->END transition)
+     * formaer rtc_exiting_entry()
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(1).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(1)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(1).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(1)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(1)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(1)})//#end    protected ReturnCode_t onFinalize() {
+#if(${tmpltHelper.checkDetailContent(1,${rtcParam})})${rtcParam.getDetailContent(1)}
+#end
+#if(${rtcParam.IsNotImplemented(1)})//#end        return super.onFinalize();
+#if(${rtcParam.IsNotImplemented(1)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(2).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(2)})}
+#end
+     *
+     * The startup action when ExecutionContext startup
+     * former rtc_starting_entry()
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(2).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(2)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(2).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(2)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(2)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(2)})//#end    protected ReturnCode_t onStartup(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(2,${rtcParam})})${rtcParam.getDetailContent(2)}
+#end
+#if(${rtcParam.IsNotImplemented(2)})//#end        return super.onStartup(ec_id);
+#if(${rtcParam.IsNotImplemented(2)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(3).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(3)})}
+#end
+     *
+     * The shutdown action when ExecutionContext stop
+     * former rtc_stopping_entry()
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(3).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(3)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(3).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(3)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(3)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(3)})//#end    protected ReturnCode_t onShutdown(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(3,${rtcParam})})${rtcParam.getDetailContent(3)}
+#end
+#if(${rtcParam.IsNotImplemented(3)})//#end        return super.onShutdown(ec_id);
+#if(${rtcParam.IsNotImplemented(3)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(4).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(4)})}
+#end
+     *
+     * The activated action (Active state entry action)
+     * former rtc_active_entry()
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(4).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(4)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(4).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(4)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(4)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(4)})//#end    protected ReturnCode_t onActivated(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(4,${rtcParam})})${rtcParam.getDetailContent(4)}
+#end
+#if(${rtcParam.IsNotImplemented(4)})//#end        return super.onActivated(ec_id);
+#if(${rtcParam.IsNotImplemented(4)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(5).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(5)})}
+#end
+     *
+     * The deactivated action (Active state exit action)
+     * former rtc_active_exit()
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(5).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(5)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(5).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(5)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(5)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(5)})//#end    protected ReturnCode_t onDeactivated(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(5,${rtcParam})})${rtcParam.getDetailContent(5)}
+#end
+#if(${rtcParam.IsNotImplemented(5)})//#end        return super.onDeactivated(ec_id);
+#if(${rtcParam.IsNotImplemented(5)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(9).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(9)})}
+#end
+     *
+     * The execution action that is invoked periodically
+     * former rtc_active_do()
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(9).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(9)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(9).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(9)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(9)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(9)})//#end    protected ReturnCode_t onExecute(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(9,${rtcParam})})${rtcParam.getDetailContent(9)}
+#end
+#if(${rtcParam.IsNotImplemented(9)})//#end        return super.onExecute(ec_id);
+#if(${rtcParam.IsNotImplemented(9)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(6).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(6)})}
+#end
+     *
+     * The aborting action when main logic error occurred.
+     * former rtc_aborting_entry()
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(6).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(6)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(6).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(6)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(6)})//#end  @Override
+#if(${rtcParam.IsNotImplemented(6)})//#end  public ReturnCode_t onAborting(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(6,${rtcParam})})${rtcParam.getDetailContent(6)}
+#end
+#if(${rtcParam.IsNotImplemented(6)})//#end      return super.onAborting(ec_id);
+#if(${rtcParam.IsNotImplemented(6)})//#end  }
+
+    /***
+#if(${rtcParam.getDocActionOverView(7).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(7)})}
+#end
+     *
+     * The error action in ERROR state
+     * former rtc_error_do()
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(7).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(7)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(7).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(7)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(7)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(7)})//#end    public ReturnCode_t onError(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(7,${rtcParam})})${rtcParam.getDetailContent(7)}
+#end
+#if(${rtcParam.IsNotImplemented(7)})//#end        return super.onError(ec_id);
+#if(${rtcParam.IsNotImplemented(7)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(8).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(8)})}
+#end
+     *
+     * The reset action that is invoked resetting
+     * This is same but different the former rtc_init_entry()
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(8).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(8)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(8).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(8)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(8)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(8)})//#end    protected ReturnCode_t onReset(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(8,${rtcParam})})${rtcParam.getDetailContent(8)}
+#end
+#if(${rtcParam.IsNotImplemented(8)})//#end        return super.onReset(ec_id);
+#if(${rtcParam.IsNotImplemented(8)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(10).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(10)})}
+#end
+     *
+     * The state update action that is invoked after onExecute() action
+     * no corresponding operation exists in OpenRTm-aist-0.2.0
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(10).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(10)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(10).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(10)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(10)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(10)})//#end    protected ReturnCode_t onStateUpdate(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(10,${rtcParam})})${rtcParam.getDetailContent(10)}
+#end
+#if(${rtcParam.IsNotImplemented(10)})//#end        return super.onStateUpdate(ec_id);
+#if(${rtcParam.IsNotImplemented(10)})//#end    }
+
+    /***
+#if(${rtcParam.getDocActionOverView(11).length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${rtcParam.getDocActionOverView(11)})}
+#end
+     *
+     * The action that is invoked when execution context's rate is changed
+     * no corresponding operation exists in OpenRTm-aist-0.2.0
+     *
+     * @param ec_id target ExecutionContext Id
+     *
+     * @return RTC::ReturnCode_t
+     * 
+#if(${rtcParam.getDocActionPreCondition(11).length()}>0)     * @pre ${tmpltHelperJava.convertPreDocJava(${rtcParam.getDocActionPreCondition(11)})}
+#end
+#if(${rtcParam.getDocActionPostCondition(11).length()}>0)     * @post ${tmpltHelperJava.convertPostDocJava(${rtcParam.getDocActionPostCondition(11)})}
+#end
+     * 
+     */
+#if(${rtcParam.IsNotImplemented(11)})//#end    @Override
+#if(${rtcParam.IsNotImplemented(11)})//#end    protected ReturnCode_t onRateChanged(int ec_id) {
+#if(${tmpltHelper.checkDetailContent(11,${rtcParam})})${rtcParam.getDetailContent(11)}
+#end
+#if(${rtcParam.IsNotImplemented(11)})//#end        return super.onRateChanged(ec_id);
+#if(${rtcParam.IsNotImplemented(11)})//#end    }
+//
+#if( ${rtcParam.configParams.size()} > 0 )
+	// Configuration variable declaration
+	// <rtc-template block="config_declare">
+#foreach($configParam in ${rtcParam.configParams})  
+    /*!
+     * ${tmpltHelperJava.convertDescDocJava(${configParam.docDescription})}
+     * - Name: ${configParam.docDataName} ${configParam.tmplVarName}
+     * - DefaultValue: ${configParam.defaultVal}
+#if(${configParam.docUnit.length()}>0)     * - Unit: ${tmpltHelperJava.convertUnitDocJava(${configParam.docUnit})}
+#end
+#if(${configParam.docRange.length()}>0)     * - Range: ${tmpltHelperJava.convertRangeDocJava(${configParam.docRange})}
+#end
+#if(${configParam.docConstraint.length()}>0)     * - Constraint: ${tmpltHelperJava.convertConstraintDocJava(${configParam.docConstraint})}
+#end
+     */
+    protected ${javaConv.convJava2ParamHolder(${configParam.type},true)} m_${configParam.tmplVarName} = new ${javaConv.convJava2ParamHolder(${configParam.type},true)}();
+#end
+	// </rtc-template>
+
+#end
+    // DataInPort declaration
+    // <rtc-template block="inport_declare">
+#foreach($port in ${rtcParam.outports})  
+    protected ${javaConv.getDataTypeName(${port.type})} m_${port.tmplVarName}_val;
+    protected DataRef<${javaConv.getDataTypeName(${port.type})}> m_${port.tmplVarName};
+    /*!
+#if(${port.docDescription.length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${port.docDescription})}
+#end
+#if(${port.docType.length()}>0)     * - Type: ${tmpltHelperJava.convertTypeDocJava(${port.docType})}
+#end
+#if(${port.docNum.length()}>0)     * - Number: ${tmpltHelperJava.convertNumberDocJava(${port.docNum})}
+#end
+#if(${port.docSemantics.length()}>0)     * - Semantics: ${tmpltHelperJava.convertSemanticsDocJava(${port.docSemantics})}
+#end
+#if(${port.docUnit.length()}>0)     * - Unit: ${tmpltHelperJava.convertTypeDocJava(${port.docUnit})}
+#end
+#if(${port.docOccurrence.length()}>0)     * - Frequency: ${tmpltHelperJava.convertFrequencyDocJava(${port.docOccurrence})}
+#end
+#if(${port.docOperation.length()}>0)     * - Operation Cycle: ${tmpltHelperJava.convertCycleDocJava(${port.docOperation})}
+#end
+     */
+    protected InPort<${javaConv.getDataTypeName(${port.type})}> m_${port.name}In;
+
+#end
+    
+    // </rtc-template>
+
+    // DataOutPort declaration
+    // <rtc-template block="outport_declare">
+#foreach($port in ${rtcParam.inports})  
+    protected ${javaConv.getDataTypeName(${port.type})} m_${port.tmplVarName}_val;
+    protected DataRef<${javaConv.getDataTypeName(${port.type})}> m_${port.tmplVarName};
+    /*!
+#if(${port.docDescription.length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${port.docDescription})}
+#end
+#if(${port.docType.length()}>0)     * - Type: ${tmpltHelperJava.convertTypeDocJava(${port.docType})}
+#end
+#if(${port.docNum.length()}>0)     * - Number: ${tmpltHelperJava.convertNumberDocJava(${port.docNum})}
+#end
+#if(${port.docSemantics.length()}>0)     * - Semantics: ${tmpltHelperJava.convertSemanticsDocJava(${port.docSemantics})}
+#end
+#if(${port.docUnit.length()}>0)     * - Unit: ${tmpltHelperJava.convertTypeDocJava(${port.docUnit})}
+#end
+#if(${port.docOccurrence.length()}>0)     * - Frequency: ${tmpltHelperJava.convertFrequencyDocJava(${port.docOccurrence})}
+#end
+#if(${port.docOperation.length()}>0)     * - Operation Cycle: ${tmpltHelperJava.convertCycleDocJava(${port.docOperation})}
+#end
+     */
+    protected OutPort<${javaConv.getDataTypeName(${port.type})}> m_${port.name}Out;
+
+#end
+    
+    // </rtc-template>
+
+    // CORBA Port declaration
+    // <rtc-template block="corbaport_declare">
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+    /*!
+#if(${servicePort.docDescription.length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${servicePort.docDescription})}
+#end
+#if(${servicePort.docIfDescription.length()}>0)     * Interface: ${tmpltHelperJava.convertInterfaceDocJava(${servicePort.docIfDescription})}
+#end
+     */
+    protected CorbaPort m_${servicePort.name}Port;
+#end#end#end
+    
+    // </rtc-template>
+
+    // Service declaration
+    // <rtc-template block="service_declare">
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==1)
+    /*!
+#if(${serviceInterface.docDescription.length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${serviceInterface.docDescription})}
+#end
+#if(${serviceInterface.docArgument.length()}>0)     * - Argument:      ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docArgument})}
+#end
+#if(${serviceInterface.docReturn.length()}>0)     * - Return Value:  ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docReturn})}
+#end
+#if(${serviceInterface.docException.length()}>0)     * - Exception:     ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docException})}
+#end
+#if(${serviceInterface.docPreCondition.length()}>0)     * - PreCondition:  ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docPreCondition})}
+#end
+#if(${serviceInterface.docPostCondition.length()}>0)     * - PostCondition: ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docPostCondition})}
+#end
+     */
+    protected ${serviceInterface.interfaceRawType}${tmpltHelper.serviceImplSuffix} m_${serviceInterface.tmplVarName} = new ${serviceInterface.interfaceRawType}${tmpltHelper.serviceImplSuffix}();
+#end#end#end#end#end
+    
+    // </rtc-template>
+
+    // Consumer declaration
+    // <rtc-template block="consumer_declare">
+#if(${rtcParam.servicePorts.size()}>0)
+#foreach($servicePort in ${rtcParam.servicePorts})
+#if(${servicePort.servicePortInterfaces.size()}>0)
+#foreach($serviceInterface in ${servicePort.servicePortInterfaces})
+#if(${serviceInterface.index}==0)
+    protected CorbaConsumer<${serviceInterface.interfaceRawType}> m_${serviceInterface.tmplVarName}Base = new CorbaConsumer<${serviceInterface.interfaceRawType}>(${serviceInterface.interfaceRawType}.class);
+    /*!
+#if(${serviceInterface.docDescription.length()}>0)     * ${tmpltHelperJava.convertDescDocJava(${serviceInterface.docDescription})}
+#end
+#if(${serviceInterface.docArgument.length()}>0)     * - Argument:      ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docArgument})}
+#end
+#if(${serviceInterface.docReturn.length()}>0)     * - Return Value:  ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docReturn})}
+#end
+#if(${serviceInterface.docException.length()}>0)     * - Exception:     ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docException})}
+#end
+#if(${serviceInterface.docPreCondition.length()}>0)     * - PreCondition:  ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docPreCondition})}
+#end
+#if(${serviceInterface.docPostCondition.length()}>0)     * - PostCondition: ${tmpltHelperJava.convertInterfaceDetailDocJava(${serviceInterface.docPostCondition})}
+#end
+     */
+    protected ${serviceInterface.interfaceRawType} m_${serviceInterface.tmplVarName};
+#end#end#end#end#end
+    
+    // </rtc-template>
+
+#foreach($privateAttribute in ${rtcParam.privateAttributes})
+  ${privateAttribute}
+#end
+#foreach($privateOperation in ${rtcParam.privateOperations})
+  ${privateOperation}
+#end
+#foreach($protectedAttribute in ${rtcParam.protectedAttributes})
+  ${protectedAttribute}
+#end
+#foreach($protectedOperation in ${rtcParam.protectedOperations})
+  ${protectedOperation}
+#end
+#foreach($publicAttribute in ${rtcParam.publicAttributes})
+  ${publicAttribute}
+#end
+#foreach($publicOperation in ${rtcParam.publicOperations})
+  ${publicOperation}
+#end
+#if(${tmpltHelper.checkContents(${rtcParam.publicOpeSource})})${rtcParam.publicOpeSource}
+#end
+#if(${tmpltHelper.checkContents(${rtcParam.protectedOpeSource})})${rtcParam.protectedOpeSource}
+#end
+#if(${tmpltHelper.checkContents(${rtcParam.privateOpeSource})})${rtcParam.privateOpeSource}
+#end
+
+#if( ${rtcParam.inports.size()} > 0 || ${rtcParam.outports.size()} > 0 )
+	private void initializeParam(Object target) {
+		Class<?> targetClass = target.getClass();
+		ClassLoader loader = target.getClass().getClassLoader();
+		//
+		Field[] fields = targetClass.getFields();
+		for(Field field : fields) {
+			if(field.getType().isPrimitive()) continue;
+			
+			try {
+				if(field.getType().isArray()) {
+					Object arrayValue = null;
+					Class<?> clazz = null;
+					if(field.getType().getComponentType().isPrimitive()) {
+						clazz = field.getType().getComponentType();
+					} else {
+							clazz = loader.loadClass(field.getType().getComponentType().getName());
+					}
+					arrayValue = Array.newInstance(clazz, 0);
+					field.set(target, arrayValue);
+					
+				} else {
+					Constructor<?>[] constList = field.getType().getConstructors();
+					if(constList.length==0) {
+						Method[] methodList = field.getType().getMethods();
+						for(Method method : methodList) {
+							if(method.getName().equals("from_int")==false) continue;
+							Object objFld = method.invoke(target, new Object[]{ new Integer(0) });
+							field.set(target, objFld);
+							break;
+						}
+						
+					} else {
+			            Class<?> classFld = Class.forName(field.getType().getName(), true, loader);
+						Object objFld = classFld.newInstance();
+						initializeParam(objFld);
+						field.set(target, objFld);
+					}
+				}
+			} catch (ClassNotFoundException e) {
+				e.printStackTrace();
+			} catch (InstantiationException e) {
+				e.printStackTrace();
+			} catch (IllegalAccessException e) {
+				e.printStackTrace();
+			} catch (IllegalArgumentException e) {
+				e.printStackTrace();
+			} catch (InvocationTargetException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+#end
+}



More information about the openrtm-commit mailing list