From fbced2985e7df13c22f96d342ce0a7f78a9d517c Mon Sep 17 00:00:00 2001 From: parsons Date: Tue, 28 Mar 2000 02:39:07 +0000 Subject: PortableServer::ForwardRequest >>= operator and TAO_GIOP_Server_Request::set_exception changed to work with compiled marshaling. --- TAO/tao/GIOP_Server_Request.cpp | 18 +++---------- TAO/tao/POAC.cpp | 56 ++++++++--------------------------------- 2 files changed, 14 insertions(+), 60 deletions(-) diff --git a/TAO/tao/GIOP_Server_Request.cpp b/TAO/tao/GIOP_Server_Request.cpp index 15dcba723f0..600edbdb8d6 100644 --- a/TAO/tao/GIOP_Server_Request.cpp +++ b/TAO/tao/GIOP_Server_Request.cpp @@ -192,23 +192,13 @@ TAO_GIOP_ServerRequest::set_exception (const CORBA::Any &value, #if !defined (TAO_HAS_MINIMUM_CORBA) - // Try to narrow to ForwardRequest - PortableServer::ForwardRequest *forward_request = - (PortableServer::ForwardRequest *)0; + const PortableServer::ForwardRequest *forward_request = 0; - if (value.value ()) - { - forward_request = - PortableServer::ForwardRequest::_narrow ( - (CORBA::Exception *) value.value () - ); - } - - // If narrowing of exception succeeded - if (forward_request != 0) + // If extraction of exception succeeded + if ((value >>= forward_request) != 0) { this->forward_location_ = forward_request->forward_reference; - this->exception_type_ = TAO_GIOP_USER_EXCEPTION; + this->exception_type_ = TAO_GIOP_LOCATION_FORWARD; } // Normal exception else diff --git a/TAO/tao/POAC.cpp b/TAO/tao/POAC.cpp index 8c5bf6015da..635ddee7d34 100644 --- a/TAO/tao/POAC.cpp +++ b/TAO/tao/POAC.cpp @@ -178,52 +178,10 @@ void operator<<= (CORBA::Any &_tao_any, PortableServer::ForwardRequest *_tao_ele CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, PortableServer::ForwardRequest *&_tao_elem) { - ACE_TRY_NEW_ENV - { - CORBA::TypeCode_var type = _tao_any.type (); - if (!type->equivalent (PortableServer::_tc_ForwardRequest, ACE_TRY_ENV)) // not equal - { - _tao_elem = 0; - return 0; - } - ACE_TRY_CHECK; - if (_tao_any.any_owns_data ()) - { - _tao_elem = (PortableServer::ForwardRequest *)_tao_any.value (); - return 1; - } - else - { - ACE_NEW_RETURN (_tao_elem, PortableServer::ForwardRequest, 0); - TAO_InputCDR stream ( - _tao_any._tao_get_cdr (), - _tao_any._tao_byte_order () - ); - if (stream >> *_tao_elem) - { - ((CORBA::Any *)&_tao_any)->_tao_replace ( - PortableServer::_tc_ForwardRequest, - 1, - ACE_reinterpret_cast (void *, _tao_elem), - PortableServer::ForwardRequest::_tao_any_destructor - ); - return 1; - } - else - { - delete _tao_elem; - _tao_elem = 0; - } - } - } - ACE_CATCHANY - { - delete _tao_elem; - _tao_elem = 0; - return 0; - } - ACE_ENDTRY; - return 0; + return _tao_any >>= ACE_const_cast( + const PortableServer::ForwardRequest*&, + _tao_elem + ); } CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const PortableServer::ForwardRequest *&_tao_elem) @@ -249,6 +207,12 @@ CORBA::Boolean operator>>= (const CORBA::Any &_tao_any, const PortableServer::Fo _tao_any._tao_get_cdr (), _tao_any._tao_byte_order () ); + CORBA::String_var interface_repository_id; + if (!(stream >> interface_repository_id.out ())) + return 0; + if (ACE_OS::strcmp (interface_repository_id.in (), + "IDL:omg.org/PortableServer/ForwardRequest:1.0")) + return 0; if (stream >> *(PortableServer::ForwardRequest *)_tao_elem) { ((CORBA::Any *)&_tao_any)->_tao_replace ( -- cgit v1.2.1