#!/usr/bin/env python import sys import os from omniORB import CORBA, PortableServer import CosNaming, HuhuItf, HuhuItf__POA class Blubb_i (HuhuItf__POA.Blubb): def get_something (self, request): pkg_no = 10 cdeps = [] while pkg_no > 0: cdep = HuhuItf.Dependency ("hallo du", str (pkg_no)) cdeps.append (cdep) pkg_no = pkg_no - 1 return cdeps orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) poa = orb.resolve_initial_references("RootPOA") blubb_i = Blubb_i() blubb_o = blubb_i._this() print orb.object_to_string(blubb_o) obj = orb.resolve_initial_references("NameService") root_context = obj._narrow(CosNaming.NamingContext) if root_context is None: print "Failed to narrow the root naming context" sys.exit(1) name = [CosNaming.NameComponent("huhu", "project")] try: huhu_context = root_context.bind_new_context(name) print "dbsfed:project bound to naming service" except CosNaming.NamingContext.AlreadyBound, ex: print "dbsfed:project already bount to naming service" obj = root_context.resolve(name) huhu_context = obj._narrow(CosNaming.NamingContext) if huhu_context is None: print "dbsfed:project exists but is not a naming context" sys.exit(1) name = [CosNaming.NameComponent("blubb", "object")] try: huhu_context.bind(name, blubb_o) print "new aptd:apt object bound" except CosNaming.NamingContext.AlreadyBound: huhu_context.rebind(name, blubb_o) print "aptd:apt binding already existed, rebound" poaManager = poa._get_the_POAManager() poaManager.activate() orb.run()