diff options
Diffstat (limited to 'TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp | 82 |
1 files changed, 28 insertions, 54 deletions
diff --git a/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp b/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp index f3278167081..89a8efd1587 100644 --- a/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/nestea_server_i.cpp @@ -86,18 +86,17 @@ static void printEnvVars() { } int -Nestea_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) +Nestea_Server_i::init (int argc, char** argv) { printEnvVars(); // Since the Implementation Repository keys off of the POA name, we need // to use the SERVER_NAME as the POA's name. const char *poa_name = SERVER_NAME; - ACE_TRY + try { // Initialize the ORB - this->orb_ = CORBA::ORB_init (argc, argv, 0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_ = CORBA::ORB_init (argc, argv, 0); // Save pointers to the command line arguments this->argc_ = argc; @@ -111,16 +110,12 @@ Nestea_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) // Get the POA from the ORB. CORBA::Object_var obj = - this->orb_->resolve_initial_references ("RootPOA" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_->resolve_initial_references ("RootPOA"); ACE_ASSERT(! CORBA::is_nil (obj.in ())); - this->root_poa_ = PortableServer::POA::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->root_poa_ = PortableServer::POA::_narrow (obj.in ()); - this->poa_manager_ = this->root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->poa_manager_ = this->root_poa_->the_POAManager (); // We now need to create a POA with the persistent and user_id policies, // since they are need for use with the Implementation Repository. @@ -129,28 +124,21 @@ Nestea_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) policies.length (2); policies[0] = - this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK + this->root_poa_->create_id_assignment_policy (PortableServer::USER_ID); policies[1] = - this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->root_poa_->create_lifespan_policy (PortableServer::PERSISTENT); this->nestea_poa_ = this->root_poa_->create_POA (poa_name, this->poa_manager_.in (), - policies - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + policies); // Creation of the new POA is over, so destroy the Policy_ptr's. for (CORBA::ULong i = 0; i < policies.length (); ++i) { CORBA::Policy_ptr policy = policies[i]; - policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + policy->destroy (); } ACE_NEW_RETURN (this->server_impl_, @@ -161,38 +149,28 @@ Nestea_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) PortableServer::string_to_ObjectId ("server"); this->nestea_poa_->activate_object_with_id (server_id.in (), - this->server_impl_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->server_impl_); - obj = this->nestea_poa_->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + obj = this->nestea_poa_->id_to_reference (server_id.in ()); CORBA::String_var ior = - this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_->object_to_string (obj.in ()); if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "The IOR is: <%s>\n", ior.in ())); TAO_Root_POA* tmp_poa = dynamic_cast<TAO_Root_POA*>(nestea_poa_.in()); - obj = tmp_poa->id_to_reference_i (server_id.in (), false ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + obj = tmp_poa->id_to_reference_i (server_id.in (), false); CORBA::String_var rawior = - this->orb_->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_->object_to_string (obj.in ()); - obj = this->orb_->resolve_initial_references ("IORTable" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + obj = this->orb_->resolve_initial_references ("IORTable"); IORTable::Table_var adapter = - IORTable::Table::_narrow (obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + IORTable::Table::_narrow (obj.in ()); ACE_ASSERT(! CORBA::is_nil (adapter.in ())); - adapter->bind (poa_name, rawior.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + adapter->bind (poa_name, rawior.in()); - this->poa_manager_->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->poa_manager_->activate (); if (this->ior_output_file_) { @@ -200,40 +178,36 @@ Nestea_Server_i::init (int argc, char** argv ACE_ENV_ARG_DECL) ACE_OS::fclose (this->ior_output_file_); } } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Nestea_i::init"); - ACE_RE_THROW; + ex._tao_print_exception ("Nestea_i::init"); + throw; } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); return 0; } int -Nestea_Server_i::run (ACE_ENV_SINGLE_ARG_DECL) +Nestea_Server_i::run (void) { int status = 0; - ACE_TRY + try { ACE_Time_Value tv(SELF_DESTRUCT_SECS); - this->orb_->run (tv ACE_ENV_ARG_PARAMETER); + this->orb_->run (tv); this->root_poa_->destroy(1, 1); this->orb_->destroy(); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { status = -1; - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Nestea_i::run"); - ACE_RE_THROW; + ex._tao_print_exception ("Nestea_i::run"); + throw; } - ACE_ENDTRY; - ACE_CHECK_RETURN (-1); return status; } |