diff options
Diffstat (limited to 'TAO/tao/Synch_Invocation.cpp')
-rw-r--r-- | TAO/tao/Synch_Invocation.cpp | 168 |
1 files changed, 47 insertions, 121 deletions
diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index abe453e0d0c..89ef71d6365 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -51,7 +51,7 @@ namespace TAO Invocation_Status Synch_Twoway_Invocation::remote_twoway (ACE_Time_Value *max_wait_time - ACE_ENV_ARG_DECL) + ) ACE_THROW_SPEC ((CORBA::Exception)) { ACE_Countdown_Time countdown (max_wait_time); @@ -60,16 +60,14 @@ namespace TAO this->details_.reply_service_info ()); TAO_Target_Specification tspec; - this->init_target_spec (tspec ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + this->init_target_spec (tspec); Invocation_Status s = TAO_INVOKE_FAILURE; #if TAO_HAS_INTERCEPTORS == 1 // Start the interception point here.. s = - this->send_request_interception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + this->send_request_interception (); if (s != TAO_INVOKE_SUCCESS) return s; @@ -78,7 +76,7 @@ namespace TAO // We have started the interception flow. We need to call the // ending interception flow if things go wrong. The purpose of the // try block is to do just this. - ACE_TRY + try { TAO_OutputCDR &cdr = this->resolver_.transport ()->out_stream (); @@ -89,12 +87,10 @@ namespace TAO this->write_header (tspec, cdr - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); this->marshal_data (cdr - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); // Register a reply dispatcher for this invocation. Use the // preallocated reply dispatcher. @@ -121,8 +117,7 @@ namespace TAO s = this->send_message (cdr, TAO_Transport::TAO_TWOWAY_REQUEST, max_wait_time - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); #if TAO_HAS_INTERCEPTORS == 1 // @@NOTE: Too much code repetition. @@ -132,8 +127,7 @@ namespace TAO if (s == TAO_INVOKE_RESTART) { const Invocation_Status tmp = - this->receive_other_interception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->receive_other_interception (); if (tmp != TAO_INVOKE_SUCCESS) s = tmp; @@ -172,15 +166,13 @@ namespace TAO this->wait_for_reply (max_wait_time, rd, dispatch_guard - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); #if TAO_HAS_INTERCEPTORS == 1 if (s == TAO_INVOKE_RESTART) { Invocation_Status const tmp = - this->receive_other_interception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->receive_other_interception (); // Push the latest values for the return.. if (tmp != TAO_INVOKE_SUCCESS) @@ -196,8 +188,7 @@ namespace TAO // in the interface. The call violated the contract s = this->check_reply_status (rd - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); // For some strategies one may want to release the transport // back to cache after receiving the reply. @@ -209,14 +200,12 @@ namespace TAO if (s == TAO_INVOKE_RESTART) { tmp = - this->receive_other_interception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->receive_other_interception (); } else if (s == TAO_INVOKE_SUCCESS) { tmp = - this->receive_reply_interception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->receive_reply_interception (); } if (tmp != TAO_INVOKE_SUCCESS) s = tmp; @@ -225,13 +214,12 @@ namespace TAO if (s != TAO_INVOKE_SUCCESS) return s; } - ACE_CATCHANY + catch ( ::CORBA::Exception& ex) { #if TAO_HAS_INTERCEPTORS == 1 PortableInterceptor::ReplyStatus const status = - this->handle_any_exception (&ACE_ANY_EXCEPTION - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->handle_any_exception (&ex + ); if (status == PortableInterceptor::LOCATION_FORWARD || status == PortableInterceptor::TRANSPORT_RETRY) @@ -239,28 +227,8 @@ namespace TAO else if (status == PortableInterceptor::SYSTEM_EXCEPTION || status == PortableInterceptor::USER_EXCEPTION) #endif /*TAO_HAS_INTERCEPTORS*/ - ACE_RE_THROW; + throw; } -# if defined (ACE_HAS_EXCEPTIONS) \ - && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS) - ACE_CATCHALL - { -#if TAO_HAS_INTERCEPTORS == 1 - PortableInterceptor::ReplyStatus const st = - this->handle_all_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (st == PortableInterceptor::LOCATION_FORWARD || - st == PortableInterceptor::TRANSPORT_RETRY) - s = TAO_INVOKE_RESTART; - else -#endif /*TAO_HAS_INTERCEPTORS == 1*/ - ACE_RE_THROW; - } -# endif /* ACE_HAS_EXCEPTIONS && - ACE_HAS_BROKEN_UNEXPECTED_EXCEPTION*/ - ACE_ENDTRY; - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); return s; } @@ -269,7 +237,7 @@ namespace TAO Synch_Twoway_Invocation::wait_for_reply (ACE_Time_Value *max_wait_time, TAO_Synch_Reply_Dispatcher &rd, TAO_Bind_Dispatcher_Guard &bd - ACE_ENV_ARG_DECL) + ) ACE_THROW_SPEC ((CORBA::SystemException)) { /* @@ -342,22 +310,20 @@ namespace TAO (void) bd.unbind_dispatcher (); this->resolver_.transport ()->close_connection (); - ACE_TRY + try { return this->orb_core ()->service_raise_comm_failure ( this->details_.request_service_context ().service_info (), this->resolver_.profile () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); } - ACE_CATCHANY + catch ( ::CORBA::Exception&) { this->resolver_.stub ()->reset_profiles (); - ACE_RE_THROW; + throw; } - ACE_ENDTRY; } } @@ -366,7 +332,7 @@ namespace TAO Invocation_Status Synch_Twoway_Invocation::check_reply_status (TAO_Synch_Reply_Dispatcher &rd - ACE_ENV_ARG_DECL) + ) { /* * Precondition: We probably got a reply. <ACE_Thread::self> is @@ -405,14 +371,14 @@ namespace TAO break; case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD: return this->location_forward (cdr - ACE_ENV_ARG_PARAMETER); + ); case TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM: { // Unmarshal the location forward object and set the // variable this->forward_to_. Invocation_Status const s = this->location_forward (cdr - ACE_ENV_ARG_PARAMETER); + ); if (s != TAO_INVOKE_FAILURE) { // de-marshalling of permanent object reference was successfull @@ -438,10 +404,10 @@ namespace TAO } case TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION: return this->handle_user_exception (cdr - ACE_ENV_ARG_PARAMETER); + ); case TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION: return this->handle_system_exception (cdr - ACE_ENV_ARG_PARAMETER); + ); case TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE: { @@ -464,8 +430,7 @@ namespace TAO // Now set this addressing mode in the profile, so that // the next invocation need not go through this. this->resolver_.profile ()->addressing_mode (addr_mode - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + ); mon.set_status (TAO_INVOKE_RESTART); @@ -478,7 +443,7 @@ namespace TAO Invocation_Status Synch_Twoway_Invocation::location_forward (TAO_InputCDR &inp_stream - ACE_ENV_ARG_DECL) + ) ACE_THROW_SPEC ((CORBA::SystemException)) { Reply_Guard mon (this, @@ -512,7 +477,7 @@ namespace TAO Invocation_Status Synch_Twoway_Invocation::handle_user_exception (TAO_InputCDR &cdr - ACE_ENV_ARG_DECL) + ) ACE_THROW_SPEC ((CORBA::Exception)) { Reply_Guard mon (this, @@ -537,12 +502,10 @@ namespace TAO CORBA::Exception *exception = this->details_.corba_exception (buf.in () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + ); exception->_tao_decode (cdr - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + ); if (TAO_debug_level > 5) { @@ -555,25 +518,20 @@ namespace TAO mon.set_status (TAO_INVOKE_USER_EXCEPTION); -#if defined (TAO_HAS_EXCEPTIONS) // If we have native exceptions, we must manage the memory allocated // by the call above to alloc(). Otherwise the Environment class // manages the memory. auto_ptr<CORBA::Exception> safety (exception); - // Direct throw because we don't have the ACE_TRY_ENV. + // Direct throw because we don't have the try_ENV. exception->_raise (); -#else - // We can not use ACE_THROW here. - ACE_TRY_ENV.exception (exception); -#endif return TAO_INVOKE_USER_EXCEPTION; } Invocation_Status Synch_Twoway_Invocation::handle_system_exception (TAO_InputCDR &cdr - ACE_ENV_ARG_DECL) + ) ACE_THROW_SPEC ((CORBA::SystemException)) { Reply_Guard mon (this, TAO_INVOKE_FAILURE); @@ -629,8 +587,7 @@ namespace TAO this->orb_core ()->service_raise_transient_failure ( this->details_.request_service_context ().service_info (), this->resolver_.profile () - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + ); if (s == TAO_INVOKE_RESTART) return s; @@ -666,12 +623,10 @@ namespace TAO TAO_INVOKE_FAILURE); } -#if defined (TAO_HAS_EXCEPTIONS) // Without this, the call to create_system_exception() above // causes a memory leak. On platforms without native exceptions, // the CORBA::Environment class manages the memory. auto_ptr<CORBA::SystemException> safety (ex); -#endif ex->minor (minor); ex->completed (CORBA::CompletionStatus (completion)); @@ -701,7 +656,7 @@ namespace TAO Invocation_Status Synch_Oneway_Invocation::remote_oneway (ACE_Time_Value *max_wait_time - ACE_ENV_ARG_DECL) + ) ACE_THROW_SPEC ((CORBA::Exception)) { ACE_Countdown_Time countdown (max_wait_time); @@ -715,19 +670,16 @@ namespace TAO response_flags == CORBA::Octet (Messaging::SYNC_WITH_TARGET)) { s = Synch_Twoway_Invocation::remote_twoway (max_wait_time - ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + ); return s; } TAO_Target_Specification tspec; - this->init_target_spec (tspec ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + this->init_target_spec (tspec); #if TAO_HAS_INTERCEPTORS == 1 - s = this->send_request_interception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); + s = this->send_request_interception (); if (s != TAO_INVOKE_SUCCESS) return s; @@ -738,7 +690,7 @@ namespace TAO TAO_OutputCDR &cdr = transport->out_stream (); - ACE_TRY + try { cdr.message_attributes (this->details_.request_id (), this->resolver_.stub (), @@ -747,12 +699,10 @@ namespace TAO this->write_header (tspec, cdr - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); this->marshal_data (cdr - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); countdown.update (); @@ -762,8 +712,7 @@ namespace TAO s = this->send_message (cdr, TAO_Transport::TAO_ONEWAY_REQUEST, max_wait_time - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + ); } else { @@ -778,17 +727,14 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 s = - this->receive_other_interception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + this->receive_other_interception (); #endif /*TAO_HAS_INTERCEPTORS */ } - ACE_CATCHANY + catch ( ::CORBA::Exception& ex) { #if TAO_HAS_INTERCEPTORS == 1 PortableInterceptor::ReplyStatus const status = - this->handle_any_exception (&ACE_ANY_EXCEPTION - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->handle_any_exception (&ex); if (status == PortableInterceptor::LOCATION_FORWARD || status == PortableInterceptor::TRANSPORT_RETRY) @@ -796,28 +742,8 @@ namespace TAO else if (status == PortableInterceptor::SYSTEM_EXCEPTION || status == PortableInterceptor::USER_EXCEPTION) #endif /*TAO_HAS_INTERCEPTORS*/ - ACE_RE_THROW; - } -# if defined (ACE_HAS_EXCEPTIONS) \ - && defined (ACE_HAS_BROKEN_UNEXPECTED_EXCEPTIONS) - ACE_CATCHALL - { -#if TAO_HAS_INTERCEPTORS == 1 - PortableInterceptor::ReplyStatus const st = - this->handle_all_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - - if (st == PortableInterceptor::LOCATION_FORWARD || - st == PortableInterceptor::TRANSPORT_RETRY) - s = TAO_INVOKE_RESTART; - else -#endif /*TAO_HAS_INTERCEPTORS == 1*/ - ACE_RE_THROW; + throw; } -# endif /* ACE_HAS_EXCEPTIONS && - ACE_HAS_BROKEN_UNEXPECTED_EXCEPTION*/ - ACE_ENDTRY; - ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); return s; } |