diff options
Diffstat (limited to 'TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp')
-rw-r--r-- | TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp b/TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp index f281e089dbf..48f994f415c 100644 --- a/TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp +++ b/TAO/orbsvcs/examples/CosEC/Factory/FactoryClient.cpp @@ -59,6 +59,9 @@ protected: const char* factory_name_; // The name of the factory registered with the naming service. + PortableServer::POA_var root_poa_; + // Reference to the root poa. + CORBA::ORB_var orb_; // The ORB that we use. @@ -74,6 +77,7 @@ protected: FactoryClient::FactoryClient (void) :factory_name_ ("CosEC_Factory"), + root_poa_ (PortableServer::POA::_nil ()), use_naming_service (0) { // No-Op. @@ -94,6 +98,29 @@ FactoryClient::init_ORB (int argc, "", ACE_TRY_ENV); ACE_CHECK; + + CORBA::Object_var poa_object = + this->orb_->resolve_initial_references("RootPOA", + ACE_TRY_ENV); + ACE_CHECK; + + if (CORBA::is_nil (poa_object.in ())) + { + ACE_ERROR ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n")); + return; + } + this->root_poa_ = + PortableServer::POA::_narrow (poa_object.in (), + ACE_TRY_ENV); + ACE_CHECK; + + PortableServer::POAManager_var poa_manager = + root_poa_->the_POAManager (ACE_TRY_ENV); + ACE_CHECK; + + poa_manager->activate (ACE_TRY_ENV); + ACE_CHECK; } void |