summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-03-28 02:39:07 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-03-28 02:39:07 +0000
commitfbced2985e7df13c22f96d342ce0a7f78a9d517c (patch)
tree123961ed717b675a10c82a5c7b4ad5ca41dbab5b
parente0fd18a809d11c4cb93b005b18d41143ea4bdc96 (diff)
downloadATCD-fbced2985e7df13c22f96d342ce0a7f78a9d517c.tar.gz
PortableServer::ForwardRequest >>= operator and
TAO_GIOP_Server_Request::set_exception changed to work with compiled marshaling.
-rw-r--r--TAO/tao/GIOP_Server_Request.cpp18
-rw-r--r--TAO/tao/POAC.cpp56
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 (