diff options
author | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-25 18:04:11 +0000 |
---|---|---|
committer | elliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2007-01-25 18:04:11 +0000 |
commit | c979767a00db4ea1299af482033a68829cc16675 (patch) | |
tree | 3e959cad0a053f1adad663e7c02bc7a239f383d8 /TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp | |
parent | 0f3847bc7fd735ab88276fee59e2ebd6cb8d1f99 (diff) | |
download | ATCD-c979767a00db4ea1299af482033a68829cc16675.tar.gz |
ChangeLogTag: Thu Jan 25 17:39:59 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp | 93 |
1 files changed, 36 insertions, 57 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp index c5ac13bfa05..eb89e194d69 100644 --- a/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp +++ b/TAO/orbsvcs/orbsvcs/Naming/Naming_Server.cpp @@ -111,14 +111,12 @@ TAO_Naming_Server::init (CORBA::ORB_ptr orb, { if (resolve_for_existing_naming_service) { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { // Try to find an existing Naming Service. CORBA::Object_var naming_obj = orb->resolve_initial_references ("NameService", - timeout - ACE_ENV_ARG_PARAMETER); + timeout); if (!CORBA::is_nil (naming_obj.in ())) { @@ -130,21 +128,18 @@ TAO_Naming_Server::init (CORBA::ORB_ptr orb, "\nNameService found!\n")); this->naming_context_ = - CosNaming::NamingContext::_narrow (naming_obj.in () - ACE_ENV_ARG_PARAMETER); + CosNaming::NamingContext::_narrow (naming_obj.in ()); this->naming_service_ior_ = - orb->object_to_string (naming_obj.in () - ACE_ENV_ARG_PARAMETER); + orb->object_to_string (naming_obj.in ()); return 0; } } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Server::init"); + ex._tao_print_exception ("TAO_Naming_Server::init"); } - ACE_ENDTRY; } if (TAO_debug_level > 0) @@ -274,15 +269,14 @@ TAO_Naming_Server::init_with_orb (int argc, { int result; - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { // Duplicate the ORB this->orb_ = CORBA::ORB::_duplicate (orb); // Get the POA from the ORB. CORBA::Object_var poa_object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references ("RootPOA"); if (CORBA::is_nil (poa_object.in ())) { @@ -300,8 +294,7 @@ TAO_Naming_Server::init_with_orb (int argc, return result; // Get the POA object. - this->root_poa_ = PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); + this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ()); // Get the POA_Manager. PortableServer::POAManager_var poa_manager = @@ -326,26 +319,22 @@ TAO_Naming_Server::init_with_orb (int argc, // Id Assignment policy policies[0] = - this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID - ACE_ENV_ARG_PARAMETER); + this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID); // Lifespan policy policies[1] = - this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT - ACE_ENV_ARG_PARAMETER); + this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT); #if (TAO_HAS_MINIMUM_POA == 0) && !defined (CORBA_E_COMPACT) if (this->use_servant_activator_) { // Request Processing Policy policies[2] = - this->root_poa_->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER - ACE_ENV_ARG_PARAMETER); + this->root_poa_->create_request_processing_policy (PortableServer::USE_SERVANT_MANAGER); // Servant Retention Policy policies[3] = - this->root_poa_->create_servant_retention_policy (PortableServer::RETAIN - ACE_ENV_ARG_PARAMETER); + this->root_poa_->create_servant_retention_policy (PortableServer::RETAIN); } #endif /* TAO_HAS_MINIMUM_POA */ @@ -353,8 +342,7 @@ TAO_Naming_Server::init_with_orb (int argc, // the object key each time it invokes the server. this->ns_poa_ = this->root_poa_->create_POA ("NameService", poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); + policies); // Warning! If create_POA fails, then the policies won't be // destroyed and there will be hell to pay in memory leaks! @@ -381,12 +369,12 @@ TAO_Naming_Server::init_with_orb (int argc, if (result == -1) return result; } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Server::init_with_orb"); + ex._tao_print_exception ( + "TAO_Naming_Server::init_with_orb"); return -1; } - ACE_ENDTRY; if (this->ior_file_name_ != 0) { @@ -433,8 +421,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, int round_trip_timeout, int use_round_trip_timeout) { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { if (use_storable_context) { @@ -483,8 +470,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, 0, persFactory.get(), persistence_location, - use_redundancy_ - ACE_ENV_ARG_PARAMETER); + use_redundancy_); if (this->use_servant_activator_) persFactory.release(); @@ -521,8 +507,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, this->naming_context_ = TAO_Transient_Naming_Context::make_new_context (poa, TAO_ROOT_NAMING_CONTEXT, - context_size - ACE_ENV_ARG_PARAMETER); + context_size); } @@ -530,19 +515,17 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, // mechanism. Primarily useful for dynamically loaded Name // Services. orb->register_initial_reference ("NameService", - this->naming_context_.in () - ACE_ENV_ARG_PARAMETER); + this->naming_context_.in ()); // Set the ior of the root Naming Context. this->naming_service_ior_= - orb->object_to_string (this->naming_context_.in () - ACE_ENV_ARG_PARAMETER); + orb->object_to_string (this->naming_context_.in ()); CORBA::Object_var table_object = - orb->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references ("IORTable"); IORTable::Table_var adapter = - IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER); + IORTable::Table::_narrow (table_object.in ()); if (CORBA::is_nil (adapter.in ())) { ACE_ERROR ((LM_ERROR, "Nil IORTable\n")); @@ -550,9 +533,8 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, else { CORBA::String_var ior = - orb->object_to_string (this->naming_context_.in () - ACE_ENV_ARG_PARAMETER); - adapter->bind ("NameService", ior.in () ACE_ENV_ARG_PARAMETER); + orb->object_to_string (this->naming_context_.in ()); + adapter->bind ("NameService", ior.in ()); } #if defined (ACE_HAS_IP_MULTICAST) @@ -645,8 +627,7 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, // set a timeout on the orb // CORBA::Object_var orbPolicyManagerObj = - orb->resolve_initial_references ("ORBPolicyManager" - ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references ("ORBPolicyManager"); CORBA::PolicyManager_var orbPolicyManager = CORBA::PolicyManager::_narrow (orbPolicyManagerObj.in ()); @@ -659,12 +640,12 @@ TAO_Naming_Server::init_new_naming (CORBA::ORB_ptr orb, ACE_UNUSED_ARG (use_round_trip_timeout); #endif /* TAO_HAS_CORBA_MESSAGING */ } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_Naming_Server::init_new_naming"); + ex._tao_print_exception ( + "TAO_Naming_Server::init_new_naming"); return -1; } - ACE_ENDTRY; return 0; } @@ -674,31 +655,29 @@ TAO_Naming_Server::fini (void) { // Destroy the child POA ns_poa that is created when initializing // the Naming Service - ACE_TRY_NEW_ENV + try { - this->ns_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER); + this->ns_poa_->destroy (1, 1); CORBA::Object_var table_object = - this->orb_->resolve_initial_references ("IORTable" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("IORTable"); IORTable::Table_var adapter = - IORTable::Table::_narrow (table_object.in () ACE_ENV_ARG_PARAMETER); + IORTable::Table::_narrow (table_object.in ()); if (CORBA::is_nil (adapter.in ())) { ACE_ERROR ((LM_ERROR, "Nil IORTable\n")); } else { - adapter->unbind ("NameService" ACE_ENV_ARG_PARAMETER); + adapter->unbind ("NameService"); } } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { // Ignore } - ACE_ENDTRY; if (this->ior_multicast_ != 0) |