SdoServiceConsumerComp.java
1 |
package RTMExamples.SimpleSdoService; |
---|---|
2 |
|
3 |
import jp.go.aist.rtm.RTC.Manager; |
4 |
import jp.go.aist.rtm.RTC.ModuleInitProc; |
5 |
import jp.go.aist.rtm.RTC.RTObject_impl; |
6 |
import jp.go.aist.rtm.RTC.util.NVUtil; |
7 |
import jp.go.aist.rtm.RTC.util.Properties; |
8 |
import RTC.ComponentProfile; |
9 |
import RTC.PortService; |
10 |
import RTC.PortInterfacePolarity; |
11 |
import RTC.PortInterfaceProfileListHolder; |
12 |
import RTC.PortServiceListHolder; |
13 |
import _SDOPackage.NVListHolder; |
14 |
|
15 |
public class SdoServiceConsumerComp implements ModuleInitProc { |
16 |
|
17 |
public void myModuleInit(Manager mgr) { |
18 |
Properties prop = new Properties(SdoServiceConsumer.component_conf); |
19 |
mgr.registerFactory(prop, |
20 |
new SdoServiceConsumer(),
|
21 |
new SdoServiceConsumer());
|
22 |
|
23 |
// Create a component
|
24 |
System.out.println("Creating a component: \"SdoServiceConsumer\"...."); |
25 |
RTObject_impl comp = mgr.createComponent("SdoServiceConsumer");
|
26 |
System.out.println("succeed."); |
27 |
|
28 |
} |
29 |
|
30 |
public static void main(String[] args) { |
31 |
// Initialize manager
|
32 |
final Manager manager = Manager.init(args);
|
33 |
|
34 |
// Set module initialization proceduer
|
35 |
// This procedure will be invoked in activateManager() function.
|
36 |
SdoServiceConsumerComp init = new SdoServiceConsumerComp();
|
37 |
manager.setModuleInitProc(init); |
38 |
|
39 |
// Activate manager and register to naming service
|
40 |
manager.activateManager(); |
41 |
|
42 |
// run the manager in blocking mode
|
43 |
// runManager(false) is the default.
|
44 |
manager.runManager(); |
45 |
|
46 |
// If you want to run the manager in non-blocking mode, do like this
|
47 |
// manager->runManager(true);
|
48 |
} |
49 |
|
50 |
} |