diff options
Diffstat (limited to 'TAO/tests/AMI_Timeouts/timeout_client.cpp')
-rw-r--r-- | TAO/tests/AMI_Timeouts/timeout_client.cpp | 65 |
1 files changed, 20 insertions, 45 deletions
diff --git a/TAO/tests/AMI_Timeouts/timeout_client.cpp b/TAO/tests/AMI_Timeouts/timeout_client.cpp index 96322b4cf1d..7e748014887 100644 --- a/TAO/tests/AMI_Timeouts/timeout_client.cpp +++ b/TAO/tests/AMI_Timeouts/timeout_client.cpp @@ -47,8 +47,7 @@ TimeoutClient::svc () { this->initialize (); - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { // Tests timeouts for synchronous @@ -64,22 +63,19 @@ TimeoutClient::svc () this->none_test (); // shut down remote ORB - timeoutObject_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + timeoutObject_->shutdown (); ACE_Time_Value tv (0, 20); // wait for the ORB to deliver the shutdonw ACE_OS::sleep (tv); // shut down local ORB - orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + orb_->shutdown (0); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:"); + ex._tao_print_exception ("Caught exception:"); return 1; } - ACE_ENDTRY; ACE_DEBUG ((LM_DEBUG, "TimeoutClient::svc: Done\n\n")); @@ -90,24 +86,19 @@ TimeoutClient::svc () int TimeoutClient::initialize () { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { CORBA::Object_var object = - orb_->resolve_initial_references ("ORBPolicyManager" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + orb_->resolve_initial_references ("ORBPolicyManager"); policy_manager_ = - CORBA::PolicyManager::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CORBA::PolicyManager::_narrow (object.in ()); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Caught exception:"); + ex._tao_print_exception ("Caught exception:"); return 1; } - ACE_ENDTRY; return 0; } @@ -134,8 +125,7 @@ TimeoutClient::send (CORBA::Boolean async, CORBA::PolicyList policy_list (1); - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY_EX (normal) + try { if (local_timeout != 0) { @@ -147,22 +137,16 @@ TimeoutClient::send (CORBA::Boolean async, policy_list.length (1); policy_list[0] = orb_->create_policy (Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE, - any_orb - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (normal); + any_orb); policy_manager_->set_policy_overrides (policy_list, - CORBA::SET_OVERRIDE - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (normal); + CORBA::SET_OVERRIDE); } else { policy_list.length (0); policy_manager_->set_policy_overrides (policy_list, - CORBA::SET_OVERRIDE - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (normal); + CORBA::SET_OVERRIDE); } @@ -172,18 +156,14 @@ TimeoutClient::send (CORBA::Boolean async, if (async) { timeoutObject_->sendc_sendTimeToWait (replyHandlerObject_.in (), - remote_sleep - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (normal); + remote_sleep); } else // synch { - timeoutObject_->sendTimeToWait (remote_sleep - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK_EX (normal); + timeoutObject_->sendTimeToWait (remote_sleep); } } - ACE_CATCH (CORBA::TIMEOUT, timeout) + catch (const CORBA::TIMEOUT& ) { local_reply_excep_counter_++; @@ -192,25 +172,20 @@ TimeoutClient::send (CORBA::Boolean async, " timeout ")); } - ACE_ENDTRY; - ACE_CHECK; // get rid of the policy, you created before. - ACE_TRY_EX (cleanup) + try { if (local_timeout != 0) { - policy_list[0]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK_EX (cleanup); + policy_list[0]->destroy (); } } - ACE_CATCHANY + catch (const CORBA::Exception&) { ACE_DEBUG ((LM_DEBUG, "Error: Unexpected exception\n\n")); } - ACE_ENDTRY; - ACE_CHECK; // wait for responses ACE_Time_Value tv (0, (local_timeout + remote_sleep)*2000 + 4000); |