From 1aad8cb8c4e505a8ae39d4059ebec8799e943655 Mon Sep 17 00:00:00 2001 From: Ossama Othman Date: Tue, 30 Jan 2007 01:00:39 +0000 Subject: ChangeLogTag:Mon Jan 30 00:10:57 UTC 2007 Ossama Othman --- TAO/ChangeLog | 33 ++++++++++++++++ TAO/tao/Collocated_Invocation.cpp | 21 +++++++++- TAO/tao/GIOP_Message_Base.cpp | 42 ++++++++------------ TAO/tao/GIOP_Message_Lite.cpp | 42 ++++++++------------ TAO/tao/Invocation_Base.cpp | 55 +++++++++++++++----------- TAO/tao/Invocation_Base.h | 3 +- TAO/tao/Messaging/Asynch_Invocation.cpp | 61 +++++++++++++++------------- TAO/tao/ORB.cpp | 26 ------------ TAO/tao/Synch_Invocation.cpp | 70 ++++++++++++++++++++------------- TAO/tao/TAO_Singleton_Manager.cpp | 41 ------------------- TAO/tao/TAO_Singleton_Manager.h | 20 ---------- 11 files changed, 196 insertions(+), 218 deletions(-) diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 49a38e31e12..ea7688b9cb1 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,36 @@ +Mon Jan 30 00:10:57 UTC 2007 Ossama Othman + + Changes that allow non-CORBA exceptions to be propagated to the + caller. + + * tao/GIOP_Message_Base.cpp (process_request): + * tao/GIOP_Message_Lite.cpp (process_request): + + Allow non-CORBA exceptions to be propagated up to the + application server. + + * tao/ORB.cpp: + * tao/TAO_Singleton_Manager.cpp: + * tao/TAO_Singleton_Manager.h: + + Removed code that set the unexpected exception handler. + + * tao/Collocated_Invocation.cpp (invoke): + * tao/Messaging/Asynch_Invocation.cpp (remote_invocation): + * tao/Synch_Invocation.cpp (remote_oneway, remote_twoway): + * tao/Invocation_Base.h: + * tao/Invocation_Base.cpp (send_request_interception): + (receive_reply_interception, receive_other_interception): + + Notify interceptors of non-CORBA exception, and propagate that + exception up to the caller. + + (handle_all_exceptions): + + Fixed object lifetime problem. A local CORBA::UNKNOWN exception + object was being used as if it exist beyond the scope of this + method. + Sun Jan 28 19:59:14 2007 William R. Otte * TAO version 1.5.6 released. diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp index ee4d5e23f80..f71d7b35a32 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" @@ -116,7 +117,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; @@ -130,9 +131,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/GIOP_Message_Base.cpp b/TAO/tao/GIOP_Message_Base.cpp index b7a0952feac..271e521c3ac 100644 --- a/TAO/tao/GIOP_Message_Base.cpp +++ b/TAO/tao/GIOP_Message_Base.cpp @@ -1094,13 +1094,6 @@ TAO_GIOP_Message_Base::process_request ( } 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) @@ -1109,23 +1102,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) @@ -1136,11 +1126,13 @@ 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"))); } - return result; + // Propagate the non-CORBA C++ exception up to the application + // server. + throw; } return 0; diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp index 12e666c5f2d..4e5238b9312 100644 --- a/TAO/tao/GIOP_Message_Lite.cpp +++ b/TAO/tao/GIOP_Message_Lite.cpp @@ -864,15 +864,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 ( @@ -883,23 +874,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) @@ -914,7 +902,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 51741319030..1c2c56216d2 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 @@ -87,15 +91,17 @@ namespace TAO { try { - this->adapter_->send_request (*this - ); + // This is a begin interception point. + this->adapter_->send_request (*this); } catch ( ::CORBA::Exception& ex) { - (void) this->handle_any_exception (&ex - ); - - // This is a begin interception point + (void) this->handle_any_exception (&ex); + throw; + } + catch (...) + { + (void) this->handle_all_exception (); throw; } @@ -120,7 +126,11 @@ namespace TAO catch ( ::CORBA::Exception& ex) { (void) this->handle_any_exception (&ex ); - + throw; + } + catch (...) + { + (void) this->handle_all_exception (); throw; } @@ -149,7 +159,11 @@ namespace TAO catch ( ::CORBA::Exception& ex) { (void) this->handle_any_exception (&ex); - + throw; + } + catch (...) + { + (void) this->handle_all_exception (); throw; } @@ -190,19 +204,16 @@ namespace TAO PortableInterceptor::ReplyStatus Invocation_Base::handle_all_exception (void) { - CORBA::UNKNOWN ex; - this->exception (&ex); + this->exception (&unknown_exception); PortableInterceptor::ReplyStatus status = PortableInterceptor::SYSTEM_EXCEPTION; if (adapter_ != 0) { - this->adapter_->receive_exception (*this - ); + this->adapter_->receive_exception (*this); - status = - this->adapter_->reply_status (*this); + status = this->adapter_->reply_status (*this); } return status; @@ -232,7 +243,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 b2c5088fa35..06347c163e2 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. @@ -107,11 +103,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 @@ -126,7 +120,7 @@ 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. @@ -145,10 +139,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); @@ -157,11 +152,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/ORB.cpp b/TAO/tao/ORB.cpp index 63312b4bfac..9c133b2a1aa 100644 --- a/TAO/tao/ORB.cpp +++ b/TAO/tao/ORB.cpp @@ -46,21 +46,9 @@ 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:"; -// = Static initialization. - -namespace -{ - // Count of the number of ORBs. - int orb_init_count = 0; -} - // **************************************************************** TAO_BEGIN_VERSIONED_NAMESPACE_DECL @@ -1149,20 +1137,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/Synch_Invocation.cpp b/TAO/tao/Synch_Invocation.cpp index d1b4d7cc30d..59ed7c08ea8 100644 --- a/TAO/tao/Synch_Invocation.cpp +++ b/TAO/tao/Synch_Invocation.cpp @@ -70,13 +70,14 @@ namespace TAO 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 (), @@ -131,7 +132,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; @@ -177,7 +178,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; @@ -186,8 +187,7 @@ namespace TAO // 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 - ); + s = this->check_reply_status (rd); // For some strategies one may want to release the transport // back to cache after receiving the reply. @@ -206,14 +206,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); @@ -222,11 +217,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; } @@ -650,7 +657,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; @@ -670,15 +677,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, @@ -690,7 +697,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, @@ -709,13 +716,10 @@ namespace TAO } #if TAO_HAS_INTERCEPTORS == 1 - s = - this->receive_other_interception (); -#endif /*TAO_HAS_INTERCEPTORS */ + s = this->receive_other_interception (); } catch ( ::CORBA::Exception& ex) { -#if TAO_HAS_INTERCEPTORS == 1 PortableInterceptor::ReplyStatus const status = this->handle_any_exception (&ex); @@ -724,11 +728,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