diff options
Diffstat (limited to 'TAO/tao/GIOP_Server_Request.cpp')
-rw-r--r-- | TAO/tao/GIOP_Server_Request.cpp | 74 |
1 files changed, 34 insertions, 40 deletions
diff --git a/TAO/tao/GIOP_Server_Request.cpp b/TAO/tao/GIOP_Server_Request.cpp index 4aec0252627..4a2a977d551 100644 --- a/TAO/tao/GIOP_Server_Request.cpp +++ b/TAO/tao/GIOP_Server_Request.cpp @@ -276,16 +276,17 @@ TAO_GIOP_ServerRequest::oa (void) void TAO_GIOP_ServerRequest::arguments (CORBA::NVList_ptr &list, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Environment &env) { + env.clear (); + // Save params for later use when marshaling the reply. this->params_ = list; // Then unmarshal each "in" and "inout" parameter. for (u_int i = 0; i < list->count (); i++) { - CORBA::NamedValue_ptr nv = list->item (i, ACE_TRY_ENV); - ACE_CHECK; + CORBA::NamedValue_ptr nv = list->item (i, env); // check if it is an in or inout parameter if (ACE_BIT_DISABLED (nv->flags (), CORBA::ARG_IN | CORBA::ARG_INOUT)) @@ -303,8 +304,7 @@ TAO_GIOP_ServerRequest::arguments (CORBA::NVList_ptr &list, // Skip over the next aregument. CORBA::TypeCode::traverse_status status = - this->incoming_->skip (tc.in (), ACE_TRY_ENV); - ACE_CHECK; + this->incoming_->skip (tc.in (), env); if (status != CORBA::TypeCode::TRAVERSE_CONTINUE) { @@ -335,8 +335,7 @@ TAO_GIOP_ServerRequest::arguments (CORBA::NVList_ptr &list, // Stick it into the Any. It gets duplicated there. any->_tao_replace (tc.in (), cdr, - ACE_TRY_ENV); - ACE_CHECK; + env); // Now we can release the original. ACE_Message_Block::release (cdr); @@ -351,7 +350,7 @@ TAO_GIOP_ServerRequest::arguments (CORBA::NVList_ptr &list, ACE_ERROR ((LM_ERROR, "TAO_GIOP_ServerRequest::arguments - " "%d bytes left in buffer\n", incoming_->length ())); - ACE_THROW (CORBA::BAD_PARAM ()); + env.exception (new CORBA::BAD_PARAM ()); } } @@ -361,24 +360,28 @@ TAO_GIOP_ServerRequest::arguments (CORBA::NVList_ptr &list, void TAO_GIOP_ServerRequest::set_result (const CORBA::Any &value, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Environment &env) { + env.clear (); + // setting a result when another result already exists or if an exception // exists is an error if (this->retval_ || this->exception_) - ACE_THROW (CORBA::BAD_INV_ORDER ()); - - this->retval_ = new CORBA::Any (value); + env.exception (new CORBA::BAD_INV_ORDER ()); + else + { + this->retval_ = new CORBA::Any (value); + } } // Store the exception value. void TAO_GIOP_ServerRequest::set_exception (const CORBA::Any &value, - CORBA::Environment &ACE_TRY_ENV) + CORBA::Environment &env) { if (this->retval_ || this->exception_) - ACE_THROW (CORBA::BAD_INV_ORDER ()); + env.exception (new CORBA::BAD_INV_ORDER ()); else { @@ -417,7 +420,7 @@ TAO_GIOP_ServerRequest::set_exception (const CORBA::Any &value, // parameters void -TAO_GIOP_ServerRequest::dsi_marshal (CORBA::Environment &ACE_TRY_ENV) +TAO_GIOP_ServerRequest::dsi_marshal (CORBA::Environment &env) { // NOTE: if "env" is set, it takes precedence over exceptions // reported using the mechanism of the ServerRequest. Only system @@ -440,17 +443,12 @@ TAO_GIOP_ServerRequest::dsi_marshal (CORBA::Environment &ACE_TRY_ENV) CORBA::TypeCode_var tc = this->retval_->type (); if (this->retval_->any_owns_data ()) { - (void) this->outgoing_->encode (tc.in (), - retval_->value (), - 0, ACE_TRY_ENV); - ACE_CHECK; + (void) this->outgoing_->encode (tc.in (), retval_->value (), 0, env); } else { TAO_InputCDR cdr (retval_->_tao_get_cdr ()); - (void) this->outgoing_->append (tc.in (), &cdr, - ACE_TRY_ENV); - ACE_CHECK; + (void) this->outgoing_->append (tc.in (), &cdr, env); } } @@ -461,9 +459,7 @@ TAO_GIOP_ServerRequest::dsi_marshal (CORBA::Environment &ACE_TRY_ENV) i < this->params_->count (); i++) { - CORBA::NamedValue_ptr nv = this->params_->item (i, ACE_TRY_ENV); - ACE_CHECK; - + CORBA::NamedValue_ptr nv = this->params_->item (i, env); if (!(nv->flags () & (CORBA::ARG_INOUT|CORBA::ARG_OUT))) continue; @@ -471,17 +467,12 @@ TAO_GIOP_ServerRequest::dsi_marshal (CORBA::Environment &ACE_TRY_ENV) CORBA::TypeCode_var tc = any->type (); if (any->any_owns_data ()) { - (void) this->outgoing_->encode (tc.in (), - any->value (), - 0, ACE_TRY_ENV); - ACE_CHECK; + (void) this->outgoing_->encode (tc.in (), any->value (), 0, env); } else { TAO_InputCDR cdr (any->_tao_get_cdr ()); - (void) this->outgoing_->append (tc.in (), - &cdr, ACE_TRY_ENV); - ACE_CHECK; + (void) this->outgoing_->append (tc.in (), &cdr, env); } } } @@ -492,7 +483,7 @@ TAO_GIOP_ServerRequest::dsi_marshal (CORBA::Environment &ACE_TRY_ENV) // Extension void -TAO_GIOP_ServerRequest::demarshal (CORBA::Environment &ACE_TRY_ENV, +TAO_GIOP_ServerRequest::demarshal (CORBA::Environment &orb_env, // ORB related exception reporting const TAO_Call_Data_Skel *info, // call description @@ -513,8 +504,13 @@ TAO_GIOP_ServerRequest::demarshal (CORBA::Environment &ACE_TRY_ENV, || (pdp->mode == CORBA::ARG_INOUT)) { // Then just unmarshal the value. - (void) incoming_->decode (pdp->tc, ptr, 0, ACE_TRY_ENV); - ACE_CHECK; + (void) incoming_->decode (pdp->tc, ptr, 0, orb_env); + } + + if (orb_env.exception ()) + { + orb_env.print_exception ("TAO_GIOP_ServerRequest::demarshal - parameter decode failed"); + return; } } va_end (param_vector); @@ -552,7 +548,7 @@ TAO_GIOP_ServerRequest::marshal (CORBA::Environment &ACE_TRY_ENV, // The Any does not own the because ultimately it will be owned // by the Server_Request via the call to "set_exception" CORBA::Any any (skel_env.exception ()->_type (), exception); - this->set_exception (any, ACE_TRY_ENV); + this->set_exception (any, orb_env); } #endif @@ -590,8 +586,7 @@ TAO_GIOP_ServerRequest::marshal (CORBA::Environment &ACE_TRY_ENV, if (result != CORBA::tk_void) { // Then just marshal the value. - (void) this->outgoing_->encode (pdp->tc, ptr, 0, - ACE_TRY_ENV); + (void) this->outgoing_->encode (pdp->tc, ptr, 0, ACE_TRY_ENV); ACE_TRY_CHECK; } } @@ -608,10 +603,9 @@ TAO_GIOP_ServerRequest::marshal (CORBA::Environment &ACE_TRY_ENV, { ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_GIOP_ServerRequest::marshal - parameter encode failed"); - ACE_RETHROW; + return; } ACE_ENDTRY; - ACE_CHECK; va_end (param_vector); } |