CORBA.ORB Object
object_to_string(reference)
Arguments:
reference: (CORBA reference) CORBA Object reference to stringify.
Description:
Convert a CORBA Object reference to a stringified reference. The Object reference can be gotten from CORBA.ORB.string_to_object(), or PortableServer.POA.servant_to_reference()
Example:
import sys, CORBA, Bank__POA
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
poa = orb.resolve_initial_references("RootPOA")
class Account(Bank__POA.Account):
pass
servant = Account()
servant._this()
reference = poa.servant_to_reference(servant)
print orb.object_to_string(reference)
string_to_object(ior)
Arguments:
ior: (string) Stringified IOR
Description:
Convert the given stringified IOR into a CORBA object reference. If the object's type is known prior to invoking this function (in other words, the module to which this interface belongs was imported), the returned object will be automatically narrowed to that type. If it is not known, a generic CORBA.Object will be returned.
Example:
import sys, CORBA, Bank
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
ior = open("bank_object.ior").readline()
object = orb.string_to_object(ior)
print object
run()
Description:
Enter ORBit's main event loop that waits for incoming requests from clients.
Example:
import sys, CORBA
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
# This by itself doesn't do anything except block;
# we haven't activated any servants yet
orb.run()
shutdown(wait_for_completion)
Arguments:
wait_for_completion: (CORBA.boolean) True (CORBA.TRUE or 1) if the function should block until the ORB has completed all processing. False (CORBA.False or 0) if the function should return immediately, in which case shutdown may not be completed.
Description:
Cause ORBit's main event loop to terminate, returning control to the python space that called CORBA.ORB.run().
Example:
import sys, CORBA, Foo__POA
orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
poa = orb.resolve_initial_references("RootPOA")
class Bar(Foo__POA.Bar):
# Assume the interface for Bar defines void die();
def die(self):
orb.shutdown()
servant = Account()._this()
orb.run()
|