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.cpp94
1 files changed, 42 insertions, 52 deletions
diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp
index 49c557070c8..6ad3cc7ad62 100644
--- a/TAO/tao/PortableServer/Object_Adapter.cpp
+++ b/TAO/tao/PortableServer/Object_Adapter.cpp
@@ -1,22 +1,20 @@
// $Id$
// -- PortableServer Include --
-#include "tao/PortableServer/Object_Adapter.h"
-#include "tao/PortableServer/Non_Servant_Upcall.h"
-#include "tao/PortableServer/Servant_Upcall.h"
-#include "tao/PortableServer/Root_POA.h"
-#include "tao/PortableServer/Regular_POA.h"
-#include "tao/PortableServer/Creation_Time.h"
-#include "tao/PortableServer/POA_Guard.h"
-#include "tao/PortableServer/Default_Servant_Dispatcher.h"
-#include "tao/PortableServer/Collocated_Object_Proxy_Broker.h"
-#include "tao/PortableServer/POAManager.h"
-#include "tao/PortableServer/Servant_Base.h"
+#include "Object_Adapter.h"
+#include "Non_Servant_Upcall.h"
+#include "Servant_Upcall.h"
+#include "Root_POA.h"
+#include "Regular_POA.h"
+#include "Creation_Time.h"
+#include "POA_Guard.h"
+#include "Default_Servant_Dispatcher.h"
+#include "Collocated_Object_Proxy_Broker.h"
+#include "POAManager.h"
+#include "Servant_Base.h"
// -- ACE Include --
#include "ace/Auto_Ptr.h"
-#include "ace/Log_Msg.h"
-#include "ace/OS_NS_string.h"
// -- TAO Include --
#include "tao/PortableInterceptorC.h"
@@ -36,16 +34,18 @@
#include "tao/ServerRequestInterceptor_Adapter.h"
#if !defined (__ACE_INLINE__)
-# include "tao/PortableServer/Object_Adapter.i"
+# include "Object_Adapter.i"
#endif /* __ACE_INLINE__ */
-#include "tao/PortableServer/ThreadPolicy.h"
-#include "tao/PortableServer/LifespanPolicy.h"
-#include "tao/PortableServer/IdAssignmentPolicy.h"
-#include "tao/PortableServer/IdUniquenessPolicy.h"
-#include "tao/PortableServer/ImplicitActivationPolicy.h"
-#include "tao/PortableServer/RequestProcessingPolicy.h"
-#include "tao/PortableServer/ServantRetentionPolicy.h"
+#include "ace/OS_NS_string.h"
+
+#include "ThreadPolicy.h"
+#include "LifespanPolicy.h"
+#include "IdAssignmentPolicy.h"
+#include "IdUniquenessPolicy.h"
+#include "ImplicitActivationPolicy.h"
+#include "RequestProcessingPolicy.h"
+#include "ServantRetentionPolicy.h"
ACE_RCSID (PortableServer,
Object_Adapter,
@@ -99,8 +99,6 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_Object_Adapter_Timeprobe_Description,
#endif /* ACE_ENABLE_TIMEPROBES */
-TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-
/* static */
CORBA::ULong TAO_Object_Adapter::transient_poa_name_size_ = 0;
@@ -166,7 +164,7 @@ TAO_Object_Adapter::TAO_Object_Adapter (const TAO_Server_Strategy_Factory::Activ
new_hint_strategy->object_adapter (this);
- persistent_poa_name_map *ppnm = 0;
+ persistent_poa_name_map *ppnm;
switch (creation_parameters.poa_lookup_strategy_for_persistent_id_policy_)
{
case TAO_LINEAR:
@@ -296,7 +294,7 @@ TAO_Object_Adapter::create_lock (int enable_locking,
#if defined (ACE_HAS_THREADS)
if (enable_locking)
{
- ACE_Lock *the_lock = 0;
+ ACE_Lock *the_lock;
ACE_NEW_RETURN (the_lock,
ACE_Lock_Adapter<TAO_SYNCH_MUTEX> (thread_lock),
0);
@@ -307,7 +305,7 @@ TAO_Object_Adapter::create_lock (int enable_locking,
ACE_UNUSED_ARG (thread_lock);
#endif /* ACE_HAS_THREADS */
- ACE_Lock *the_lock = 0;
+ ACE_Lock *the_lock;
ACE_NEW_RETURN (the_lock,
ACE_Lock_Adapter<ACE_SYNCH_NULL_MUTEX> (),
0);
@@ -357,7 +355,9 @@ TAO_Object_Adapter::dispatch_servant (const TAO::ObjectKey &key,
{
ACE_FUNCTION_TIMEPROBE (TAO_SERVANT_DISPATCH_START);
- do_dispatch (req, servant_upcall ACE_ENV_ARG_PARAMETER);
+ servant_upcall.servant ()->_dispatch (req,
+ &servant_upcall
+ ACE_ENV_ARG_PARAMETER);
ACE_CHECK_RETURN (result);
}
@@ -741,7 +741,7 @@ TAO_Object_Adapter::dispatch (TAO::ObjectKey &key,
{
#if TAO_HAS_EXTENDED_FT_INTERCEPTORS == 1
CORBA::OctetSeq_var ocs;
- sri_adapter->tao_ft_interception_point (request,
+ sri_adapter.tao_ft_interception_point (request,
0, // args
0, // nargs
0, // servant_upcall
@@ -883,8 +883,7 @@ TAO_Object_Adapter::create_collocated_object (TAO_Stub *stub,
stub->servant_orb (this->orb_core_.orb ());
// It is ok to create a collocated object even when <sb> is
- // zero. This constructor will set the stub collocated indicator and
- // the strategized proxy broker if required.
+ // zero.
CORBA::Object_ptr x;
ACE_NEW_RETURN (x,
CORBA::Object (stub,
@@ -892,16 +891,20 @@ TAO_Object_Adapter::create_collocated_object (TAO_Stub *stub,
sb),
CORBA::Object::_nil ());
+ // Here we set the strategized Proxy Broker.
+ x->_proxy_broker (the_tao_collocated_object_proxy_broker ());
+
// Success.
return x;
}
CORBA::Long
-TAO_Object_Adapter::initialize_collocated_object (TAO_Stub *stub)
+TAO_Object_Adapter::initialize_collocated_object (TAO_Stub *stub,
+ CORBA::Object_ptr obj)
{
- // If we have been forwarded: use the forwarded profiles
- const TAO_MProfile &mp = stub->forward_profiles () ? *(stub->forward_profiles ())
- : stub->base_profiles ();
+ // @@ What about forwarding. With this approach we are never
+ // forwarded when we use collocation!
+ const TAO_MProfile &mp = stub->base_profiles ();
TAO_ServantBase *sb = this->get_collocated_servant (mp);
@@ -911,14 +914,13 @@ TAO_Object_Adapter::initialize_collocated_object (TAO_Stub *stub)
// It is ok to set the object as a collocated object even when
// <sb> is zero.
- stub->collocated_servant (sb);
+ obj->set_collocated_servant (sb);
- // Mark the stub as collocated. This will set the strategized object
- // proxy broker if required.
- stub->is_collocated (true);
+ // Here we set the strategized Proxy Broker.
+ obj->_proxy_broker (the_tao_collocated_object_proxy_broker ());
- // Return 0 (success) iff we found a servant.
- return ! sb;
+ // Success.
+ return 0;
}
TAO_ServantBase *
@@ -1240,15 +1242,3 @@ TAO_Object_Adapter::servant_dispatcher (TAO_Servant_Dispatcher *dispatcher)
this->servant_dispatcher_ = dispatcher;
}
-void
-TAO_Object_Adapter::do_dispatch (TAO_ServerRequest& req,
- TAO::Portable_Server::Servant_Upcall& upcall
- ACE_ENV_ARG_DECL)
-{
- upcall.servant ()->_dispatch(req,
- &upcall
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK;
-}
-
-TAO_END_VERSIONED_NAMESPACE_DECL