diff options
Diffstat (limited to 'TAO/tests/RTCORBA/Linear_Priority/client.cpp')
-rw-r--r-- | TAO/tests/RTCORBA/Linear_Priority/client.cpp | 103 |
1 files changed, 33 insertions, 70 deletions
diff --git a/TAO/tests/RTCORBA/Linear_Priority/client.cpp b/TAO/tests/RTCORBA/Linear_Priority/client.cpp index 6588b34f7a4..3f5f1a6179c 100644 --- a/TAO/tests/RTCORBA/Linear_Priority/client.cpp +++ b/TAO/tests/RTCORBA/Linear_Priority/client.cpp @@ -78,7 +78,7 @@ public: int svc (void); - void validate_connection (ACE_ENV_SINGLE_ARG_DECL); + void validate_connection (void); private: test_var test_; @@ -98,7 +98,7 @@ Worker_Thread::Worker_Thread (ACE_Thread_Manager &thread_manager, } void -Worker_Thread::validate_connection (ACE_ENV_SINGLE_ARG_DECL) +Worker_Thread::validate_connection (void) { // Try to validate the connection several times, ignoring transient // exceptions. If the connection can still not be setup, return @@ -108,57 +108,47 @@ Worker_Thread::validate_connection (ACE_ENV_SINGLE_ARG_DECL) int current_attempt = 0; for (;;) { - ACE_TRY + try { ++current_attempt; - this->test_->_validate_connection (inconsistent_policies.out () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->test_->_validate_connection (inconsistent_policies.out ()); // If successful, we are done. return; } - ACE_CATCH (CORBA::TRANSIENT, exception) + catch (const CORBA::TRANSIENT& ) { // If we have reach our maximum number of tries, throw exception. if (current_attempt == max_attempts) - ACE_RE_THROW; + throw; // Otherwise, ignore... } - ACE_CATCHANY + catch (const CORBA::Exception&) { // Rethrow any other exceptions. - ACE_RE_THROW; + throw; } - ACE_ENDTRY; - ACE_CHECK; } } int Worker_Thread::svc (void) { - ACE_TRY_NEW_ENV + try { - this->current_->the_priority (this->priority_ - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->current_->the_priority (this->priority_); - this->validate_connection (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->validate_connection (); for (int i = 0; i < iterations; i++) { - this->test_->method (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->test_->method (); } } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Worker Thread exception:"); + ex._tao_print_exception ("Worker Thread exception:"); } - ACE_ENDTRY; return 0; } @@ -185,51 +175,33 @@ Task::Task (ACE_Thread_Manager &thread_manager, int Task::svc (void) { - ACE_TRY_NEW_ENV + try { CORBA::Object_var object = - this->orb_->resolve_initial_references ("RTORB" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_->resolve_initial_references ("RTORB"); RTCORBA::RTORB_var rt_orb = - RTCORBA::RTORB::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + RTCORBA::RTORB::_narrow (object.in ()); object = - this->orb_->resolve_initial_references ("RTCurrent" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_->resolve_initial_references ("RTCurrent"); RTCORBA::Current_var current = - RTCORBA::Current::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + RTCORBA::Current::_narrow (object.in ()); - current->the_priority (0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + current->the_priority (0); object = - this->orb_->resolve_initial_references ("ORBPolicyManager" - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_->resolve_initial_references ("ORBPolicyManager"); CORBA::PolicyManager_var policy_manager = - CORBA::PolicyManager::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CORBA::PolicyManager::_narrow (object.in ()); object = - this->orb_->string_to_object (ior - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_->string_to_object (ior); test_var test = - test::_narrow (object.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + test::_narrow (object.in ()); ULong_Array priorities; int result = @@ -248,16 +220,12 @@ Task::svc (void) bands_file, rt_orb.in (), policies, - debug - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + debug); if (result != 0) return result; policy_manager->set_policy_overrides (policies, - CORBA::SET_OVERRIDE - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CORBA::SET_OVERRIDE); u_long i = 0; @@ -305,16 +273,14 @@ Task::svc (void) if (shutdown_server) { - test->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + test->shutdown (); } } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception!"); + ex._tao_print_exception ("Unexpected exception!"); return -1; } - ACE_ENDTRY; return 0; } @@ -322,14 +288,12 @@ Task::svc (void) int main (int argc, char **argv) { - ACE_TRY_NEW_ENV + try { CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, - 0 - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + 0); int result = parse_args (argc, argv); @@ -378,12 +342,11 @@ main (int argc, char **argv) thread_manager.wait (); ACE_ASSERT (result != -1); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Unexpected exception!"); + ex._tao_print_exception ("Unexpected exception!"); return -1; } - ACE_ENDTRY; return 0; } |