From d7853d8bc5e61edb446785cc2d71c24f7b239856 Mon Sep 17 00:00:00 2001 From: Johnny Willemsen Date: Mon, 5 Feb 2007 20:23:47 +0000 Subject: Mon Feb 5 20:16:14 UTC 2007 Johnny Willemsen --- TAO/tao/Collocated_Invocation.cpp | 21 +++++- TAO/tao/DynamicAny/DynSequence_i.cpp | 90 ++++++++--------------- TAO/tao/GIOP_Message_Base.cpp | 31 ++++---- TAO/tao/GIOP_Message_Lite.cpp | 42 ++++------- TAO/tao/Invocation_Base.cpp | 26 ++++--- TAO/tao/Invocation_Base.h | 3 +- TAO/tao/Messaging/Asynch_Invocation.cpp | 63 +++++++++------- TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp | 15 ++-- TAO/tao/Messaging/Asynch_Reply_Dispatcher.h | 3 +- TAO/tao/Messaging/Connection_Timeout_Policy_i.cpp | 14 +--- TAO/tao/Messaging/Connection_Timeout_Policy_i.h | 3 +- TAO/tao/Messaging/ExceptionHolder_i.cpp | 14 +--- TAO/tao/Messaging/ExceptionHolder_i.h | 9 +-- TAO/tao/Messaging/Messaging.h | 7 +- TAO/tao/Messaging/Messaging_Loader.cpp | 3 +- TAO/tao/Messaging/Messaging_Loader.h | 3 +- TAO/tao/Messaging/Messaging_ORBInitializer.cpp | 6 +- TAO/tao/Messaging/Messaging_PolicyFactory.cpp | 12 +-- TAO/tao/Messaging/Messaging_Policy_i.cpp | 21 ++---- TAO/tao/Messaging/Messaging_Policy_i.h | 3 +- TAO/tao/ORB.cpp | 18 ----- TAO/tao/PI_Server/ServerRequestDetails.cpp | 3 +- TAO/tao/Synch_Invocation.cpp | 68 ++++++++++------- TAO/tao/TAO_Singleton_Manager.cpp | 41 ----------- TAO/tao/TAO_Singleton_Manager.h | 20 ----- 25 files changed, 210 insertions(+), 329 deletions(-) (limited to 'TAO/tao') diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp index 0f3e029859f..157a3fae6c5 100644 --- a/TAO/tao/Collocated_Invocation.cpp +++ b/TAO/tao/Collocated_Invocation.cpp @@ -5,6 +5,7 @@ #include "tao/TAO_Server_Request.h" #include "tao/Stub.h" #include "tao/operation_details.h" +#include "tao/PortableInterceptor.h" #if TAO_HAS_INTERCEPTORS == 1 # include "tao/PortableInterceptorC.h" @@ -111,7 +112,7 @@ namespace TAO } catch ( ::CORBA::Exception& ex) { - // Ignore exceptions for oneways + // Ignore CORBA exceptions for oneways if (this->response_expected_ == false) return TAO_INVOKE_SUCCESS; @@ -125,9 +126,25 @@ namespace TAO else #else ACE_UNUSED_ARG (ex); -#endif /*TAO_HAS_INTERCEPTORS*/ +#endif /* TAO_HAS_INTERCEPTORS */ throw; } +#if TAO_HAS_INTERCEPTORS == 1 + catch (...) + { + // Notify interceptors of non-CORBA exception, and propagate + // that exception to the caller. + + PortableInterceptor::ReplyStatus const st = + this->handle_all_exception (); + + if (st == PortableInterceptor::LOCATION_FORWARD || + st == PortableInterceptor::TRANSPORT_RETRY) + s = TAO_INVOKE_RESTART; + else + throw; + } +#endif /* TAO_HAS_INTERCEPTORS == 1 */ if (this->forwarded_to_.in () != 0) s = TAO_INVOKE_RESTART; diff --git a/TAO/tao/DynamicAny/DynSequence_i.cpp b/TAO/tao/DynamicAny/DynSequence_i.cpp index 7c49691c42f..2174717cc67 100644 --- a/TAO/tao/DynamicAny/DynSequence_i.cpp +++ b/TAO/tao/DynamicAny/DynSequence_i.cpp @@ -40,8 +40,7 @@ TAO_DynSequence_i::init (const CORBA::Any& any) { CORBA::TypeCode_var tc = any.type (); - CORBA::TCKind kind = - TAO_DynAnyFactory::unalias (tc.in ()); + CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc.in ()); if (kind != CORBA::tk_sequence) { @@ -58,8 +57,7 @@ TAO_DynSequence_i::init (const CORBA::Any& any) if (impl->encoded ()) { - TAO::Unknown_IDL_Type *unk = - dynamic_cast (impl); + TAO::Unknown_IDL_Type *unk = dynamic_cast (impl); cdr = unk->_tao_get_cdr (); } @@ -89,30 +87,24 @@ TAO_DynSequence_i::init (const CORBA::Any& any) TAO_InputCDR unk_in (cdr); TAO::Unknown_IDL_Type *field_unk = 0; ACE_NEW (field_unk, - TAO::Unknown_IDL_Type (field_tc.in (), - unk_in)); + TAO::Unknown_IDL_Type (field_tc.in (), unk_in)); field_any.replace (field_unk); // This recursive step will call the correct constructor // based on the type of field_any. this->da_members_[i] = TAO::MakeDynAnyUtils::make_dyn_any_t ( - field_any._tao_get_typecode (), - field_any); + field_any._tao_get_typecode (), field_any); // Move to the next field in the CDR stream. - (void) TAO_Marshal_Object::perform_skip (field_tc.in (), - &cdr - ); + (void) TAO_Marshal_Object::perform_skip (field_tc.in (), &cdr); } } void -TAO_DynSequence_i::init (CORBA::TypeCode_ptr tc - ) +TAO_DynSequence_i::init (CORBA::TypeCode_ptr tc) { - CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc - ); + CORBA::TCKind kind = TAO_DynAnyFactory::unalias (tc); if (kind != CORBA::tk_sequence) { @@ -130,8 +122,7 @@ TAO_DynSequence_i::init (CORBA::TypeCode_ptr tc // **************************************************************** TAO_DynSequence_i * -TAO_DynSequence_i::_narrow (CORBA::Object_ptr _tao_objref - ) +TAO_DynSequence_i::_narrow (CORBA::Object_ptr _tao_objref) { if (CORBA::is_nil (_tao_objref)) { @@ -160,8 +151,7 @@ TAO_DynSequence_i::get_element_type (void) } // Return the content type. - CORBA::TypeCode_ptr retval = - element_type->content_type (); + CORBA::TypeCode_ptr retval = element_type->content_type (); return retval; } @@ -196,8 +186,7 @@ TAO_DynSequence_i::set_length (CORBA::ULong length) // CORBA::TypeCode::length() does not accept aliased type codes. CORBA::TypeCode_var stripped_tc = - TAO_DynAnyFactory::strip_alias (this->type_.in () - ); + TAO_DynAnyFactory::strip_alias (this->type_.in ()); CORBA::ULong bound = stripped_tc->length (); @@ -309,8 +298,7 @@ TAO_DynSequence_i::set_elements (const DynamicAny::AnySeq & value) } CORBA::TypeCode_var stripped_tc = - TAO_DynAnyFactory::strip_alias (this->type_.in () - ); + TAO_DynAnyFactory::strip_alias (this->type_.in ()); CORBA::ULong length = value.length (); CORBA::ULong bound = stripped_tc->length (); @@ -336,8 +324,7 @@ TAO_DynSequence_i::set_elements (const DynamicAny::AnySeq & value) this->da_members_.size (length); } - CORBA::TypeCode_var element_type = - this->get_element_type (); + CORBA::TypeCode_var element_type = this->get_element_type (); CORBA::TypeCode_var value_tc; @@ -346,8 +333,7 @@ TAO_DynSequence_i::set_elements (const DynamicAny::AnySeq & value) // Check each arg element for type match. value_tc = value[i].type (); CORBA::Boolean equivalent = - value_tc->equivalent (element_type.in () - ); + value_tc->equivalent (element_type.in ()); if (equivalent) { @@ -407,9 +393,7 @@ TAO_DynSequence_i::get_elements_as_dyn_any (void) { // A deep copy is made only by copy() (CORBA 2.4.2 section 9.2.3.6). // Set the flag so the caller can't destroy. - this->set_flag (this->da_members_[i].in (), - 0 - ); + this->set_flag (this->da_members_[i].in (), 0); safe_retval[i] = DynamicAny::DynAny::_duplicate (this->da_members_[i].in ()); @@ -433,8 +417,7 @@ TAO_DynSequence_i::set_elements_as_dyn_any ( } CORBA::TypeCode_var stripped_tc = - TAO_DynAnyFactory::strip_alias (this->type_.in () - ); + TAO_DynAnyFactory::strip_alias (this->type_.in ()); CORBA::ULong length = values.length (); CORBA::ULong bound = stripped_tc->length (); @@ -460,9 +443,7 @@ TAO_DynSequence_i::set_elements_as_dyn_any ( { val_type = values[i]->type (); - equivalent = val_type->equivalent (element_type.in () - ); - + equivalent = val_type->equivalent (element_type.in ()); if (equivalent) { @@ -514,8 +495,7 @@ TAO_DynSequence_i::from_any (const CORBA::Any & any) CORBA::TypeCode_var tc = any.type (); CORBA::Boolean equivalent = - this->type_.in ()->equivalent (tc.in () - ); + this->type_.in ()->equivalent (tc.in ()); if (equivalent) { @@ -575,9 +555,7 @@ TAO_DynSequence_i::from_any (const CORBA::Any & any) field_any); // Move to the next field in the CDR stream. - (void) TAO_Marshal_Object::perform_skip (field_tc.in (), - &cdr - ); + (void) TAO_Marshal_Object::perform_skip (field_tc.in (), &cdr); } // Destroy any dangling members. @@ -646,8 +624,7 @@ TAO_DynSequence_i::to_any (void) (void) TAO_Marshal_Object::perform_append (field_tc.in (), &field_cdr, - &out_cdr - ); + &out_cdr); } TAO_InputCDR in_cdr (out_cdr); @@ -680,17 +657,16 @@ TAO_DynSequence_i::equal (DynamicAny::DynAny_ptr rhs) CORBA::TypeCode_var tc = rhs->type (); - CORBA::Boolean equivalent = tc->equivalent (this->type_.in () - ); + CORBA::Boolean equivalent = tc->equivalent (this->type_.in ()); if (!equivalent) { - return 0; + return false; } if (rhs->component_count () != this->component_count_) { - return 0; + return false; } DynamicAny::DynAny_var tmp; @@ -698,22 +674,20 @@ TAO_DynSequence_i::equal (DynamicAny::DynAny_ptr rhs) for (CORBA::ULong i = 0; i < this->component_count_; ++i) { - rhs->seek (static_cast (i) - ); + rhs->seek (static_cast (i)); tmp = rhs->current_component (); // Recursive step. - member_equal = tmp->equal (this->da_members_[i].in () - ); + member_equal = tmp->equal (this->da_members_[i].in ()); if (!member_equal) { - return 0; + return false; } } - return 1; + return true; } void @@ -732,9 +706,7 @@ TAO_DynSequence_i::destroy (void) // Do a deep destroy. for (CORBA::ULong i = 0; i < this->component_count_; ++i) { - this->set_flag (da_members_[i].in (), - 1 - ); + this->set_flag (da_members_[i].in (), 1); this->da_members_[i]->destroy (); } @@ -762,13 +734,9 @@ TAO_DynSequence_i::current_component (void) CORBA::ULong index = static_cast (this->current_position_); - this->set_flag (this->da_members_[index].in (), - 0 - ); + this->set_flag (this->da_members_[index].in (), 0); - return DynamicAny::DynAny::_duplicate ( - this->da_members_[index].in () - ); + return DynamicAny::DynAny::_duplicate (this->da_members_[index].in ()); } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index 01e06b447f7..3c224fd53dd 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -1106,23 +1106,20 @@ TAO_GIOP_Message_Base::process_request ( (TAO_UNHANDLED_SERVER_CXX_EXCEPTION, 0), CORBA::COMPLETED_MAYBE); - result = this->send_reply_exception (transport, - output, - request_id, - &request.reply_service_info (), - &exception); - if (result == -1) + if (this->send_reply_exception (transport, + output, + request_id, + &request.reply_service_info (), + &exception) == -1 + && TAO_debug_level > 0) { - if (TAO_debug_level > 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t) - TAO_GIOP_Message_Base::process_request[3], ") - ACE_TEXT ("%p: ") - ACE_TEXT ("cannot send exception\n"), - ACE_TEXT ("process_request ()"))); - exception._tao_print_exception ( - "TAO_GIOP_Message_Base::process_request[3]"); - } + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO (%P|%t) - TAO_GIOP_Message_Base::process_request[3], ") + ACE_TEXT ("%p: ") + ACE_TEXT ("cannot send exception\n"), + ACE_TEXT ("process_request ()"))); + exception._tao_print_exception ( + "TAO_GIOP_Message_Base::process_request[3]"); } } else if (TAO_debug_level > 0) @@ -1133,7 +1130,7 @@ TAO_GIOP_Message_Base::process_request ( // However, in this case, we cannot close the connection // down, since it really isn't the client's fault. ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t|%N|%l) exception thrown ") + ACE_TEXT ("TAO (%P|%t) exception thrown ") ACE_TEXT ("but client is not waiting a response\n"))); } diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp index baadd95a181..1bb0a40276c 100644 --- a/TAO/tao/GIOP_Message_Lite.cpp +++ b/TAO/tao/GIOP_Message_Lite.cpp @@ -863,15 +863,6 @@ TAO_GIOP_Message_Lite::process_request (TAO_Transport *transport, } catch (...) { - // @@ TODO some c++ exception or another, but what do we do with - // it? - // We are supposed to map it into a CORBA::UNKNOWN exception. - // BTW, this cannot be detected if using the mapping. If - // we have native exceptions but no support for them in the ORB - // we should still be able to catch it. If we don't have native - // exceptions it couldn't have been raised in the first place! - int result = 0; - if (response_required) { CORBA::UNKNOWN exception ( @@ -882,23 +873,20 @@ TAO_GIOP_Message_Lite::process_request (TAO_Transport *transport, CORBA::COMPLETED_MAYBE ); - result = this->send_reply_exception (transport, - this->orb_core_, - request_id, - &request.reply_service_info (), - &exception); - if (result == -1) + if (this->send_reply_exception (transport, + this->orb_core_, + request_id, + &request.reply_service_info (), + &exception) == -1 + && TAO_debug_level > 0) { - if (TAO_debug_level > 0) - { - ACE_ERROR ((LM_ERROR, - ACE_TEXT ("TAO (%P|%t) - TAO_GIOP_Message_Lite::process_request[3], ") - ACE_TEXT ("%p: ") - ACE_TEXT ("cannot send exception\n"), - ACE_TEXT ("process_request ()"))); - exception._tao_print_exception ( - "TAO_GIOP_Message_Lite::process_request[3]"); - } + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("TAO (%P|%t) - TAO_GIOP_Message_Lite::process_request[3], ") + ACE_TEXT ("%p: ") + ACE_TEXT ("cannot send exception\n"), + ACE_TEXT ("process_request ()"))); + exception._tao_print_exception ( + "TAO_GIOP_Message_Lite::process_request[3]"); } } else if (TAO_debug_level > 0) @@ -913,7 +901,9 @@ TAO_GIOP_Message_Lite::process_request (TAO_Transport *transport, ACE_TEXT ("but client is not waiting a response\n"))); } - return result; + // Propagate the non-CORBA C++ exception up to the application + // server. + throw; } return 0; diff --git a/TAO/tao/Invocation_Base.cpp b/TAO/tao/Invocation_Base.cpp index 47727606a5b..eefdf4a6456 100644 --- a/TAO/tao/Invocation_Base.cpp +++ b/TAO/tao/Invocation_Base.cpp @@ -10,7 +10,7 @@ #if TAO_HAS_INTERCEPTORS == 1 # include "tao/PortableInterceptorC.h" # include "tao/ClientRequestInterceptor_Adapter_Factory.h" -#endif /* TAO_HAS_INTERCEPTORS == 1*/ +#endif /* TAO_HAS_INTERCEPTORS == 1 */ #if !defined (__ACE_INLINE__) # include "tao/Invocation_Base.inl" @@ -24,6 +24,13 @@ ACE_RCSID (tao, TAO_BEGIN_VERSIONED_NAMESPACE_DECL +namespace +{ + // Exception used to represent non-CORBA exceptions. A global + // instance is used since it will never be modified. + CORBA::UNKNOWN /* const */ unknown_exception; +} + namespace TAO { Invocation_Base::Invocation_Base (CORBA::Object_ptr ot, @@ -31,7 +38,7 @@ namespace TAO TAO_Stub *stub, TAO_Operation_Details &details, bool response_expected, - bool request_is_remote) + bool TAO_INTERCEPTOR (request_is_remote)) : details_ (details) , forwarded_to_ (0) , response_expected_ (response_expected) @@ -45,18 +52,15 @@ namespace TAO , invoke_status_ (TAO_INVOKE_START) , caught_exception_ (0) , is_remote_request_ (request_is_remote) -#endif /*TAO_HAS_INTERCEPTORS == 1*/ +#endif /* TAO_HAS_INTERCEPTORS == 1 */ { -#if TAO_HAS_INTERCEPTORS == 0 - ACE_UNUSED_ARG (request_is_remote); -#endif /*TAO_HAS_INTERCEPTORS == 0*/ } Invocation_Base::~Invocation_Base (void) { #if TAO_HAS_INTERCEPTORS == 1 adapter_ = 0; -#endif /*TAO_HAS_INTERCEPTORS == 1*/ +#endif /* TAO_HAS_INTERCEPTORS == 1 */ } void @@ -147,7 +151,11 @@ namespace TAO catch ( ::CORBA::Exception& ex) { (void) this->handle_any_exception (&ex); - + throw; + } + catch (...) + { + (void) this->handle_all_exception (); throw; } @@ -227,7 +235,7 @@ namespace TAO return -1; } } -#endif /*TAO_HAS_INTERCEPTORS == 1*/ +#endif /* TAO_HAS_INTERCEPTORS == 1 */ } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Invocation_Base.h b/TAO/tao/Invocation_Base.h index 27f204854e9..53caa67ffe2 100644 --- a/TAO/tao/Invocation_Base.h +++ b/TAO/tao/Invocation_Base.h @@ -214,8 +214,7 @@ namespace TAO /// Helper methods to handle interception calls when exceptions /// are thrown by the PortableInterceptor. PortableInterceptor::ReplyStatus - handle_any_exception (CORBA::Exception *e - ); + handle_any_exception (CORBA::Exception * e); PortableInterceptor::ReplyStatus handle_all_exception (void); diff --git a/TAO/tao/Messaging/Asynch_Invocation.cpp b/TAO/tao/Messaging/Asynch_Invocation.cpp index 77bc8ee74a0..da8702ff120 100644 --- a/TAO/tao/Messaging/Asynch_Invocation.cpp +++ b/TAO/tao/Messaging/Asynch_Invocation.cpp @@ -25,45 +25,44 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL namespace TAO { Asynch_Remote_Invocation::Asynch_Remote_Invocation ( - CORBA::Object_ptr otarget, - Profile_Transport_Resolver &resolver, - TAO_Operation_Details &detail, - TAO_Asynch_Reply_Dispatcher_Base *rd, - bool response_expected) + CORBA::Object_ptr otarget, + Profile_Transport_Resolver &resolver, + TAO_Operation_Details &detail, + TAO_Asynch_Reply_Dispatcher_Base *rd, + bool response_expected) : Synch_Twoway_Invocation (otarget, resolver, detail, response_expected) - , safe_rd_ (rd) + , safe_rd_ (rd) { } Invocation_Status - Asynch_Remote_Invocation::remote_invocation (ACE_Time_Value *max_wait_time - ) + Asynch_Remote_Invocation::remote_invocation (ACE_Time_Value * max_wait_time) ACE_THROW_SPEC ((CORBA::Exception)) { TAO_Target_Specification tspec; this->init_target_spec (tspec); - TAO_OutputCDR &cdr = + TAO_OutputCDR & cdr = this->resolver_.transport ()->messaging_object ()->out_stream (); Invocation_Status s = TAO_INVOKE_FAILURE; #if TAO_HAS_INTERCEPTORS == 1 - s = - this->send_request_interception (); + s = this->send_request_interception (); if (s != TAO_INVOKE_SUCCESS) return s; -#endif /*TAO_HAS_INTERCEPTORS */ // 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 take care of the cases when things go wrong. try { +#endif /* TAO_HAS_INTERCEPTORS */ + // Oneway semantics. See comments for below send_message() // call. cdr.message_attributes (this->details_.request_id (), @@ -71,12 +70,9 @@ namespace TAO TAO_Transport::TAO_ONEWAY_REQUEST, max_wait_time); - this->write_header (tspec, - cdr - ); + this->write_header (tspec, cdr); - this->marshal_data (cdr - ); + this->marshal_data (cdr); // Register a reply dispatcher for this invocation. Use the // preallocated reply dispatcher. @@ -105,11 +101,9 @@ namespace TAO // Send it as a oneway request. It will make all the required // paraphernalia within the ORB to fire, like buffering if // send blocks etc. - s = - this->send_message (cdr, - TAO_Transport::TAO_ONEWAY_REQUEST, - max_wait_time - ); + s = this->send_message (cdr, + TAO_Transport::TAO_ONEWAY_REQUEST, + max_wait_time); #if TAO_HAS_INTERCEPTORS == 1 // NOTE: We don't need to do the auto_ptr <> trick. We got here @@ -124,13 +118,13 @@ namespace TAO // Nothing great on here. If we get a restart during send or a // proper send, we are supposed to call receiver_other () // interception point. So we do that here - Invocation_Status tmp = + Invocation_Status const tmp = this->receive_other_interception (); // We got an error during the interception. if (s == TAO_INVOKE_SUCCESS && tmp != TAO_INVOKE_SUCCESS) s = tmp; -#endif /*TAO_HAS_INTERCEPTORS */ +#endif /* TAO_HAS_INTERCEPTORS */ // If an error occurred just return. At this point all the // endpoint interception would have been invoked. The callee @@ -143,10 +137,11 @@ namespace TAO if (this->resolver_.transport ()->idle_after_send ()) (void) this->resolver_.transport_released (); +#if TAO_HAS_INTERCEPTORS == 1 } catch ( ::CORBA::Exception& ex) { -#if TAO_HAS_INTERCEPTORS == 1 + PortableInterceptor::ReplyStatus const status = this->handle_any_exception (&ex); @@ -155,11 +150,23 @@ namespace TAO s = TAO_INVOKE_RESTART; else if (status == PortableInterceptor::SYSTEM_EXCEPTION || status == PortableInterceptor::USER_EXCEPTION) -#else - ACE_UNUSED_ARG (ex); -#endif /*TAO_HAS_INTERCEPTORS*/ throw; } + catch (...) + { + // Notify interceptors of non-CORBA exception, and propagate + // that exception to the caller. + + PortableInterceptor::ReplyStatus const st = + this->handle_all_exception (); + + if (st == PortableInterceptor::LOCATION_FORWARD || + st == PortableInterceptor::TRANSPORT_RETRY) + s = TAO_INVOKE_RESTART; + else + throw; + } +#endif /* TAO_HAS_INTERCEPTORS */ return s; } diff --git a/TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp b/TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp index 8b521839467..4836c3910f7 100644 --- a/TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp +++ b/TAO/tao/Messaging/Asynch_Reply_Dispatcher.cpp @@ -58,8 +58,7 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply ( this->reply_status_ = params.reply_status_; // Transfer the 's content to this->reply_cdr_ - ACE_Data_Block *db = - this->reply_cdr_.clone_from (*params.input_cdr_); + ACE_Data_Block *db = this->reply_cdr_.clone_from (*params.input_cdr_); if (db == 0) { @@ -126,8 +125,7 @@ TAO_Asynch_Reply_Dispatcher::dispatch_reply ( // Call the Reply Handler's skeleton. reply_handler_skel_ (this->reply_cdr_, this->reply_handler_.in (), - reply_error - ); + reply_error); } catch (const ::CORBA::Exception& ex) { @@ -173,8 +171,7 @@ TAO_Asynch_Reply_Dispatcher::connection_closed (void) { this->reply_handler_skel_ (cdr, this->reply_handler_.in (), - TAO_AMI_REPLY_SYSTEM_EXCEPTION - ); + TAO_AMI_REPLY_SYSTEM_EXCEPTION); } } catch (const ::CORBA::Exception& ex) @@ -231,8 +228,7 @@ TAO_Asynch_Reply_Dispatcher::reply_timed_out (void) { this->reply_handler_skel_ (cdr, this->reply_handler_.in (), - TAO_AMI_REPLY_SYSTEM_EXCEPTION - ); + TAO_AMI_REPLY_SYSTEM_EXCEPTION); } } catch (const ::CORBA::Exception& ex) @@ -249,8 +245,7 @@ TAO_Asynch_Reply_Dispatcher::reply_timed_out (void) long TAO_Asynch_Reply_Dispatcher::schedule_timer (CORBA::ULong request_id, - const ACE_Time_Value &max_wait_time - ) + const ACE_Time_Value &max_wait_time) { if (this->timeout_handler_ == 0) { diff --git a/TAO/tao/Messaging/Asynch_Reply_Dispatcher.h b/TAO/tao/Messaging/Asynch_Reply_Dispatcher.h index 4989fb659f4..f60b1e46785 100644 --- a/TAO/tao/Messaging/Asynch_Reply_Dispatcher.h +++ b/TAO/tao/Messaging/Asynch_Reply_Dispatcher.h @@ -59,8 +59,7 @@ public: /// Install the timeout handler long schedule_timer (CORBA::ULong request_id, - const ACE_Time_Value &max_wait_time - ); + const ACE_Time_Value &max_wait_time); private: /// Skeleton for the call back method in the Reply Handler. diff --git a/TAO/tao/Messaging/Connection_Timeout_Policy_i.cpp b/TAO/tao/Messaging/Connection_Timeout_Policy_i.cpp index c964dddf563..d62ce1d8a54 100644 --- a/TAO/tao/Messaging/Connection_Timeout_Policy_i.cpp +++ b/TAO/tao/Messaging/Connection_Timeout_Policy_i.cpp @@ -66,15 +66,12 @@ TAO_ConnectionTimeoutPolicy::hook (TAO_ORB_Core *orb_core, { policy = orb_core->get_cached_policy_including_current ( - TAO_CACHED_POLICY_CONNECTION_TIMEOUT - ); + TAO_CACHED_POLICY_CONNECTION_TIMEOUT); } else { policy = - stub->get_cached_policy ( - TAO_CACHED_POLICY_CONNECTION_TIMEOUT - ); + stub->get_cached_policy (TAO_CACHED_POLICY_CONNECTION_TIMEOUT); } if (CORBA::is_nil (policy.in ())) @@ -84,9 +81,7 @@ TAO_ConnectionTimeoutPolicy::hook (TAO_ORB_Core *orb_core, } TAO::ConnectionTimeoutPolicy_var p = - TAO::ConnectionTimeoutPolicy::_narrow ( - policy.in () - ); + TAO::ConnectionTimeoutPolicy::_narrow (policy.in ()); TimeBase::TimeT t = p->relative_expiry (); TimeBase::TimeT seconds = t / 10000000u; @@ -111,8 +106,7 @@ TAO_ConnectionTimeoutPolicy::hook (TAO_ORB_Core *orb_core, } CORBA::Policy_ptr -TAO_ConnectionTimeoutPolicy::create (const CORBA::Any& val - ) +TAO_ConnectionTimeoutPolicy::create (const CORBA::Any& val) { // Future policy implementors: notice how the following code is // exception safe! diff --git a/TAO/tao/Messaging/Connection_Timeout_Policy_i.h b/TAO/tao/Messaging/Connection_Timeout_Policy_i.h index 67d4e401033..63f0091e14f 100644 --- a/TAO/tao/Messaging/Connection_Timeout_Policy_i.h +++ b/TAO/tao/Messaging/Connection_Timeout_Policy_i.h @@ -63,8 +63,7 @@ public: /// Helper method for the implementation of /// CORBA::ORB::create_policy. - static CORBA::Policy_ptr create (const CORBA::Any& val - ); + static CORBA::Policy_ptr create (const CORBA::Any& val); /// Returns a copy of . virtual TAO_ConnectionTimeoutPolicy *clone (void) const; diff --git a/TAO/tao/Messaging/ExceptionHolder_i.cpp b/TAO/tao/Messaging/ExceptionHolder_i.cpp index b66bcba0eb5..76e4c7695b5 100644 --- a/TAO/tao/Messaging/ExceptionHolder_i.cpp +++ b/TAO/tao/Messaging/ExceptionHolder_i.cpp @@ -43,9 +43,7 @@ namespace TAO this->count_ = exceptions_count; } - void ExceptionHolder::raise_exception ( - void - ) + void ExceptionHolder::raise_exception (void) { TAO_Messaging_Helper::exception_holder_raise ( this->data_, @@ -53,13 +51,11 @@ namespace TAO this->marshaled_exception ().get_buffer (), this->marshaled_exception ().length (), this->byte_order (), - this->is_system_exception () - ); + this->is_system_exception ()); } void ExceptionHolder::raise_exception_with_list ( - const ::Dynamic::ExceptionList & - ) + const ::Dynamic::ExceptionList &) { // todo convert exceptionlist to something we can really use. this->raise_exception (); @@ -84,14 +80,12 @@ namespace TAO } CORBA::ValueBase * - ExceptionHolderFactory::create_for_unmarshal ( - void) + ExceptionHolderFactory::create_for_unmarshal (void) { TAO::ExceptionHolder* ret_val = 0; ACE_NEW_THROW_EX (ret_val, ExceptionHolder, CORBA::NO_MEMORY ()); - return ret_val; } diff --git a/TAO/tao/Messaging/ExceptionHolder_i.h b/TAO/tao/Messaging/ExceptionHolder_i.h index ea07d781443..0378b7226be 100644 --- a/TAO/tao/Messaging/ExceptionHolder_i.h +++ b/TAO/tao/Messaging/ExceptionHolder_i.h @@ -54,8 +54,7 @@ namespace TAO ::CORBA::Boolean byte_order, const ::CORBA::OctetSeq &marshaled_exception, ::TAO::Exception_Data* data, - ::CORBA::ULong exceptions_count - ); + ::CORBA::ULong exceptions_count); void set_exception_data (::TAO::Exception_Data* data, ::CORBA::ULong exceptions_count); @@ -63,8 +62,7 @@ namespace TAO virtual void raise_exception (void); virtual void raise_exception_with_list ( - const ::Dynamic::ExceptionList & exc_list - ); + const ::Dynamic::ExceptionList & exc_list); virtual CORBA::ValueBase* _copy_value (void); @@ -90,8 +88,7 @@ namespace TAO public virtual CORBA::ValueFactoryBase { public: - virtual CORBA::ValueBase * create_for_unmarshal ( - void); + virtual CORBA::ValueBase * create_for_unmarshal (void); }; } diff --git a/TAO/tao/Messaging/Messaging.h b/TAO/tao/Messaging/Messaging.h index 04f69d33aa5..11fc5907498 100644 --- a/TAO/tao/Messaging/Messaging.h +++ b/TAO/tao/Messaging/Messaging.h @@ -63,9 +63,7 @@ enum TAO_AMI_Reply_Status typedef void (*TAO_Reply_Handler_Skeleton)( TAO_InputCDR &, Messaging::ReplyHandler_ptr, - CORBA::ULong reply_status - - ); + CORBA::ULong reply_status); namespace TAO { @@ -88,8 +86,7 @@ namespace TAO_Messaging_Helper CORBA::Octet *marshaled_data, CORBA::ULong marshaled_data_length, CORBA::Boolean byte_order, - CORBA::Boolean is_system_exception - ); + CORBA::Boolean is_system_exception); } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Messaging/Messaging_Loader.cpp b/TAO/tao/Messaging/Messaging_Loader.cpp index db1814ff545..f9c1897c6a4 100644 --- a/TAO/tao/Messaging/Messaging_Loader.cpp +++ b/TAO/tao/Messaging/Messaging_Loader.cpp @@ -51,8 +51,7 @@ TAO_Messaging_Loader::init (int, orb_initializer = temp_orb_initializer; - PortableInterceptor::register_orb_initializer (orb_initializer.in () - ); + PortableInterceptor::register_orb_initializer (orb_initializer.in ()); } catch (const ::CORBA::Exception& ex) { diff --git a/TAO/tao/Messaging/Messaging_Loader.h b/TAO/tao/Messaging/Messaging_Loader.h index 0a046f44675..8a3d8ae118c 100644 --- a/TAO/tao/Messaging/Messaging_Loader.h +++ b/TAO/tao/Messaging/Messaging_Loader.h @@ -37,8 +37,7 @@ public: virtual ~TAO_Messaging_Loader (void); /// Initialize the Messaging loader hooks. - virtual int init (int argc, - ACE_TCHAR* []); + virtual int init (int argc, ACE_TCHAR* []); }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/Messaging/Messaging_ORBInitializer.cpp b/TAO/tao/Messaging/Messaging_ORBInitializer.cpp index d2bc635f550..59c8194037f 100644 --- a/TAO/tao/Messaging/Messaging_ORBInitializer.cpp +++ b/TAO/tao/Messaging/Messaging_ORBInitializer.cpp @@ -21,8 +21,7 @@ TAO_Messaging_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr) ACE_THROW_SPEC ((CORBA::SystemException)) { #if (TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1) - TAO_ORB_Core::set_timeout_hook - (TAO_RelativeRoundtripTimeoutPolicy::hook); + TAO_ORB_Core::set_timeout_hook (TAO_RelativeRoundtripTimeoutPolicy::hook); #endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */ #if (TAO_HAS_SYNC_SCOPE_POLICY == 1) @@ -30,8 +29,7 @@ TAO_Messaging_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr) #endif /* TAO_HAS_SYNC_SCOPE_POLICY == 1 */ #if (TAO_HAS_CONNECTION_TIMEOUT_POLICY == 1) - TAO_ORB_Core::connection_timeout_hook - (TAO_ConnectionTimeoutPolicy::hook); + TAO_ORB_Core::connection_timeout_hook (TAO_ConnectionTimeoutPolicy::hook); #endif /* TAO_HAS_CONNECTION_TIMEOUT_POLICY == 1 */ } diff --git a/TAO/tao/Messaging/Messaging_PolicyFactory.cpp b/TAO/tao/Messaging/Messaging_PolicyFactory.cpp index d827c740948..35af00c3ddd 100644 --- a/TAO/tao/Messaging/Messaging_PolicyFactory.cpp +++ b/TAO/tao/Messaging/Messaging_PolicyFactory.cpp @@ -43,26 +43,22 @@ TAO_Messaging_PolicyFactory::create_policy ( { #if (TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1) if (type == Messaging::RELATIVE_RT_TIMEOUT_POLICY_TYPE) - return TAO_RelativeRoundtripTimeoutPolicy::create (value - ); + return TAO_RelativeRoundtripTimeoutPolicy::create (value); #endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */ #if (TAO_HAS_CONNECTION_TIMEOUT_POLICY == 1) if (type == TAO::CONNECTION_TIMEOUT_POLICY_TYPE) - return TAO_ConnectionTimeoutPolicy::create (value - ); + return TAO_ConnectionTimeoutPolicy::create (value); #endif /* TAO_HAS_RELATIVE_ROUNDTRIP_TIMEOUT_POLICY == 1 */ #if (TAO_HAS_SYNC_SCOPE_POLICY == 1) if (type == Messaging::SYNC_SCOPE_POLICY_TYPE) - return TAO_Sync_Scope_Policy::create (value - ); + return TAO_Sync_Scope_Policy::create (value); #endif /* TAO_HAS_SYNC_SCOPE_POLICY == 1 */ #if (TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1) if (type == TAO::BUFFERING_CONSTRAINT_POLICY_TYPE) - return this->create_buffering_constraint_policy (value - ); + return this->create_buffering_constraint_policy (value); #endif /* TAO_HAS_BUFFERING_CONSTRAINT_POLICY == 1 */ if ( diff --git a/TAO/tao/Messaging/Messaging_Policy_i.cpp b/TAO/tao/Messaging/Messaging_Policy_i.cpp index db860474bdd..50e59b8c082 100644 --- a/TAO/tao/Messaging/Messaging_Policy_i.cpp +++ b/TAO/tao/Messaging/Messaging_Policy_i.cpp @@ -70,14 +70,13 @@ TAO_RelativeRoundtripTimeoutPolicy::hook (TAO_ORB_Core *orb_core, { policy = orb_core->get_cached_policy_including_current ( - TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT - ); + TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT); } else { policy = - stub->get_cached_policy (TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT - ); + stub->get_cached_policy ( + TAO_CACHED_POLICY_RELATIVE_ROUNDTRIP_TIMEOUT); } if (CORBA::is_nil (policy.in ())) @@ -87,9 +86,7 @@ TAO_RelativeRoundtripTimeoutPolicy::hook (TAO_ORB_Core *orb_core, } Messaging::RelativeRoundtripTimeoutPolicy_var p = - Messaging::RelativeRoundtripTimeoutPolicy::_narrow ( - policy.in () - ); + Messaging::RelativeRoundtripTimeoutPolicy::_narrow (policy.in ()); TimeBase::TimeT t = p->relative_expiry (); TimeBase::TimeT seconds = t / 10000000u; @@ -118,7 +115,6 @@ TAO_RelativeRoundtripTimeoutPolicy::create (const CORBA::Any& val) { // Future policy implementors: notice how the following code is // exception safe! - TimeBase::TimeT value; if ((val >>= value) == 0) throw ::CORBA::PolicyError (CORBA::BAD_POLICY_VALUE); @@ -233,14 +229,12 @@ TAO_Sync_Scope_Policy::hook (TAO_ORB_Core *orb_core, { policy = orb_core->get_cached_policy_including_current ( - TAO_CACHED_POLICY_SYNC_SCOPE - ); + TAO_CACHED_POLICY_SYNC_SCOPE); } else { policy = - stub->get_cached_policy (TAO_CACHED_POLICY_SYNC_SCOPE - ); + stub->get_cached_policy (TAO_CACHED_POLICY_SYNC_SCOPE); } if (CORBA::is_nil (policy.in ())) @@ -268,8 +262,7 @@ TAO_Sync_Scope_Policy::hook (TAO_ORB_Core *orb_core, } CORBA::Policy_ptr -TAO_Sync_Scope_Policy::create (const CORBA::Any& val - ) +TAO_Sync_Scope_Policy::create (const CORBA::Any& val) { Messaging::SyncScope synchronization; if ((val >>= synchronization) == 0) diff --git a/TAO/tao/Messaging/Messaging_Policy_i.h b/TAO/tao/Messaging/Messaging_Policy_i.h index dea4905a49a..34be4fb5093 100644 --- a/TAO/tao/Messaging/Messaging_Policy_i.h +++ b/TAO/tao/Messaging/Messaging_Policy_i.h @@ -56,8 +56,7 @@ public: /// Helper method for the implementation of /// CORBA::ORB::create_policy. - static CORBA::Policy_ptr create (const CORBA::Any& val - ); + static CORBA::Policy_ptr create (const CORBA::Any& val); /// Returns a copy of . virtual TAO_RelativeRoundtripTimeoutPolicy *clone (void) const; diff --git a/TAO/tao/ORB.cpp b/TAO/tao/ORB.cpp index f4ee6bf3376..4aa035cd925 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -46,10 +46,6 @@ ACE_RCSID (tao, #include "ace/OS_NS_string.h" #include "ace/os_include/os_ctype.h" -void TAO_unexpected_exception_handler (void) -{ - throw ::CORBA::UNKNOWN (); -} static const char ior_prefix[] = "IOR:"; @@ -1121,20 +1117,6 @@ TAO::ORB::init_orb_globals (void) { ++orb_init_count; } - - // This must be done after the system TypeCodes and Exceptions have - // been initialized. An unexpected exception will cause TAO's - // unexpected exception handler to be called. That handler - // transforms all unexpected exceptions to CORBA::UNKNOWN, which of - // course requires the TypeCode constants and system exceptions to - // have been initialized. - /** - * @note The new TypeCode implementation obviates the above - * comment. Standard CORBA exception TypeCodes are now - * available before CORBA::ORB_init() is ever called. - */ - TAO_Singleton_Manager::instance ()->_set_unexpected ( - ::TAO_unexpected_exception_handler); } CORBA::ORB_ptr diff --git a/TAO/tao/PI_Server/ServerRequestDetails.cpp b/TAO/tao/PI_Server/ServerRequestDetails.cpp index b416d2faef1..efbfd028419 100644 --- a/TAO/tao/PI_Server/ServerRequestDetails.cpp +++ b/TAO/tao/PI_Server/ServerRequestDetails.cpp @@ -33,8 +33,7 @@ namespace TAO } // Obtain the PolicyType from the current Policy object. - CORBA::PolicyType const policy_type = - policy->policy_type (); + CORBA::PolicyType const policy_type = policy->policy_type (); if (policy_type == PortableInterceptor::PROCESSING_MODE_POLICY_TYPE) { diff --git a/TAO/tao/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index 6fee20f5bc2..10792070575 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -65,18 +65,18 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 // Start the interception point here.. - s = - this->send_request_interception (); + s = this->send_request_interception (); if (s != TAO_INVOKE_SUCCESS) return s; -#endif /*TAO_HAS_INTERCEPTORS */ // 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. try { +#endif /*TAO_HAS_INTERCEPTORS */ + TAO_OutputCDR &cdr = this->resolver_.transport ()->out_stream (); cdr.message_attributes (this->details_.request_id (), @@ -122,7 +122,7 @@ namespace TAO if (tmp != TAO_INVOKE_SUCCESS) s = tmp; } -#endif /*TAO_HAS_INTERCEPTORS */ +#endif /* TAO_HAS_INTERCEPTORS */ if (s != TAO_INVOKE_SUCCESS) return s; @@ -163,7 +163,7 @@ namespace TAO if (tmp != TAO_INVOKE_SUCCESS) s = tmp; } -#endif /*TAO_HAS_INTERCEPTORS */ +#endif /* TAO_HAS_INTERCEPTORS */ if (s != TAO_INVOKE_SUCCESS) return s; @@ -171,7 +171,6 @@ namespace TAO // What happens when the above call returns an error through // the return value? That would be bogus as per the contract // in the interface. The call violated the contract - s = this->check_reply_status (rd); // For some strategies one may want to release the transport @@ -191,14 +190,9 @@ namespace TAO } if (tmp != TAO_INVOKE_SUCCESS) s = tmp; -#endif /*TAO_HAS_INTERCEPTORS */ - - if (s != TAO_INVOKE_SUCCESS) - return s; } catch ( ::CORBA::Exception& ex) { -#if TAO_HAS_INTERCEPTORS == 1 PortableInterceptor::ReplyStatus const status = this->handle_any_exception (&ex); @@ -207,11 +201,23 @@ namespace TAO s = TAO_INVOKE_RESTART; else if (status == PortableInterceptor::SYSTEM_EXCEPTION || status == PortableInterceptor::USER_EXCEPTION) -#else - ACE_UNUSED_ARG (ex); -#endif /*TAO_HAS_INTERCEPTORS*/ throw; } + catch (...) + { + // Notify interceptors of non-CORBA exception, and propagate + // that exception to the caller. + + PortableInterceptor::ReplyStatus const st = + this->handle_all_exception (); + + if (st == PortableInterceptor::LOCATION_FORWARD || + st == PortableInterceptor::TRANSPORT_RETRY) + s = TAO_INVOKE_RESTART; + else + throw; + } +#endif /* TAO_HAS_INTERCEPTORS */ return s; } @@ -609,7 +615,7 @@ namespace TAO { ACE_Countdown_Time countdown (max_wait_time); - const CORBA::Octet response_flags = this->details_.response_flags (); + CORBA::Octet const response_flags = this->details_.response_flags (); Invocation_Status s = TAO_INVOKE_FAILURE; @@ -629,15 +635,15 @@ namespace TAO if (s != TAO_INVOKE_SUCCESS) return s; + + try + { #endif /*TAO_HAS_INTERCEPTORS */ - TAO_Transport* transport = - this->resolver_.transport (); + TAO_Transport* const transport = this->resolver_.transport (); - TAO_OutputCDR &cdr = transport->out_stream (); + TAO_OutputCDR &cdr = transport->out_stream (); - try - { cdr.message_attributes (this->details_.request_id (), this->resolver_.stub (), TAO_Transport::TAO_ONEWAY_REQUEST, @@ -649,7 +655,7 @@ namespace TAO countdown.update (); - if (transport->is_connected()) + if (transport->is_connected ()) { // We have a connected transport so we can send the message s = this->send_message (cdr, @@ -669,11 +675,9 @@ namespace TAO #if TAO_HAS_INTERCEPTORS == 1 s = this->receive_other_interception (); -#endif /*TAO_HAS_INTERCEPTORS */ } catch ( ::CORBA::Exception& ex) { -#if TAO_HAS_INTERCEPTORS == 1 PortableInterceptor::ReplyStatus const status = this->handle_any_exception (&ex); @@ -682,11 +686,23 @@ namespace TAO s = TAO_INVOKE_RESTART; else if (status == PortableInterceptor::SYSTEM_EXCEPTION || status == PortableInterceptor::USER_EXCEPTION) -#else - ACE_UNUSED_ARG (ex); -#endif /*TAO_HAS_INTERCEPTORS*/ throw; } + catch (...) + { + // Notify interceptors of non-CORBA exception, and propagate + // that exception to the caller. + + PortableInterceptor::ReplyStatus const st = + this->handle_all_exception (); + + if (st == PortableInterceptor::LOCATION_FORWARD || + st == PortableInterceptor::TRANSPORT_RETRY) + s = TAO_INVOKE_RESTART; + else + throw; + } +#endif /* TAO_HAS_INTERCEPTORS */ return s; } diff --git a/TAO/tao/TAO_Singleton_Manager.cpp b/TAO/tao/TAO_Singleton_Manager.cpp index 9fa29b29fe6..345d30cb3f9 100644 --- a/TAO/tao/TAO_Singleton_Manager.cpp +++ b/TAO/tao/TAO_Singleton_Manager.cpp @@ -1,7 +1,6 @@ // $Id$ #include "tao/TAO_Singleton_Manager.h" -#include "tao/Exception.h" #include "ace/Guard_T.h" #include "ace/Recursive_Thread_Mutex.h" @@ -12,16 +11,6 @@ # include "tao/TAO_Singleton_Manager.inl" #endif /* ! __ACE_INLINE__ */ -#if defined (ACE_MVS) -# include /**/ -#else -# if defined (ACE_HAS_STANDARD_CPP_LIBRARY) -# include /**/ -# else -# include /**/ -# endif /* ACE_HAS_STANDARD_CPP_LIBRARY */ -#endif /* ACE_MVS */ - ACE_RCSID (tao, TAO_Singleton_Manager, "$Id$") @@ -62,7 +51,6 @@ TAO_Singleton_Manager::TAO_Singleton_Manager (void) #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) , internal_lock_ (0) # endif /* ACE_MT_SAFE */ - , old_unexpected_ (0) { #if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) ACE_NEW (this->internal_lock_, @@ -264,17 +252,6 @@ TAO_Singleton_Manager::fini (void) this->internal_lock_ = 0; #endif /* ACE_MT_SAFE */ - // Restore the old unexpected exception handler since TAO will no - // longer be handling exceptions. Allow the application to once - // again handle unexpected exceptions. -# if (!defined (_MSC_VER) \ - && defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) \ - && (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0)) || defined (ghs) - (void) std::set_unexpected (this->old_unexpected_); -# else - (void) set_unexpected (this->old_unexpected_); -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ - // Indicate that this TAO_Singleton_Manager instance has been shut down. this->object_manager_state_ = OBJ_MAN_SHUT_DOWN; @@ -307,24 +284,6 @@ TAO_Singleton_Manager::shutting_down (void) : 1; } -void -TAO_Singleton_Manager::_set_unexpected (TAO_unexpected_handler u) -{ - // This must be done after the system TypeCodes and Exceptions have - // been initialized. An unexpected exception will cause TAO's - // unexpected exception handler to be called. That handler - // transforms all unexpected exceptions to CORBA::UNKNOWN, which of - // course requires the TypeCode constants and system exceptions to - // have been initialized. -# if (!defined (_MSC_VER) \ - && defined (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB) \ - && (ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB != 0)) || defined (ghs) - this->old_unexpected_ = std::set_unexpected (u); -# else - this->old_unexpected_ = set_unexpected (u); -# endif /* ACE_USES_STD_NAMESPACE_FOR_STDCPP_LIB */ -} - int TAO_Singleton_Manager::at_exit_i (void *object, ACE_CLEANUP_FUNC cleanup_hook, diff --git a/TAO/tao/TAO_Singleton_Manager.h b/TAO/tao/TAO_Singleton_Manager.h index 33b60e6251f..340e0048714 100644 --- a/TAO/tao/TAO_Singleton_Manager.h +++ b/TAO/tao/TAO_Singleton_Manager.h @@ -30,8 +30,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL -typedef void (*TAO_unexpected_handler)(void); - /** * @class TAO_Singleton_Manager * @@ -120,15 +118,6 @@ public: ACE_CLEANUP_FUNC cleanup_hook, void *param); - /// Set a new unexpected exception handler. - /** - * The old one will be stored for restoration later on. - * - * @note Calling this method multiple times will cause the stored - * old unexpected exception handler pointer to be lost. - */ - void _set_unexpected (TAO_unexpected_handler u); - protected: /// Force allocation on the heap. @@ -169,15 +158,6 @@ private: TAO_SYNCH_RECURSIVE_MUTEX *internal_lock_; #endif /* ACE_MT_SAFE */ - /// The old unexpected exception handler. - /** - * A pointer to the old unexpected exception handler is stored so - * that it can be restored when TAO is unloaded, for example. - * Otherwise, any unexpected exceptions will result in a call to - * TAO's unexpected exception handler which may no longer exist if - * TAO was unloaded. - */ - TAO_unexpected_handler old_unexpected_; }; TAO_END_VERSIONED_NAMESPACE_DECL -- cgit v1.2.1