#include#include CORBA::Object_var obj = ...; // get the CORBA object PortableServer::ObjectId_var oid = PortableServer::string_to_ObjectId("my_object_id"); POA_ptr poa = ...; // get the POA poa->activate_object_with_id(oid.in(), obj.in()); // activate the object with the given ID
#includeIn this example, we first initialize the ORB (Object Request Broker) and get a CORBA object. We then create an object ID and get a POA using the resolve_initial_references() method. We activate the object with the given ID and activate the POA manager to start processing client requests. Package library: omniORB4#include CORBA::ORB_var orb = CORBA::ORB_init(argc, argv); CORBA::Object_var obj = ...; // get the CORBA object PortableServer::ObjectId_var oid = PortableServer::string_to_ObjectId("my_object_id"); PortableServer::POA_var poa = PortableServer::POA::_narrow(orb->resolve_initial_references("RootPOA")); PortableServer::POAManager_var poa_mgr = poa->the_POAManager(); poa->activate_object_with_id(oid.in(), obj.in()); poa_mgr->activate(); // activate the POA manager to start processing client requests