Hello <br><br>I am trying to implement a custom servant manager in Python as follows:<br><br>>8>8>8>8>8>8>8>8>8>8<br>FORTUNE_PATH="/usr/bin/fortune"<br><br>class CookieServer_i (Fortune__POA.CookieServer):
<br> def get_cookie(self):<br> pipe = os.popen(FORTUNE_PATH)<br> cookie = pipe.read()<br> if pipe.close():<br> cookie = "Oh dear, could'nt get a fortune\n"<br> return cookie
<br><br><br>class ResynServantManager(PortableServer__POA.ServantLocator):<br><br> cookieServer = CookieServer_i()<br><br> def preinvoke(self, oid, poa, operation, cookie):<br> print "preinvoke : "<br>
return cookieServer<br><br> def postinvoke(self, oid, adapter, operation, the_cookie, the_servant):<br> print "postinvoke :"<br><br>orb = CORBA.ORB_init(sys.argv)<br>poa = orb.resolve_initial_references
("RootPOA")<br><br>poaManager = poa._get_the_POAManager()<br><br>## NOTE: Deleted Naming Service Registration Code for brevity<br><br># Setup RESYN POA<br>policies =[ poa.create_servant_retention_policy(PortableServer.NON_RETAIN
),<br> poa.create_request_processing_policy(PortableServer.USE_SERVANT_MANAGER),<br> poa.create_id_assignment_policy(PortableServer.USER_ID),<br> poa.create_implicit_activation_policy(PortableServer.NO_IMPLICIT_ACTIVATION
),<br> poa.create_thread_policy(PortableServer.ORB_CTRL_MODEL)]<br><br><br>resyn_servman = ResynServantManager()<br>resyn_poa = poa.create_POA("RESYN", poaManager, policies)<br><br>resyn_poa.set_servant_manager(resyn_servman._this())
<br><br>#Activate the POA<br>poaManager.activate()<br><br>#Block until ORB is shutdown<br>orb.run()<br><br>>8>8>8>8>8>8>8>8>8>8<br><br>My problem is that the code never progresses past <br><br>
> resyn_poa.set_servant_manager()<br><br>i.e. it blocks at "set_servant_manager()" never activating the POA, and therefore my requests don't get served.<br><br>If I call "poaManager.activate()" before the "set_servant_manager()" then things seem to work OK, except that ResynServantManager() is not used to "locate" my CookieServer objects.
<br><br>I would like to know if anyone can help explain to me why my "RESYN" POA and ResynServantManager() is never used for locating my CookieServer objects. What am I missing/doing wrong.<br><br>Regards and thanks
<br>Stephan<br>