summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-22 01:25:58 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2000-11-22 01:25:58 +0000
commit64e67cdc14115cece0b44a7c3eefe0135ece50af (patch)
treeb3a0ee3f69ca4c99d07f9cc37621f9d0228eed8b
parent81d8638399ee5eed732e33a77ebf876e82277f67 (diff)
downloadATCD-64e67cdc14115cece0b44a7c3eefe0135ece50af.tar.gz
ChangeLogTag: Tue Nov 21 19:20:44 2000 Jeff Parsons <parsons@cs.wustl.edu>
-rw-r--r--TAO/tao/DynamicInterface/Server_Request.cpp22
1 files changed, 16 insertions, 6 deletions
diff --git a/TAO/tao/DynamicInterface/Server_Request.cpp b/TAO/tao/DynamicInterface/Server_Request.cpp
index b652cd2ed9f..f5f6f729156 100644
--- a/TAO/tao/DynamicInterface/Server_Request.cpp
+++ b/TAO/tao/DynamicInterface/Server_Request.cpp
@@ -81,6 +81,12 @@ void
CORBA_ServerRequest::arguments (CORBA::NVList_ptr &list,
CORBA::Environment &ACE_TRY_ENV)
{
+ // arguments() must be called before either of these.
+ if (this->params_ != 0 || this->exception_ != 0)
+ {
+ ACE_THROW (CORBA::BAD_INV_ORDER (7, CORBA::COMPLETED_NO));
+ }
+
// Save params for later use when marshaling the reply.
this->params_ = list;
@@ -96,17 +102,17 @@ CORBA_ServerRequest::arguments (CORBA::NVList_ptr &list,
}
// Store the result value. There's either an exception, or a result,
-// but not both of them. Results (and exceptions) can be reported
+// but not both of them. Results can be reported (at most once)
// only after the parameter list has been provided (maybe empty).
void
CORBA_ServerRequest::set_result (const CORBA::Any &value,
CORBA::Environment &ACE_TRY_ENV)
{
// Setting a result when another result already exists or if an exception
- // exists is an error.
- if (this->retval_ != 0 || this->exception_ != 0)
+ // exists or before the args have been processeed is an error.
+ if (this->retval_ != 0 || this->exception_ != 0 || this->params_ == 0)
{
- ACE_THROW (CORBA::BAD_INV_ORDER ());
+ ACE_THROW (CORBA::BAD_INV_ORDER (8, CORBA::COMPLETED_NO));
}
ACE_NEW_THROW_EX (this->retval_,
@@ -127,9 +133,13 @@ void
CORBA_ServerRequest::set_exception (const CORBA::Any &value,
CORBA::Environment &ACE_TRY_ENV)
{
- if (this->retval_ != 0 || this->exception_ != 0)
+ CORBA::TypeCode_var tc = value.type ();
+
+ // set_exception() can be called at any time, but the Any arg MUST
+ // contain an exception.
+ if (tc->kind () != CORBA::tk_except)
{
- ACE_THROW (CORBA::BAD_INV_ORDER ());
+ ACE_THROW (CORBA::BAD_PARAM (21, CORBA::COMPLETED_MAYBE));
}
ACE_NEW_THROW_EX (this->exception_,