7 from omniORB
import CORBA
13 print "usage: ConnectorComp [options]" 14 print " python MyServiceProvider.py " 15 print " python MyServiceConsumer.py " 16 print " python Connector.py " 22 orb = CORBA.ORB_init(sys.argv)
31 consumer.setObject(naming.resolve(
"MyServiceConsumer0.rtc"))
34 consobj = consumer.getObject()._narrow(RTC.RTObject)
35 pcons = consobj.get_ports()
36 pcons[0].disconnect_all()
40 provider.setObject(naming.resolve(
"MyServiceProvider0.rtc"))
43 provobj = provider.getObject()._narrow(RTC.RTObject)
44 prov = provobj.get_ports()
45 prov[0].disconnect_all()
49 conprof = RTC.ConnectorProfile(
"connector0",
"", [pcons[0],prov[0]], [])
51 ret = pcons[0].connect(conprof)
54 eclistin = consobj.get_owned_contexts()
55 eclistin[0].activate_component(consobj)
58 eclistout = provobj.get_owned_contexts()
59 eclistout[0].activate_component(provobj)
63 if __name__ ==
"__main__":
CORBA Naming Service helper class.