summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/Object_Adapter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/PortableServer/Object_Adapter.cpp')
-rw-r--r--TAO/tao/PortableServer/Object_Adapter.cpp58
1 files changed, 35 insertions, 23 deletions
diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp
index 9544ead8f48..c73983e4944 100644
--- a/TAO/tao/PortableServer/Object_Adapter.cpp
+++ b/TAO/tao/PortableServer/Object_Adapter.cpp
@@ -5,6 +5,7 @@
#include "POA.h"
#include "Strategized_Object_Proxy_Broker.h"
#include "ServerRequestInfo.h"
+#include "ServerInterceptorAdapter.h"
// -- ACE Include --
#include "ace/Auto_Ptr.h"
@@ -256,7 +257,6 @@ TAO_Object_Adapter::create_lock (int enable_locking,
int
TAO_Object_Adapter::dispatch_servant (const TAO_ObjectKey &key,
TAO_ServerRequest &req,
- void *context,
CORBA::Object_out forward_to,
CORBA::Environment &ACE_TRY_ENV)
{
@@ -285,7 +285,6 @@ TAO_Object_Adapter::dispatch_servant (const TAO_ObjectKey &key,
this->servant_dispatcher_->dispatch (servant_upcall,
req,
- context,
ACE_TRY_ENV);
ACE_CHECK_RETURN (result);
}
@@ -620,7 +619,6 @@ TAO_Object_Adapter::priority (void) const
int
TAO_Object_Adapter::dispatch (TAO_ObjectKey &key,
TAO_ServerRequest &request,
- void *context,
CORBA::Object_out forward_to,
CORBA::Environment &ACE_TRY_ENV)
ACE_THROW_SPEC ((CORBA::SystemException))
@@ -639,7 +637,7 @@ TAO_Object_Adapter::dispatch (TAO_ObjectKey &key,
this->orb_core_.server_request_interceptors (),
request.interceptor_count ());
- TAO_ServerRequestInfo ri (request);
+ TAO_ServerRequestInfo ri (request, 0);
ACE_TRY
{
@@ -648,11 +646,21 @@ TAO_Object_Adapter::dispatch (TAO_ObjectKey &key,
// servant.
sri_adapter.receive_request_service_contexts (&ri, ACE_TRY_ENV);
ACE_TRY_CHECK;
+
+ // If a PortableInterceptor::ForwardRequest exception was
+ // thrown, then set the forward_to object reference and return
+ // with the appropriate return status.
+ if (sri_adapter.location_forwarded ())
+ {
+ forward_to = ri.forward_reference (ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ return TAO_Adapter::DS_FORWARD;
+ }
#endif /* TAO_HAS_INTERCEPTORS == 1 */
result = this->dispatch_servant (key,
request,
- context,
forward_to,
ACE_TRY_ENV);
@@ -667,23 +675,25 @@ TAO_Object_Adapter::dispatch (TAO_ObjectKey &key,
ACE_TRY_CHECK;
}
}
- ACE_CATCH (PortableInterceptor::ForwardRequest, exc)
- {
- ri.forward_reference (exc);
- sri_adapter.send_other (&ri,
- ACE_TRY_ENV);
- ACE_TRY_CHECK;
-
- forward_to = CORBA::Object::_duplicate (exc.forward.in ());
- return TAO_Adapter::DS_FORWARD;
- }
ACE_CATCHANY
{
+ ri.exception (&ACE_ANY_EXCEPTION);
+
sri_adapter.send_exception (&ri,
ACE_TRY_ENV);
ACE_TRY_CHECK;
- ACE_RE_THROW;
- };
+
+ PortableInterceptor::ReplyStatus status =
+ ri.reply_status (ACE_TRY_ENV);
+ ACE_TRY_CHECK;
+
+ // Only re-throw the exception if it hasn't been transformed by
+ // the send_exception() interception point (e.g. to a
+ // LOCATION_FORWARD).
+ if (status == PortableInterceptor::SYSTEM_EXCEPTION
+ || status == PortableInterceptor::USER_EXCEPTION)
+ ACE_RE_THROW;
+ }
ACE_ENDTRY;
ACE_CHECK_RETURN (result);
#endif /* TAO_HAS_INTERCEPTORS == 1 */
@@ -743,11 +753,12 @@ TAO_Object_Adapter::create_collocated_object (TAO_Stub *stub,
// -Ossama
stub->servant_orb (this->orb_core_.orb ());
- CORBA::Object_ptr x;
+ CORBA_Object_ptr x;
ACE_NEW_RETURN (x,
- CORBA::Object (stub, 1,
+ CORBA::Object (stub,
+ 1,
servant),
- 0);
+ CORBA::Object::_nil ());
// Here we set the strategized Proxy Broker.
x->_proxy_broker (the_tao_strategized_object_proxy_broker ());
@@ -1068,7 +1079,8 @@ TAO_Object_Adapter::Servant_Upcall::Servant_Upcall (TAO_ORB_Core *oc)
poa_ (0),
servant_ (0),
state_ (INITIAL_STAGE),
- id_ (),
+ system_id_ (),
+ user_id_ (0),
current_context_ (),
#if (TAO_HAS_MINIMUM_POA == 0)
cookie_ (0),
@@ -1108,7 +1120,7 @@ TAO_Object_Adapter::Servant_Upcall::prepare_for_upcall (const TAO_ObjectKey &key
// Locate the POA.
this->object_adapter_->locate_poa (key,
- this->id_,
+ this->system_id_,
this->poa_,
ACE_TRY_ENV);
ACE_CHECK_RETURN (TAO_Adapter::DS_FAILED);
@@ -1134,7 +1146,7 @@ TAO_Object_Adapter::Servant_Upcall::prepare_for_upcall (const TAO_ObjectKey &key
// Lookup the servant.
this->servant_ = this->poa_->locate_servant_i (operation,
- this->id_,
+ this->system_id_,
*this,
this->current_context_,
ACE_TRY_ENV);