#!/usr/bin/env python import sys from omniORB import CORBA, PortableServer # Import the stubs and skeletons for the Example module import Example, Example__POA # Define an implementation of the Echo interface class Echo_i (Example__POA.Echo): def __init__(self,poa): self.poa=poa def echoString(self, mesg): print "echoString() called with message:", mesg return mesg def _default_POA(self): return self.poa # Initialise the ORB orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID) # Find the root POA poa = orb.resolve_initial_references("omniINSPOA") # Create an instance of Echo_i ei = Echo_i(poa) # Create an object reference and activate the object poa.activate_object_with_id('Echo',ei) eo = ei._this() # Print out the IOR print orb.object_to_string(eo) # Activate the POA poaManager = poa._get_the_POAManager() poaManager.activate() # Everything is running now, but if this thread drops out of the end # of the file, the process will exit. orb.run() just blocks until the # ORB is shut down orb.run()