summaryrefslogtreecommitdiff
path: root/TAO/tao
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao')
-rw-r--r--TAO/tao/Abstract_Servant_Base.h13
-rw-r--r--TAO/tao/AnyTypeCode/Any_Impl.cpp3
-rw-r--r--TAO/tao/CDR.cpp3
-rw-r--r--TAO/tao/CORBANAME_Parser.cpp2
-rw-r--r--TAO/tao/Collocated_Invocation.cpp8
-rw-r--r--TAO/tao/Collocated_Invocation.h3
-rw-r--r--TAO/tao/Collocation_Proxy_Broker.cpp12
-rw-r--r--TAO/tao/Collocation_Proxy_Broker.h73
-rw-r--r--TAO/tao/Collocation_Strategy.h25
-rw-r--r--TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp8
-rw-r--r--TAO/tao/DynamicInterface/DII_Invocation_Adapter.h2
-rw-r--r--TAO/tao/IIOP_Connector.cpp42
-rw-r--r--TAO/tao/Invocation_Adapter.cpp140
-rw-r--r--TAO/tao/Invocation_Adapter.h22
-rw-r--r--TAO/tao/Invocation_Adapter.inl4
-rw-r--r--TAO/tao/LocalObject.cpp48
-rw-r--r--TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp4
-rw-r--r--TAO/tao/Messaging/Asynch_Invocation_Adapter.h2
-rw-r--r--TAO/tao/ORB_Core.cpp50
-rw-r--r--TAO/tao/ORB_Core.h22
-rw-r--r--TAO/tao/Object.cpp71
-rw-r--r--TAO/tao/Object.h12
-rw-r--r--TAO/tao/Object_T.cpp79
-rw-r--r--TAO/tao/Object_T.h15
-rw-r--r--TAO/tao/PolicyC.cpp65
-rw-r--r--TAO/tao/PolicyC.h19
-rw-r--r--TAO/tao/PolicyC.inl13
-rw-r--r--TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.cpp28
-rw-r--r--TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp4
-rw-r--r--TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h1
-rw-r--r--TAO/tao/PortableServer/Object_Adapter.cpp2
-rw-r--r--TAO/tao/PortableServer/Operation_Table.h7
-rw-r--r--TAO/tao/PortableServer/PolicyS.cpp123
-rw-r--r--TAO/tao/PortableServer/PolicyS.h61
-rw-r--r--TAO/tao/PortableServer/Servant_Base.cpp23
-rw-r--r--TAO/tao/PortableServer/Servant_Base.h9
-rw-r--r--TAO/tao/PortableServer/Servant_Upcall.cpp2
-rw-r--r--TAO/tao/Remote_Object_Proxy_Broker.cpp8
-rw-r--r--TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.cpp4
-rw-r--r--TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.h2
-rw-r--r--TAO/tao/Valuetype/AbstractBase_T.cpp73
-rw-r--r--TAO/tao/Valuetype/AbstractBase_T.h10
-rw-r--r--TAO/tao/orbconf.h4
-rw-r--r--TAO/tao/tao.mpc2
44 files changed, 481 insertions, 642 deletions
diff --git a/TAO/tao/Abstract_Servant_Base.h b/TAO/tao/Abstract_Servant_Base.h
index a41fe1bec54..fcd601e961b 100644
--- a/TAO/tao/Abstract_Servant_Base.h
+++ b/TAO/tao/Abstract_Servant_Base.h
@@ -61,9 +61,7 @@ typedef void (*TAO_Skeleton)(
typedef void (*TAO_Collocated_Skeleton)(
TAO_Abstract_ServantBase *,
- TAO::Argument **,
- int
- );
+ TAO::Argument **);
class TAO_Export TAO_Abstract_ServantBase
{
@@ -125,6 +123,15 @@ public:
TAO::Collocation_Strategy s,
const size_t length = 0) = 0;
+ virtual void _collocated_dispatch (::CORBA::Object_ptr obj,
+ ::CORBA::Object_out forward_obj,
+ bool &is_forwarded,
+ TAO::Argument ** args,
+ int num_args,
+ const char * op,
+ size_t op_len,
+ TAO::Collocation_Strategy strategy) = 0;
+
protected:
/// Default constructor, only derived classes can be created.
diff --git a/TAO/tao/AnyTypeCode/Any_Impl.cpp b/TAO/tao/AnyTypeCode/Any_Impl.cpp
index bc5273c536b..6bf1047c835 100644
--- a/TAO/tao/AnyTypeCode/Any_Impl.cpp
+++ b/TAO/tao/AnyTypeCode/Any_Impl.cpp
@@ -103,8 +103,7 @@ TAO::Any_Impl::_remove_ref (void)
}
void
-TAO::Any_Impl::_tao_decode (TAO_InputCDR &
- )
+TAO::Any_Impl::_tao_decode (TAO_InputCDR &)
{
throw ::CORBA::NO_IMPLEMENT ();
}
diff --git a/TAO/tao/CDR.cpp b/TAO/tao/CDR.cpp
index dc9ccc4cb57..668d4b7b557 100644
--- a/TAO/tao/CDR.cpp
+++ b/TAO/tao/CDR.cpp
@@ -219,8 +219,7 @@ TAO_OutputCDR::throw_skel_exception (int error_num )
ACE_NOTREACHED (break);
case EACCES : // wchar but no codeset
- throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 23,
- CORBA::COMPLETED_YES);
+ throw ::CORBA::BAD_PARAM (CORBA::OMGVMCID | 23, CORBA::COMPLETED_YES);
ACE_NOTREACHED (break);
#if (ERANGE != EINVAL)
diff --git a/TAO/tao/CORBANAME_Parser.cpp b/TAO/tao/CORBANAME_Parser.cpp
index f9a7fe1a5c8..0f7adf72a1a 100644
--- a/TAO/tao/CORBANAME_Parser.cpp
+++ b/TAO/tao/CORBANAME_Parser.cpp
@@ -51,7 +51,7 @@ parse_string_dynamic_request_helper (CORBA::Object_ptr naming_context,
2,
"resolve_str",
11,
- 0);
+ TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
tao_call.invoke (0, 0);
diff --git a/TAO/tao/Collocated_Invocation.cpp b/TAO/tao/Collocated_Invocation.cpp
index 657dc7e38bc..0b338b2d60a 100644
--- a/TAO/tao/Collocated_Invocation.cpp
+++ b/TAO/tao/Collocated_Invocation.cpp
@@ -1,7 +1,6 @@
// $Id$
#include "tao/Collocated_Invocation.h"
-#include "tao/Collocation_Proxy_Broker.h"
#include "tao/ORB_Core.h"
#include "tao/Request_Dispatcher.h"
#include "tao/TAO_Server_Request.h"
@@ -9,6 +8,7 @@
#include "tao/operation_details.h"
#include "tao/PortableInterceptor.h"
#include "tao/SystemException.h"
+#include "tao/Abstract_Servant_Base.h"
#if TAO_HAS_INTERCEPTORS == 1
# include "tao/PortableInterceptorC.h"
@@ -33,8 +33,7 @@ namespace TAO
}
Invocation_Status
- Collocated_Invocation::invoke (Collocation_Proxy_Broker *cpb,
- Collocation_Strategy strat)
+ Collocated_Invocation::invoke (Collocation_Strategy strat)
{
Invocation_Status s = TAO_INVOKE_FAILURE;
@@ -82,7 +81,8 @@ namespace TAO
{
bool is_forwarded = false;
- cpb->dispatch (this->effective_target (),
+ this->effective_target ()->_servant()->_collocated_dispatch (
+ this->effective_target (),
this->forwarded_to_.out (),
is_forwarded,
this->details_.args (),
diff --git a/TAO/tao/Collocated_Invocation.h b/TAO/tao/Collocated_Invocation.h
index cdca74f975b..d86cd1bca01 100644
--- a/TAO/tao/Collocated_Invocation.h
+++ b/TAO/tao/Collocated_Invocation.h
@@ -83,8 +83,7 @@ namespace TAO
* servant.
*
*/
- Invocation_Status invoke (Collocation_Proxy_Broker *cpb,
- Collocation_Strategy strat);
+ Invocation_Status invoke (Collocation_Strategy strat);
private:
diff --git a/TAO/tao/Collocation_Proxy_Broker.cpp b/TAO/tao/Collocation_Proxy_Broker.cpp
deleted file mode 100644
index ea46473b3ee..00000000000
--- a/TAO/tao/Collocation_Proxy_Broker.cpp
+++ /dev/null
@@ -1,12 +0,0 @@
-// -*- C++ -*-
-// $Id$
-
-#include "tao/Collocation_Proxy_Broker.h"
-
-TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-
-TAO::Collocation_Proxy_Broker::~Collocation_Proxy_Broker (void)
-{
-}
-
-TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Collocation_Proxy_Broker.h b/TAO/tao/Collocation_Proxy_Broker.h
deleted file mode 100644
index efc8465db89..00000000000
--- a/TAO/tao/Collocation_Proxy_Broker.h
+++ /dev/null
@@ -1,73 +0,0 @@
-// -*- C++ -*-
-
-//=============================================================================
-/**
- * @file Collocation_Proxy_Broker.h
- *
- * $Id$
- *
- *
- * @author Balachandran Natarajan <bala@dre.vanderbilt.edu>
- */
-//=============================================================================
-
-#ifndef TAO_COLLOCATION_PROXY_BROKER_H
-#define TAO_COLLOCATION_PROXY_BROKER_H
-
-#include /**/ "ace/pre.h"
-
-#include /**/ "tao/TAO_Export.h"
-
-#if !defined (ACE_LACKS_PRAGMA_ONCE)
-# pragma once
-#endif /* ACE_LACKS_PRAGMA_ONCE */
-
-#include "tao/Collocation_Strategy.h"
-#include /**/ "tao/Versioned_Namespace.h"
-
-#include "ace/os_include/os_stddef.h"
-
-TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-
-template<typename T> class TAO_Pseudo_Var_T;
-template<typename T> class TAO_Pseudo_Out_T;
-
-namespace CORBA
-{
- class Object;
- typedef Object *Object_ptr;
- typedef TAO_Pseudo_Var_T<Object> Object_var;
- typedef TAO_Pseudo_Out_T<Object> Object_out;
-}
-
-namespace TAO
-{
- class Argument;
-
- /**
- * @class Collocation_Proxy_Broker
- */
- class TAO_Export Collocation_Proxy_Broker
- {
-
- public:
- virtual ~Collocation_Proxy_Broker (void);
-
- virtual Collocation_Strategy get_strategy (CORBA::Object_ptr obj) = 0;
-
- virtual void dispatch (CORBA::Object_ptr obj,
- CORBA::Object_out forward_obj,
- bool & is_forwarded,
- Argument ** args,
- int num_args,
- const char * op,
- size_t op_len,
- Collocation_Strategy strategy) = 0;
- };
-
-TAO_END_VERSIONED_NAMESPACE_DECL
-}
-
-#include /**/ "ace/post.h"
-
-#endif /*TAO_COLLOCATION_PROXY_BROKER_H */
diff --git a/TAO/tao/Collocation_Strategy.h b/TAO/tao/Collocation_Strategy.h
index 2a9e8c0aeaa..00e4050b5b5 100644
--- a/TAO/tao/Collocation_Strategy.h
+++ b/TAO/tao/Collocation_Strategy.h
@@ -19,7 +19,7 @@
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
-/// Define symbolic names for the ORB collocation strategies.
+/// Define symbolic names for the ORB collocation strategies as used at runtime.
namespace TAO
{
enum Collocation_Strategy
@@ -39,6 +39,29 @@ namespace TAO
/// strategies.
TAO_CS_LAST
};
+
+ inline const char * translate_collocation_strategy (Collocation_Strategy cs)
+ {
+#define TAO_CS(X) case X: return #X
+ switch (cs)
+ {
+ TAO_CS (TAO_CS_REMOTE_STRATEGY);
+ TAO_CS (TAO_CS_THRU_POA_STRATEGY);
+ TAO_CS (TAO_CS_DIRECT_STRATEGY);
+ TAO_CS (TAO_CS_LAST);
+ }
+ return "***Unknown enum value, update TAO::translate_collocation_strategy()";
+#undef TAO_CS
+ }
+
+ /// No collocation possible
+ int const TAO_CO_NONE = 0x00;
+
+ /// Through POA collocation is possible
+ int const TAO_CO_THRU_POA_STRATEGY = 0x01;
+
+ /// Direct collocation is possible
+ int const TAO_CO_DIRECT_STRATEGY = 0x02;
}
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp
index 8410e8eb9ea..e302ccaff0f 100644
--- a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp
+++ b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp
@@ -36,7 +36,7 @@ namespace TAO
arg_number,
operation,
op_len,
- 0, // Collocation Proxy broker pointer
+ TAO_CO_THRU_POA_STRATEGY, // default through POA collocation is possible
TAO_TWOWAY_INVOCATION,
mode)
, exception_list_ (excp)
@@ -158,7 +158,7 @@ namespace TAO
int arg_number,
const char *operation,
size_t op_len,
- Collocation_Proxy_Broker *b,
+ int collocation_opportunity,
TAO_ORB_Core *oc,
CORBA::Request *req,
Invocation_Mode mode)
@@ -167,7 +167,7 @@ namespace TAO
arg_number,
operation,
op_len,
- b,
+ collocation_opportunity,
TAO_TWOWAY_INVOCATION,
mode)
, request_ (req)
@@ -305,7 +305,7 @@ namespace TAO
arg_count,
operation,
op_len,
- 0,
+ TAO_CO_THRU_POA_STRATEGY,
TAO_ONEWAY_INVOCATION,
mode)
{
diff --git a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.h b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.h
index f058c2b97c0..80b2c6f9274 100644
--- a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.h
+++ b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.h
@@ -141,7 +141,7 @@ namespace TAO
int arg_number,
const char *operation,
size_t op_len,
- Collocation_Proxy_Broker *b,
+ int collocation_opportunity,
TAO_ORB_Core *oc,
CORBA::Request *req,
TAO::Invocation_Mode mode = TAO_DII_DEFERRED_INVOCATION);
diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp
index 716376bb0d2..d28b2e87873 100644
--- a/TAO/tao/IIOP_Connector.cpp
+++ b/TAO/tao/IIOP_Connector.cpp
@@ -151,31 +151,31 @@ TAO_IIOP_Connector::set_validate_endpoint (TAO_Endpoint *endpoint)
if (iiop_endpoint == 0)
return -1;
- const ACE_INET_Addr &remote_address = iiop_endpoint->object_addr ();
+ const ACE_INET_Addr &remote_address = iiop_endpoint->object_addr ();
- // Verify that the remote ACE_INET_Addr was initialized properly.
- // Failure can occur if hostname lookup failed when initializing the
- // remote ACE_INET_Addr.
+ // Verify that the remote ACE_INET_Addr was initialized properly.
+ // Failure can occur if hostname lookup failed when initializing the
+ // remote ACE_INET_Addr.
#if defined (ACE_HAS_IPV6)
- if (remote_address.get_type () != AF_INET &&
- remote_address.get_type () != AF_INET6)
+ if (remote_address.get_type () != AF_INET &&
+ remote_address.get_type () != AF_INET6)
#else /* ACE_HAS_IPV6 */
- if (remote_address.get_type () != AF_INET)
+ if (remote_address.get_type () != AF_INET)
#endif /* !ACE_HAS_IPV6 */
- {
- if (TAO_debug_level > 0)
- {
- ACE_DEBUG ((LM_DEBUG,
- ACE_TEXT ("TAO (%P|%t) - IIOP connection failed.\n")
- ACE_TEXT (" This is most likely ")
- ACE_TEXT ("due to a hostname lookup ")
- ACE_TEXT ("failure.\n")));
- }
-
- return -1;
- }
-
- return 0;
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT ("TAO (%P|%t) - IIOP connection failed.\n")
+ ACE_TEXT (" This is most likely ")
+ ACE_TEXT ("due to a hostname lookup ")
+ ACE_TEXT ("failure.\n")));
+ }
+
+ return -1;
+ }
+
+ return 0;
}
TAO_Transport *
diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp
index 0359a3efb57..f85187b0172 100644
--- a/TAO/tao/Invocation_Adapter.cpp
+++ b/TAO/tao/Invocation_Adapter.cpp
@@ -11,10 +11,10 @@
#include "tao/Collocated_Invocation.h"
#include "tao/Transport.h"
#include "tao/Transport_Mux_Strategy.h"
-#include "tao/Collocation_Proxy_Broker.h"
#include "tao/GIOP_Utils.h"
#include "tao/TAOC.h"
#include "tao/SystemException.h"
+#include "tao/Collocation_Resolver.h"
#include "ace/Service_Config.h"
#if !defined (__ACE_INLINE__)
@@ -74,13 +74,19 @@ namespace TAO
// Default we go to remote
Collocation_Strategy strat = TAO_CS_REMOTE_STRATEGY;
- // If we have a collocated proxy broker we look if we maybe
+ // If we have the opportunity for collocation we maybe
// can use a collocated invocation. Similarly, if the
// target object reference contains a pointer to a servant,
// the object reference also refers to a collocated object.
- if (cpb_ != 0 || effective_target->_servant () != 0)
+ // get the ORBStrategy
+ strat = this->collocation_strategy (effective_target.in ());
+
+ if (TAO_debug_level > 2)
{
- strat = TAO_ORB_Core::collocation_strategy (effective_target.in ());
+ ACE_DEBUG ((LM_DEBUG,
+ ACE_TEXT("TAO (%P|%t) - Invocation_Adapter::invoke_i, ")
+ ACE_TEXT("making a %C invocation\n"),
+ TAO::translate_collocation_strategy(strat)));
}
if (strat == TAO_CS_REMOTE_STRATEGY || strat == TAO_CS_LAST)
@@ -104,7 +110,6 @@ namespace TAO
effective_target,
strat);
}
-
if (status == TAO_INVOKE_RESTART)
{
details.reset_request_service_info ();
@@ -135,11 +140,20 @@ namespace TAO
TAO_Stub * const stub = this->target_->_stubobj ();
if (stub == 0)
- throw ::CORBA::INTERNAL (
- CORBA::SystemException::_tao_minor_code (
- TAO::VMCID,
- EINVAL),
- CORBA::COMPLETED_NO);
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Invocation_Adapter::get_stub, ")
+ ACE_TEXT ("raising CORBA::INTERNAL because of nil ")
+ ACE_TEXT ("stub.\n")));
+ }
+ throw ::CORBA::INTERNAL (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO);
+ }
return stub;
}
@@ -150,12 +164,6 @@ namespace TAO
CORBA::Object_var &effective_target,
Collocation_Strategy strat)
{
- // To make a collocated call we must have a collocated proxy broker, the
- // invoke_i() will make sure that we only come here when we have one
- ACE_ASSERT (cpb_ != 0
- || (strat == TAO_CS_THRU_POA_STRATEGY
- && effective_target->_servant () != 0));
-
// Initial state
TAO::Invocation_Status status = TAO_INVOKE_START;
@@ -165,7 +173,7 @@ namespace TAO
details,
this->type_ == TAO_TWOWAY_INVOCATION);
- status = coll_inv.invoke (this->cpb_, strat);
+ status = coll_inv.invoke (strat);
if (status == TAO_INVOKE_RESTART &&
(coll_inv.reply_status () == GIOP::LOCATION_FORWARD ||
@@ -228,14 +236,12 @@ namespace TAO
bool const block_connect =
rflags != static_cast<CORBA::Octet> (Messaging::SYNC_NONE)
&& rflags != static_cast<CORBA::Octet> (TAO::SYNC_DELAYED_BUFFERING);
-
// Create the resolver which will pick (or create) for us a
// transport and a profile from the effective_target.
Profile_Transport_Resolver resolver (
effective_target.in (),
stub,
block_connect);
-
resolver.resolve (max_wait_time);
if (TAO_debug_level)
@@ -245,13 +251,11 @@ namespace TAO
ACE_TEXT ("TAO (%P|%t) - Invocation_Adapter::invoke_remote_i, ")
ACE_TEXT ("max wait time consumed during transport resolution\n")));
}
-
// Update the request id now that we have a transport
if (resolver.transport ())
{
details.request_id (resolver.transport ()->tms ()->request_id ());
}
-
switch (this->type_)
{
case TAO_ONEWAY_INVOCATION:
@@ -382,6 +386,100 @@ namespace TAO
errno),
CORBA::COMPLETED_NO);
}
+
+ TAO::Collocation_Strategy
+ Invocation_Adapter::collocation_strategy (CORBA::Object_ptr object)
+ {
+ TAO::Collocation_Strategy strategy = TAO::TAO_CS_REMOTE_STRATEGY;
+ TAO_Stub *stub = object->_stubobj ();
+ if (!CORBA::is_nil (stub->servant_orb_var ().in ()) &&
+ stub->servant_orb_var ()->orb_core () != 0)
+ {
+ TAO_ORB_Core *orb_core = stub->servant_orb_var ()->orb_core ();
+
+ if (orb_core->collocation_resolver ().is_collocated (object))
+ {
+ switch (orb_core->get_collocation_strategy ())
+ {
+ case TAO_ORB_Core::TAO_COLLOCATION_THRU_POA:
+ {
+ // check opportunity
+ if (ACE_BIT_ENABLED (this->collocation_opportunity_,
+ TAO::TAO_CO_THRU_POA_STRATEGY))
+ {
+ strategy = TAO::TAO_CS_THRU_POA_STRATEGY;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Invocation_Adapter::collocation_strategy, ")
+ ACE_TEXT ("request for through poa collocation ")
+ ACE_TEXT ("without needed collocation opportunity.\n")));
+ }
+ // collocation object, but no collocation_opportunity for Thru_poa
+ throw ::CORBA::INTERNAL (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO);
+ }
+ break;
+ }
+ case TAO_ORB_Core::TAO_COLLOCATION_DIRECT:
+ {
+ if (ACE_BIT_ENABLED (this->collocation_opportunity_,
+ TAO::TAO_CO_DIRECT_STRATEGY)
+ && (object->_servant () != 0))
+ {
+ strategy = TAO::TAO_CS_DIRECT_STRATEGY;
+ }
+ else
+ {
+ if (TAO_debug_level > 0)
+ {
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("Invocation_Adapter::collocation_strategy, ")
+ ACE_TEXT ("request for direct collocation ")
+ ACE_TEXT ("without needed collocation opportunity.\n")));
+ }
+ // collocation object, but no collocation_opportunity for Direct
+ // or servant() == 0
+ throw ::CORBA::INTERNAL (
+ CORBA::SystemException::_tao_minor_code (
+ TAO::VMCID,
+ EINVAL),
+ CORBA::COMPLETED_NO);
+ }
+ break;
+ }
+ case TAO_ORB_Core::TAO_COLLOCATION_BEST:
+ {
+ if (ACE_BIT_ENABLED (this->collocation_opportunity_,
+ TAO::TAO_CO_DIRECT_STRATEGY)
+ && (object->_servant () != 0))
+ {
+ strategy = TAO::TAO_CS_DIRECT_STRATEGY;
+ }
+ else if (ACE_BIT_ENABLED (this->collocation_opportunity_,
+ TAO::TAO_CO_THRU_POA_STRATEGY))
+ {
+ strategy = TAO::TAO_CS_THRU_POA_STRATEGY;
+ }
+ else
+ {
+ strategy = TAO::TAO_CS_REMOTE_STRATEGY;
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ return strategy;
+ }
+
} // End namespace TAO
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/Invocation_Adapter.h b/TAO/tao/Invocation_Adapter.h
index 958083c8945..f539c28de45 100644
--- a/TAO/tao/Invocation_Adapter.h
+++ b/TAO/tao/Invocation_Adapter.h
@@ -46,7 +46,6 @@ namespace TAO
{
class Argument;
struct Exception_Data;
- class Collocation_Proxy_Broker;
class Profile_Transport_Resolver;
/**
@@ -94,9 +93,8 @@ namespace TAO
* is an optimization which helps us to avoid calling strlen ()
* while creating a message format.
*
- * @param cpb The collocation proxy broker for the target if one
- * exists. This is useful especially to route the call to the
- * collocated target.
+ * @param collocation_opportunity Indicate which collocation optimizations
+ * should be possible
*
* @param type The operation type which could be a oneway or two
* way operation. This information is available in the IDL file.
@@ -109,7 +107,7 @@ namespace TAO
int arg_number,
const char *operation,
size_t op_len,
- Collocation_Proxy_Broker *cpb,
+ int collocation_opportunity,
TAO::Invocation_Type type = TAO_TWOWAY_INVOCATION,
TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION);
@@ -236,6 +234,16 @@ namespace TAO
Invocation_Adapter (Invocation_Adapter const &);
Invocation_Adapter & operator= (const Invocation_Adapter &);
+ /**
+ * This method returns the right collocation strategy, if any,
+ * to be used to perform a method invocation on the given object.
+ *
+ * @note
+ * No-Collocation is a special case of collocation.
+ */
+ TAO::Collocation_Strategy collocation_strategy (CORBA::Object_ptr object);
+ //@}
+
protected:
/// The target object on which this invocation is carried out.
CORBA::Object_ptr target_;
@@ -255,8 +263,8 @@ namespace TAO
/// String length of the operation name.
size_t const op_len_;
- /// Collocation proxy broker for this operation.
- Collocation_Proxy_Broker * const cpb_;
+ /// Collocation opportunity for this operation.
+ int const collocation_opportunity_;
/// The invocation type
Invocation_Type const type_;
diff --git a/TAO/tao/Invocation_Adapter.inl b/TAO/tao/Invocation_Adapter.inl
index 3ee1410310c..7acff3aa75a 100644
--- a/TAO/tao/Invocation_Adapter.inl
+++ b/TAO/tao/Invocation_Adapter.inl
@@ -13,7 +13,7 @@ namespace TAO
int arg_number,
const char *operation,
size_t op_len,
- Collocation_Proxy_Broker *p,
+ int collocation_opportunity,
Invocation_Type type,
Invocation_Mode mode)
: target_ (target)
@@ -21,7 +21,7 @@ namespace TAO
, number_args_ (arg_number)
, operation_ (operation)
, op_len_ (op_len)
- , cpb_ (p)
+ , collocation_opportunity_ (collocation_opportunity)
, type_ (type)
, mode_ (mode)
{
diff --git a/TAO/tao/LocalObject.cpp b/TAO/tao/LocalObject.cpp
index 9f12cff39d9..80600b7d718 100644
--- a/TAO/tao/LocalObject.cpp
+++ b/TAO/tao/LocalObject.cpp
@@ -77,6 +77,10 @@ CORBA::LocalObject::_non_existent (void)
char *
CORBA::LocalObject::_repository_id (void)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot get _repository_id from a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
}
@@ -89,6 +93,10 @@ CORBA::LocalObject::_create_request (CORBA::Context_ptr,
CORBA::Request_ptr &,
CORBA::Flags)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _create_request for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
}
@@ -102,24 +110,40 @@ CORBA::LocalObject::_create_request (CORBA::Context_ptr,
CORBA::Request_ptr &,
CORBA::Flags)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _create_request for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
}
CORBA::Request_ptr
CORBA::LocalObject::_request (const char *)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _request for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 4, CORBA::COMPLETED_NO);
}
CORBA::Object_ptr
CORBA::LocalObject::_get_component (void)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _get_component for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
}
CORBA::InterfaceDef_ptr
CORBA::LocalObject::_get_interface (void)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _get_interface for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
}
#endif
@@ -131,12 +155,20 @@ CORBA::LocalObject::_get_interface (void)
CORBA::Policy_ptr
CORBA::LocalObject::_get_policy (CORBA::PolicyType)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _get_policy for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
}
CORBA::Policy_ptr
CORBA::LocalObject::_get_cached_policy (TAO_Cached_Policy_Type)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _get_cached_policy for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT ();
}
@@ -144,18 +176,30 @@ CORBA::Object_ptr
CORBA::LocalObject::_set_policy_overrides (const CORBA::PolicyList &,
CORBA::SetOverrideType)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _set_policy_overrides for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
}
CORBA::PolicyList *
CORBA::LocalObject::_get_policy_overrides (const CORBA::PolicyTypeSeq &)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _get_policy_overrides for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
}
CORBA::Boolean
CORBA::LocalObject::_validate_connection (CORBA::PolicyList_out)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _validate_connection for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
}
@@ -164,6 +208,10 @@ CORBA::LocalObject::_validate_connection (CORBA::PolicyList_out)
CORBA::ORB_ptr
CORBA::LocalObject::_get_orb (void)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - Cannot call _get_orb for a LocalObject!\n")));
+
throw ::CORBA::NO_IMPLEMENT (CORBA::OMGVMCID | 8, CORBA::COMPLETED_NO);
}
diff --git a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp
index 65036e25725..e0b8a583be7 100644
--- a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp
+++ b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp
@@ -27,14 +27,14 @@ namespace TAO
int arg_number,
const char *operation,
size_t op_len,
- Collocation_Proxy_Broker *p,
+ int collocation_opportunity,
Invocation_Mode m)
: Invocation_Adapter (target,
args,
arg_number,
operation,
op_len,
- p,
+ collocation_opportunity,
TAO_TWOWAY_INVOCATION,
m)
, safe_rd_ ()
diff --git a/TAO/tao/Messaging/Asynch_Invocation_Adapter.h b/TAO/tao/Messaging/Asynch_Invocation_Adapter.h
index 4ac8cf80068..4c78afaedae 100644
--- a/TAO/tao/Messaging/Asynch_Invocation_Adapter.h
+++ b/TAO/tao/Messaging/Asynch_Invocation_Adapter.h
@@ -67,7 +67,7 @@ namespace TAO
int arg_number,
const char *operation,
size_t op_len,
- Collocation_Proxy_Broker *b,
+ int collocation_opportunity,
TAO::Invocation_Mode mode = TAO_ASYNCHRONOUS_CALLBACK_INVOCATION);
void invoke (Messaging::ReplyHandler_ptr reply_handler_ptr,
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index e29612762e7..ff5063de97a 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -217,7 +217,7 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid,
ft_send_extended_sc_ (false),
opt_for_collocation_ (true),
use_global_collocation_ (true),
- collocation_strategy_ (THRU_POA),
+ collocation_strategy_ (TAO_DEFAULT_COLLOCATION_STRATEGY),
#if (TAO_HAS_CORBA_MESSAGING == 1)
@@ -439,7 +439,6 @@ TAO_ORB_Core::init (int &argc, char *argv[] )
this->use_implrepo_ = ACE_OS::atoi (use_IMR_env_var_value) ;
}
-
while (arg_shifter.is_anything_left ())
{
const ACE_TCHAR *current_arg = 0;
@@ -613,9 +612,17 @@ TAO_ORB_Core::init (int &argc, char *argv[] )
// Specify which collocation policy we want to use.
const ACE_TCHAR *opt = current_arg;
if (ACE_OS::strcasecmp (opt, ACE_TEXT("thru_poa")) == 0)
- this->collocation_strategy_ = THRU_POA;
+ {
+ this->collocation_strategy_ = TAO_COLLOCATION_THRU_POA;
+ }
else if (ACE_OS::strcasecmp (opt, ACE_TEXT("direct")) == 0)
- this->collocation_strategy_ = DIRECT;
+ {
+ this->collocation_strategy_ = TAO_COLLOCATION_DIRECT;
+ }
+ else if (ACE_OS::strcasecmp (opt, ACE_TEXT("best")) == 0)
+ {
+ this->collocation_strategy_ = TAO_COLLOCATION_BEST;
+ }
arg_shifter.consume_arg ();
}
@@ -3611,39 +3618,4 @@ TAO_ORB_Core_instance (void)
return orb_table->first_orb ();
}
-
-TAO::Collocation_Strategy
-TAO_ORB_Core::collocation_strategy (CORBA::Object_ptr object)
-{
- TAO_Stub *stub = object->_stubobj ();
- if (!CORBA::is_nil (stub->servant_orb_var ().in ()) &&
- stub->servant_orb_var ()->orb_core () != 0)
- {
- TAO_ORB_Core *orb_core = stub->servant_orb_var ()->orb_core ();
-
- if (orb_core->collocation_resolver ().is_collocated (object))
- {
- switch (orb_core->get_collocation_strategy ())
- {
- case THRU_POA:
- return TAO::TAO_CS_THRU_POA_STRATEGY;
-
- case DIRECT:
- {
- /////////////////////////////////////////////////////////////
- // If the servant is null and you are collocated this means
- // that the POA policy NON-RETAIN is set, and with that policy
- // using the DIRECT collocation strategy is just insane.
- /////////////////////////////////////////////////////////////
- ACE_ASSERT (object->_servant () != 0);
- return TAO::TAO_CS_DIRECT_STRATEGY;
- }
- }
- }
- }
-
- // In this case the Object is a client.
- return TAO::TAO_CS_REMOTE_STRATEGY;
-}
-
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 136d43e24d8..085522ec1a8 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -225,7 +225,7 @@ public:
/// Get the adapter registry
TAO_Adapter_Registry &adapter_registry (void);
- /// @name Collocation Strategies
+ /// @name Collocation Strategies as configured by the user
//@{
enum
{
@@ -234,22 +234,16 @@ public:
ORB_CONTROL,
/// Collocated calls will go thru POA.
- THRU_POA,
+ TAO_COLLOCATION_THRU_POA,
/// Collocated calls invoke operation on Servant directly.
- DIRECT
- };
+ TAO_COLLOCATION_DIRECT,
- /**
- * This method returns the right collocation strategy, if any,
- * to be used to perform a method invocation on the given object.
- *
- * @note
- * No-Collocation is a special case of collocation.
- */
- static
- TAO::Collocation_Strategy collocation_strategy (CORBA::Object_ptr object);
- //@}
+ /// Collocated calls invoke operation on Servant directly if possible,
+ /// else Collocated calls will go thru POA if possible, else
+ /// use REMOTE_STRATEGY
+ TAO_COLLOCATION_BEST
+ };
/// Set/get the collocation flags
//@{
diff --git a/TAO/tao/Object.cpp b/TAO/tao/Object.cpp
index 8b8ed8d7fdb..55ea29155a8 100644
--- a/TAO/tao/Object.cpp
+++ b/TAO/tao/Object.cpp
@@ -209,7 +209,14 @@ CORBA::Object::_is_a (const char *type_id)
// XXX if type_id is that of CORBA::Object, "yes, we comply" :-)
if (this->protocol_proxy_ == 0)
- throw ::CORBA::NO_IMPLEMENT ();
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy for %C\n"),
+ type_id));
+
+ throw ::CORBA::NO_IMPLEMENT ();
+ }
if (this->_stubobj ()->type_id.in () != 0
&& ACE_OS::strcmp (type_id,
@@ -236,13 +243,6 @@ CORBA::Object::_is_collocated (void) const
return false;
}
-void
-CORBA::Object::set_collocated_servant (TAO_Abstract_ServantBase *b)
-{
- this->protocol_proxy_->collocated_servant (b);
- this->protocol_proxy_->is_collocated (true);
-}
-
CORBA::Boolean
CORBA::Object::_is_local (void) const
{
@@ -374,6 +374,11 @@ CORBA::Object::_create_request (CORBA::Context_ptr ctx,
// object references.
if (ctx != 0 || this->protocol_proxy_ == 0)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy for %C\n"),
+ operation));
+
throw ::CORBA::NO_IMPLEMENT ();
}
@@ -414,6 +419,11 @@ CORBA::Object::_create_request (CORBA::Context_ptr ctx,
// object references.
if (ctx != 0 || this->protocol_proxy_ == 0)
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy for %C\n"),
+ operation));
+
throw ::CORBA::NO_IMPLEMENT ();
}
@@ -452,6 +462,11 @@ CORBA::Object::_request (const char *operation)
}
else
{
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy for %C\n"),
+ operation));
+
throw ::CORBA::NO_IMPLEMENT ();
}
}
@@ -522,7 +537,13 @@ CORBA::Object::_get_policy (CORBA::PolicyType type)
if (this->protocol_proxy_)
return this->protocol_proxy_->get_policy (type);
else
- throw ::CORBA::NO_IMPLEMENT ();
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy in _get_policy\n")));
+
+ throw ::CORBA::NO_IMPLEMENT ();
+ }
}
CORBA::Policy_ptr
@@ -533,7 +554,13 @@ CORBA::Object::_get_cached_policy (TAO_Cached_Policy_Type type)
if (this->protocol_proxy_)
return this->protocol_proxy_->get_cached_policy (type);
else
- throw ::CORBA::NO_IMPLEMENT ();
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy in _get_policy\n")));
+
+ throw ::CORBA::NO_IMPLEMENT ();
+ }
}
CORBA::Object_ptr
@@ -544,7 +571,13 @@ CORBA::Object::_set_policy_overrides (
TAO_OBJECT_IOR_EVALUATE_RETURN;
if (!this->protocol_proxy_)
- throw ::CORBA::NO_IMPLEMENT ();
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy in _get_policy\n")));
+
+ throw ::CORBA::NO_IMPLEMENT ();
+ }
TAO_Stub* stub =
this->protocol_proxy_->set_policy_overrides (policies, set_add);
@@ -581,7 +614,13 @@ CORBA::Object::_get_policy_overrides (const CORBA::PolicyTypeSeq & types)
if (this->protocol_proxy_)
return this->protocol_proxy_->get_policy_overrides (types);
else
- throw ::CORBA::NO_IMPLEMENT ();
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy in _get_policy\n")));
+
+ throw ::CORBA::NO_IMPLEMENT ();
+ }
}
CORBA::Boolean
@@ -634,7 +673,13 @@ CORBA::Object::_get_orb (void)
if (this->protocol_proxy_)
return CORBA::ORB::_duplicate (this->protocol_proxy_->orb_core ()->orb ());
else
- throw ::CORBA::INTERNAL ();
+ {
+ if (TAO_debug_level > 0)
+ ACE_ERROR ((LM_ERROR,
+ ACE_TEXT ("TAO (%P|%t) - No protocol proxy in _get_policy\n")));
+
+ throw ::CORBA::NO_IMPLEMENT ();
+ }
}
}
diff --git a/TAO/tao/Object.h b/TAO/tao/Object.h
index 932cff0dfc7..59ae911e3e0 100644
--- a/TAO/tao/Object.h
+++ b/TAO/tao/Object.h
@@ -306,15 +306,6 @@ namespace CORBA
/// Accessor to the flag..
CORBA::Boolean is_evaluated (void) const;
- /// Mutator for setting the servant in collocated cases.
- /**
- * This is used by the Object_Adapter to set the servant for
- * collocated cases and only when the object is initialized. The
- * object initialization takes place when IOR's are lazily
- * evaluated.
- */
- void set_collocated_servant (TAO_Abstract_ServantBase *);
-
/// Accessor for the ORB_Core..
TAO_ORB_Core *orb_core (void) const;
@@ -339,8 +330,7 @@ namespace CORBA
virtual char* convert_to_ior (bool use_omg_ior_format,
const char* ior_prefix) const;
- /// Wrapper for _remove_ref(), naming convention for
- /// templatizing.
+ /// Wrapper for _remove_ref(), naming convention for templatizing.
void _decr_refcount (void);
protected:
diff --git a/TAO/tao/Object_T.cpp b/TAO/tao/Object_T.cpp
index e48f0a5287c..17abfa18791 100644
--- a/TAO/tao/Object_T.cpp
+++ b/TAO/tao/Object_T.cpp
@@ -16,44 +16,23 @@ namespace TAO
template<typename T>
T *
Narrow_Utils<T>::narrow (CORBA::Object_ptr obj,
- const char *repo_id,
- Proxy_Broker_Factory pbf)
+ const char *repo_id)
{
if (CORBA::is_nil (obj))
{
return T::_nil ();
}
- if (obj->_is_a (repo_id) == false)
+ if (!obj->_is_a (repo_id))
{
return T::_nil ();
}
- return TAO::Narrow_Utils<T>::unchecked_narrow (obj, repo_id, pbf);
+ return TAO::Narrow_Utils<T>::unchecked_narrow (obj);
}
template<typename T> T *
- Narrow_Utils<T>::unchecked_narrow (CORBA::Object_ptr obj,
- Proxy_Broker_Factory pbf)
- {
- T *proxy = 0;
- try
- {
- proxy = TAO::Narrow_Utils<T>::unchecked_narrow (obj, 0, pbf);
- }
- catch (const ::CORBA::Exception&)
- {
- // Swallow the exception
- return T::_nil ();
- }
-
- return proxy;
- }
-
- template<typename T> T *
- Narrow_Utils<T>::unchecked_narrow (CORBA::Object_ptr obj,
- const char *,
- Proxy_Broker_Factory pbf)
+ Narrow_Utils<T>::unchecked_narrow (CORBA::Object_ptr obj)
{
if (CORBA::is_nil (obj))
{
@@ -65,34 +44,38 @@ namespace TAO
return T::_duplicate (dynamic_cast<T *> (obj));
}
- T_ptr proxy = Narrow_Utils<T>::lazy_evaluation (obj);
-
- if (!CORBA::is_nil (proxy))
+ T_ptr proxy = T::_nil ();
+ try
{
- return proxy;
+ proxy = Narrow_Utils<T>::lazy_evaluation (obj);
+
+ if (CORBA::is_nil (proxy))
+ {
+ TAO_Stub* stub = obj->_stubobj ();
+
+ if (stub != 0)
+ {
+ stub->_incr_refcnt ();
+
+ bool const collocated =
+ !CORBA::is_nil (stub->servant_orb_var ().in ())
+ && stub->optimize_collocation_objects ()
+ && obj->_is_collocated ();
+
+ ACE_NEW_RETURN (proxy,
+ T (stub,
+ collocated,
+ obj->_servant ()),
+ T::_nil ());
+ }
+ }
}
-
- TAO_Stub* stub = obj->_stubobj ();
-
- if (stub == 0)
+ catch (const ::CORBA::Exception&)
{
- // If we're here, we have been passed a bogus objref.
- throw ::CORBA::BAD_PARAM ();
+ // Swallow the exception
+ return T::_nil ();
}
- stub->_incr_refcnt ();
-
- bool const collocated =
- !CORBA::is_nil (stub->servant_orb_var ().in ())
- && stub->optimize_collocation_objects ()
- && obj->_is_collocated ()
- && pbf != 0;
-
- ACE_NEW_THROW_EX (proxy,
- T (stub,
- collocated,
- obj->_servant ()),
- CORBA::NO_MEMORY ());
return proxy;
}
diff --git a/TAO/tao/Object_T.h b/TAO/tao/Object_T.h
index 0016da30550..cf8e24f9e7b 100644
--- a/TAO/tao/Object_T.h
+++ b/TAO/tao/Object_T.h
@@ -24,6 +24,7 @@
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include /**/ "tao/Versioned_Namespace.h"
+#include "tao/Collocation_Strategy.h"
TAO_BEGIN_VERSIONED_NAMESPACE_DECL
@@ -35,11 +36,6 @@ namespace CORBA
namespace TAO
{
- class Collocation_Proxy_Broker;
-
- typedef
- Collocation_Proxy_Broker * (* Proxy_Broker_Factory)(CORBA::Object_ptr);
-
template<typename T>
class Narrow_Utils
{
@@ -47,15 +43,10 @@ namespace TAO
typedef T *T_ptr;
static T_ptr narrow (CORBA::Object_ptr,
- const char *repo_id,
- Proxy_Broker_Factory);
+ const char *repo_id);
/// Version used the operators.
- static T_ptr unchecked_narrow (CORBA::Object_ptr, Proxy_Broker_Factory);
-
- static T_ptr unchecked_narrow (CORBA::Object_ptr,
- const char *repo_id,
- Proxy_Broker_Factory);
+ static T_ptr unchecked_narrow (CORBA::Object_ptr);
private:
// Code for lazily evaluated IORs.
diff --git a/TAO/tao/PolicyC.cpp b/TAO/tao/PolicyC.cpp
index 604ac00ebcc..58b400fc979 100644
--- a/TAO/tao/PolicyC.cpp
+++ b/TAO/tao/PolicyC.cpp
@@ -368,12 +368,6 @@ TAO::Objref_Traits<CORBA::Policy>::marshal (
return CORBA::Object::marshal (p, cdr);
}
-// Function pointer for collocation factory initialization.
-TAO::Collocation_Proxy_Broker *
-(*CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer) (
- CORBA::Object_ptr obj
- ) = 0;
-
// TAO_IDL - Generated from
// be\be_visitor_operation/operation_cs.cpp:78
@@ -386,11 +380,6 @@ CORBA::PolicyType CORBA::Policy::policy_type (
::CORBA::Object::tao_object_initialize (this);
}
- if (this->the_TAO_Policy_Proxy_Broker_ == 0)
- {
- CORBA_Policy_setup_collocation ();
- }
-
TAO::Arg_Traits< ::CORBA::PolicyType>::ret_val _tao_retval;
TAO::Argument *_the_tao_operation_signature [] =
@@ -404,7 +393,7 @@ CORBA::PolicyType CORBA::Policy::policy_type (
1,
"_get_policy_type",
16,
- this->the_TAO_Policy_Proxy_Broker_
+ TAO::TAO_CO_NONE | TAO::TAO_CO_DIRECT_STRATEGY | TAO::TAO_CO_THRU_POA_STRATEGY
);
_tao_call.invoke (0, 0);
@@ -424,11 +413,6 @@ CORBA::PolicyType CORBA::Policy::policy_type (
::CORBA::Object::tao_object_initialize (this);
}
- if (this->the_TAO_Policy_Proxy_Broker_ == 0)
- {
- CORBA_Policy_setup_collocation ();
- }
-
TAO::Arg_Traits< ::CORBA::Policy>::ret_val _tao_retval;
TAO::Argument *_the_tao_operation_signature [] =
@@ -442,7 +426,7 @@ CORBA::PolicyType CORBA::Policy::policy_type (
1,
"copy",
4,
- this->the_TAO_Policy_Proxy_Broker_
+ TAO::TAO_CO_NONE | TAO::TAO_CO_DIRECT_STRATEGY | TAO::TAO_CO_THRU_POA_STRATEGY
);
_tao_call.invoke (0, 0);
@@ -462,11 +446,6 @@ void CORBA::Policy::destroy (
::CORBA::Object::tao_object_initialize (this);
}
- if (this->the_TAO_Policy_Proxy_Broker_ == 0)
- {
- CORBA_Policy_setup_collocation ();
- }
-
TAO::Arg_Traits< void>::ret_val _tao_retval;
TAO::Argument *_the_tao_operation_signature [] =
@@ -480,26 +459,14 @@ void CORBA::Policy::destroy (
1,
"destroy",
7,
- this->the_TAO_Policy_Proxy_Broker_
+ TAO::TAO_CO_NONE | TAO::TAO_CO_DIRECT_STRATEGY | TAO::TAO_CO_THRU_POA_STRATEGY
);
_tao_call.invoke (0, 0);
}
CORBA::Policy::Policy (void)
- : the_TAO_Policy_Proxy_Broker_ (0)
-{
- this->CORBA_Policy_setup_collocation ();
-}
-
-void
-CORBA::Policy::CORBA_Policy_setup_collocation ()
{
- if (::CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer)
- {
- this->the_TAO_Policy_Proxy_Broker_ =
- ::CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer (this);
- }
}
CORBA::Policy::~Policy (void)
@@ -514,33 +481,19 @@ CORBA::Policy::_tao_any_destructor (void *_tao_void_pointer)
}
CORBA::Policy_ptr
-CORBA::Policy::_narrow (
- CORBA::Object_ptr _tao_objref
-
- )
+CORBA::Policy::_narrow (CORBA::Object_ptr _tao_objref)
{
return
TAO::Narrow_Utils<Policy>::narrow (
_tao_objref,
- "IDL:omg.org/CORBA/Policy:1.0",
- CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer
-
- );
+ "IDL:omg.org/CORBA/Policy:1.0");
}
CORBA::Policy_ptr
-CORBA::Policy::_unchecked_narrow (
- CORBA::Object_ptr _tao_objref
-
- )
+CORBA::Policy::_unchecked_narrow (CORBA::Object_ptr _tao_objref)
{
return
- TAO::Narrow_Utils<Policy>::unchecked_narrow (
- _tao_objref,
- "IDL:omg.org/CORBA/Policy:1.0",
- CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer
-
- );
+ TAO::Narrow_Utils<Policy>::unchecked_narrow (_tao_objref);
}
CORBA::Policy_ptr
@@ -722,9 +675,7 @@ CORBA::Boolean operator>> (
// Narrow to the right type.
_tao_objref =
TAO::Narrow_Utils<RHS_SCOPED_NAME>::unchecked_narrow (
- obj.in (),
- CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer
- );
+ obj.in ());
return 1;
}
diff --git a/TAO/tao/PolicyC.h b/TAO/tao/PolicyC.h
index dc478cbae50..c37bfeb1cfd 100644
--- a/TAO/tao/PolicyC.h
+++ b/TAO/tao/PolicyC.h
@@ -67,7 +67,6 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL
namespace TAO
{
- class Collocation_Proxy_Broker;
template<typename T> class Narrow_Utils;
}
@@ -314,17 +313,10 @@ namespace CORBA
virtual TAO_Policy_Scope _tao_scope (void) const;
// ****************************************************************
- private:
- TAO::Collocation_Proxy_Broker *the_TAO_Policy_Proxy_Broker_;
-
protected:
// Concrete interface only.
Policy (void);
- // These methods travese the inheritance tree and set the
- // parents piece of the given class in the right mode.
- virtual void CORBA_Policy_setup_collocation (void);
-
// Concrete non-local interface only.
Policy (
IOP::IOR *ior,
@@ -355,17 +347,6 @@ namespace CORBA
} // module CORBA
-// Proxy Broker Factory function pointer declarations.
-
-// TAO_IDL - Generated from
-// be\be_visitor_root/root.cpp:139
-
-extern TAO_Export
-TAO::Collocation_Proxy_Broker *
-(*CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer) (
- CORBA::Object_ptr obj
- );
-
// TAO_IDL - Generated from
// be\be_visitor_traits.cpp:61
diff --git a/TAO/tao/PolicyC.inl b/TAO/tao/PolicyC.inl
index f9aac3d9fae..05a60494650 100644
--- a/TAO/tao/PolicyC.inl
+++ b/TAO/tao/PolicyC.inl
@@ -39,21 +39,16 @@ CORBA::Policy::Policy (
TAO_Stub *objref,
CORBA::Boolean _tao_collocated,
TAO_Abstract_ServantBase *servant,
- TAO_ORB_Core *oc
- )
- : ::CORBA::Object (objref, _tao_collocated, servant, oc),
- the_TAO_Policy_Proxy_Broker_ (0)
+ TAO_ORB_Core *oc)
+ : ::CORBA::Object (objref, _tao_collocated, servant, oc)
{
- this->CORBA_Policy_setup_collocation ();
}
ACE_INLINE
CORBA::Policy::Policy (
IOP::IOR *ior,
- TAO_ORB_Core *oc
- )
- : ::CORBA::Object (ior, oc),
- the_TAO_Policy_Proxy_Broker_ (0)
+ TAO_ORB_Core *oc)
+ : ::CORBA::Object (ior, oc)
{
}
diff --git a/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.cpp b/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.cpp
index c045934fa59..b6a94a51993 100644
--- a/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.cpp
+++ b/TAO/tao/PortableServer/Collocated_Object_Proxy_Broker.cpp
@@ -21,21 +21,21 @@ namespace TAO
// Which collocation strategy should we use?
if (stub != 0 &&
stub->servant_orb_var ()->orb_core ()->get_collocation_strategy ()
- == TAO_ORB_Core::THRU_POA)
+ == TAO_ORB_Core::TAO_COLLOCATION_THRU_POA)
{
TAO::Portable_Server::Servant_Upcall servant_upcall (
stub->servant_orb_var ()->orb_core ());
- CORBA::Object_var forward_to;
- servant_upcall.prepare_for_upcall (
- stub->profile_in_use ()->object_key (),
- "_is_a",
- forward_to.out ());
+ CORBA::Object_var forward_to;
+ servant_upcall.prepare_for_upcall (
+ stub->profile_in_use ()->object_key (),
+ "_is_a",
+ forward_to.out ());
- servant_upcall.pre_invoke_collocated_request ();
+ servant_upcall.pre_invoke_collocated_request ();
- return servant_upcall.servant ()->_is_a (type_id);
- }
+ return servant_upcall.servant ()->_is_a (type_id);
+ }
// Direct collocation strategy is used.
if (target->_servant () != 0)
@@ -43,7 +43,7 @@ namespace TAO
return target->_servant ()->_is_a (type_id);
}
- return 0;
+ return false;
}
#if (TAO_HAS_MINIMUM_CORBA == 0)
@@ -59,7 +59,7 @@ namespace TAO
// Which collocation strategy should we use?
if (stub != 0 &&
stub->servant_orb_var ()->orb_core ()
- ->get_collocation_strategy () == TAO_ORB_Core::THRU_POA)
+ ->get_collocation_strategy () == TAO_ORB_Core::TAO_COLLOCATION_THRU_POA)
{
TAO::Portable_Server::Servant_Upcall servant_upcall (
stub->servant_orb_var ()->orb_core ());
@@ -97,7 +97,7 @@ namespace TAO
// Which collocation strategy should we use?
if (stub != 0 &&
stub->servant_orb_var ()->orb_core ()
- ->get_collocation_strategy () == TAO_ORB_Core::THRU_POA)
+ ->get_collocation_strategy () == TAO_ORB_Core::TAO_COLLOCATION_THRU_POA)
{
TAO::Portable_Server::Servant_Upcall servant_upcall (
target->_stubobj ()->servant_orb_var ()->orb_core ());
@@ -135,7 +135,7 @@ namespace TAO
// Which collocation strategy should we use?
if (stub != 0 &&
stub->servant_orb_var ()->orb_core ()
- ->get_collocation_strategy () == TAO_ORB_Core::THRU_POA)
+ ->get_collocation_strategy () == TAO_ORB_Core::TAO_COLLOCATION_THRU_POA)
{
TAO::Portable_Server::Servant_Upcall servant_upcall (
stub->servant_orb_var ()->orb_core ());
@@ -174,7 +174,7 @@ namespace TAO
// Which collocation strategy should we use?
if (stub != 0 &&
stub->servant_orb_var ()->orb_core ()->get_collocation_strategy ()
- == TAO_ORB_Core::THRU_POA)
+ == TAO_ORB_Core::TAO_COLLOCATION_THRU_POA)
{
TAO::Portable_Server::Servant_Upcall servant_upcall (
target->_stubobj ()->servant_orb_var ()->orb_core ());
diff --git a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp
index fea4bc90175..56e68d482d9 100644
--- a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp
+++ b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.cpp
@@ -20,7 +20,7 @@ TAO::Direct_Collocation_Upcall_Wrapper::upcall (
CORBA::Object_out forward_obj,
bool & is_forwarded,
TAO::Argument ** args,
- int num_args,
+ int,
const char * op,
size_t op_len,
TAO::Collocation_Strategy strategy)
@@ -38,7 +38,7 @@ TAO::Direct_Collocation_Upcall_Wrapper::upcall (
try
{
#endif /* TAO_HAS_MINIMUM_CORBA && !CORBA_E_COMPACT && !CORBA_E_MICRO*/
- collocated_skel (servant, args, num_args);
+ collocated_skel (servant, args);
#if (TAO_HAS_MINIMUM_CORBA == 0) && !defined (CORBA_E_COMPACT) && !defined (CORBA_E_MICRO)
}
catch (const ::PortableServer::ForwardRequest& forward_request)
diff --git a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h
index 02213483f81..9b8a6d02be2 100644
--- a/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h
+++ b/TAO/tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h
@@ -51,7 +51,6 @@ namespace TAO
class TAO_PortableServer_Export Direct_Collocation_Upcall_Wrapper
{
public:
-
/// Perform the upcall
void upcall (
CORBA::Object_ptr obj,
diff --git a/TAO/tao/PortableServer/Object_Adapter.cpp b/TAO/tao/PortableServer/Object_Adapter.cpp
index 8686ad9979d..3b4940e3f6f 100644
--- a/TAO/tao/PortableServer/Object_Adapter.cpp
+++ b/TAO/tao/PortableServer/Object_Adapter.cpp
@@ -514,7 +514,7 @@ TAO_Object_Adapter::locate_servant_i (const TAO::ObjectKey &key)
this->locate_poa (key, id, poa);
PortableServer::Servant servant = 0;
- TAO_SERVANT_LOCATION servant_location =
+ TAO_SERVANT_LOCATION const servant_location =
poa->locate_servant_i (id, servant);
switch (servant_location)
diff --git a/TAO/tao/PortableServer/Operation_Table.h b/TAO/tao/PortableServer/Operation_Table.h
index 87b81a7dec7..9a11e5f1b5a 100644
--- a/TAO/tao/PortableServer/Operation_Table.h
+++ b/TAO/tao/PortableServer/Operation_Table.h
@@ -32,14 +32,11 @@ class TAO_Abstract_ServantBase;
typedef void (*TAO_Skeleton)(
TAO_ServerRequest &,
void *,
- void *
- );
+ void *);
typedef void (*TAO_Collocated_Skeleton)(
TAO_Abstract_ServantBase *,
- TAO::Argument **,
- int
- );
+ TAO::Argument **);
/**
* @struct TAO_operation_db_entry
diff --git a/TAO/tao/PortableServer/PolicyS.cpp b/TAO/tao/PortableServer/PolicyS.cpp
index b9bffd54bbe..6a533af379a 100644
--- a/TAO/tao/PortableServer/PolicyS.cpp
+++ b/TAO/tao/PortableServer/PolicyS.cpp
@@ -204,99 +204,6 @@ TAO_CORBA_Policy_Perfect_Hash_OpTable::lookup (const char *str, unsigned int len
}
static TAO_CORBA_Policy_Perfect_Hash_OpTable tao_CORBA_Policy_optable;
-///////////////////////////////////////////////////////////////////////
-// Strategized Proxy Broker Implementation
-//
-
-// TAO_IDL - Generated from
-// be\be_visitor_interface/strategized_proxy_broker_ss.cpp:40
-
-// Factory function Implementation.
-POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker *
-POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::the_TAO_Policy_Strategized_Proxy_Broker (void)
-{
- static POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker
- strategized_proxy_broker;
-
- return &strategized_proxy_broker;
-}
-
-POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::_TAO_Policy_Strategized_Proxy_Broker (void)
-{
-}
-
-POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::~_TAO_Policy_Strategized_Proxy_Broker (void)
-{
-}
-
-TAO::Collocation_Strategy
-POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::get_strategy (
- CORBA::Object_ptr obj
-
- )
-{
- TAO::Collocation_Strategy strategy =
- TAO_ORB_Core::collocation_strategy (obj);
-
- return strategy;
-}
-
-void
-POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::dispatch (
- CORBA::Object_ptr obj,
- CORBA::Object_out forward_obj,
- bool & is_forwarded,
- TAO::Argument ** args,
- int num_args,
- const char * op,
- size_t op_len,
- TAO::Collocation_Strategy strategy
-
- )
-{
- TAO::Direct_Collocation_Upcall_Wrapper collocation_upcall_wrapper;
- collocation_upcall_wrapper.upcall (
- obj,
- forward_obj,
- is_forwarded,
- args,
- num_args,
- op,
- op_len,
- strategy
- );
-}
-
-//
-// End Strategized Proxy Broker Implementation
-///////////////////////////////////////////////////////////////////////
-
-// TAO_IDL - Generated from
-// be\be_visitor_interface/interface_ss.cpp:999
-
-TAO::Collocation_Proxy_Broker *
-CORBA__TAO_Policy_Proxy_Broker_Factory_function (CORBA::Object_ptr)
-{
- return
- ::POA_CORBA::_TAO_Policy_Strategized_Proxy_Broker::the_TAO_Policy_Strategized_Proxy_Broker ();
-}
-
-int
-CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer (size_t)
-{
- CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer =
- CORBA__TAO_Policy_Proxy_Broker_Factory_function;
-
- return 0;
-}
-
-static int
-CORBA__TAO_Policy_Proxy_Broker_Stub_Factory_Initializer_Scarecrow =
- CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer (
- reinterpret_cast<size_t> (CORBA__TAO_Policy_Proxy_Broker_Factory_Initializer)
- );
-
-
///////////////////////////////////////////////////////////////////////
// Direct Proxy Implementation
@@ -314,17 +221,12 @@ POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::~_TAO_Policy_Direct_Proxy_Impl (void)
void
POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type (
TAO_Abstract_ServantBase *servant,
- TAO::Argument ** args,
- int
-
- )
+ TAO::Argument ** args)
{
((TAO::Arg_Traits< ::CORBA::PolicyType>::ret_val *) args[0])->arg () =
dynamic_cast<POA_CORBA::Policy_ptr>
(servant)
- ->policy_type (
-
- );
+ ->policy_type ();
}
// TAO_IDL - Generated from
// be\be_visitor_operation/direct_proxy_impl_ss.cpp:42
@@ -332,17 +234,12 @@ POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::_get_policy_type (
void
POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy (
TAO_Abstract_ServantBase *servant,
- TAO::Argument ** args,
- int
-
- )
+ TAO::Argument ** args)
{
((TAO::Arg_Traits< CORBA::Policy>::ret_val *) args[0])->arg () =
dynamic_cast<POA_CORBA::Policy_ptr>
(servant)
- ->copy (
-
- );
+ ->copy ();
}
// TAO_IDL - Generated from
// be\be_visitor_operation/direct_proxy_impl_ss.cpp:42
@@ -350,15 +247,11 @@ POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::copy (
void
POA_CORBA::_TAO_Policy_Direct_Proxy_Impl::destroy (
TAO_Abstract_ServantBase *servant,
- TAO::Argument **,
- int
- )
+ TAO::Argument **)
{
dynamic_cast<POA_CORBA::Policy_ptr>
(servant)
- ->destroy (
-
- );
+ ->destroy ();
}
@@ -1026,9 +919,7 @@ POA_CORBA::Policy::_this (void)
typedef ::CORBA::Policy STUB_SCOPED_NAME;
return
TAO::Narrow_Utils<STUB_SCOPED_NAME>::unchecked_narrow (
- obj.in (),
- CORBA__TAO_Policy_Proxy_Broker_Factory_function_pointer
- );
+ obj.in ());
}
#endif /* ifndef */
diff --git a/TAO/tao/PortableServer/PolicyS.h b/TAO/tao/PortableServer/PolicyS.h
index 44603b46599..fc076ae73b5 100644
--- a/TAO/tao/PortableServer/PolicyS.h
+++ b/TAO/tao/PortableServer/PolicyS.h
@@ -42,7 +42,6 @@
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
-#include "tao/Collocation_Proxy_Broker.h"
#include "tao/PortableServer/PortableServer.h"
#include "tao/PortableServer/Servant_Base.h"
@@ -73,9 +72,6 @@ namespace POA_CORBA
class Policy;
typedef Policy *Policy_ptr;
- class _TAO_Policy_Direct_Proxy_Impl;
- class _TAO_Policy_Strategized_Proxy_Broker;
-
class TAO_PortableServer_Export Policy
: public virtual PortableServer::ServantBase
{
@@ -182,48 +178,6 @@ namespace POA_CORBA
);
};
- ///////////////////////////////////////////////////////////////////////
- // Strategized Proxy Broker Declaration
- //
-
- // TAO_IDL - Generated from
- // be\be_visitor_interface/strategized_proxy_broker_sh.cpp:36
-
- class TAO_PortableServer_Export _TAO_Policy_Strategized_Proxy_Broker
- : public virtual TAO::Collocation_Proxy_Broker
- {
- public:
- _TAO_Policy_Strategized_Proxy_Broker (void);
-
- virtual ~_TAO_Policy_Strategized_Proxy_Broker (void);
-
- TAO::Collocation_Strategy
- get_strategy (
- CORBA::Object_ptr obj
-
- );
-
- void
- dispatch (
- CORBA::Object_ptr obj,
- CORBA::Object_out forward_obj,
- bool & is_forwarded,
- TAO::Argument ** args,
- int num_args,
- const char * op,
- size_t op_len,
- TAO::Collocation_Strategy strategy
-
- );
-
- static _TAO_Policy_Strategized_Proxy_Broker *
- the_TAO_Policy_Strategized_Proxy_Broker (void);
- };
-
- //
- // End Strategized Proxy Broker Declaration
- ///////////////////////////////////////////////////////////////////////
-
// TAO_IDL - Generated from
@@ -246,10 +200,7 @@ namespace POA_CORBA
static void
_get_policy_type (
TAO_Abstract_ServantBase *servant,
- TAO::Argument ** args,
- int num_args
-
- );
+ TAO::Argument ** args);
// TAO_IDL - Generated from
// be\be_visitor_operation/proxy_impl_xh.cpp:24
@@ -257,10 +208,7 @@ namespace POA_CORBA
static void
copy (
TAO_Abstract_ServantBase *servant,
- TAO::Argument ** args,
- int num_args
-
- );
+ TAO::Argument ** args);
// TAO_IDL - Generated from
// be\be_visitor_operation/proxy_impl_xh.cpp:24
@@ -268,10 +216,7 @@ namespace POA_CORBA
static void
destroy (
TAO_Abstract_ServantBase *servant,
- TAO::Argument ** args,
- int num_args
-
- );
+ TAO::Argument ** args);
};
//
diff --git a/TAO/tao/PortableServer/Servant_Base.cpp b/TAO/tao/PortableServer/Servant_Base.cpp
index 96e284963ef..4c33eb15523 100644
--- a/TAO/tao/PortableServer/Servant_Base.cpp
+++ b/TAO/tao/PortableServer/Servant_Base.cpp
@@ -5,6 +5,7 @@
#include "tao/PortableServer/Root_POA.h"
#include "tao/PortableServer/Operation_Table.h"
#include "tao/PortableServer/POA_Current_Impl.h"
+#include "tao/PortableServer/Direct_Collocation_Upcall_Wrapper.h"
#include "tao/Timeprobe.h"
#include "tao/ORB_Core.h"
@@ -328,4 +329,26 @@ TAO_ServantBase::_refcount_value (void) const
return this->ref_count_.value ();
}
+void
+TAO_ServantBase::_collocated_dispatch (::CORBA::Object_ptr obj,
+ ::CORBA::Object_out forward_obj,
+ bool &is_forwarded,
+ TAO::Argument ** args,
+ int num_args,
+ const char * op,
+ size_t op_len,
+ TAO::Collocation_Strategy strategy)
+{
+ TAO::Direct_Collocation_Upcall_Wrapper collocation_upcall_wrapper;
+ collocation_upcall_wrapper.upcall (
+ obj,
+ forward_obj,
+ is_forwarded,
+ args,
+ num_args,
+ op,
+ op_len,
+ strategy);
+}
+
TAO_END_VERSIONED_NAMESPACE_DECL
diff --git a/TAO/tao/PortableServer/Servant_Base.h b/TAO/tao/PortableServer/Servant_Base.h
index 5b9090eb203..f2e43803cb4 100644
--- a/TAO/tao/PortableServer/Servant_Base.h
+++ b/TAO/tao/PortableServer/Servant_Base.h
@@ -134,6 +134,15 @@ public:
virtual CORBA::ULong _refcount_value (void) const;
//@}
+ virtual void _collocated_dispatch (::CORBA::Object_ptr obj,
+ ::CORBA::Object_out forward_obj,
+ bool &is_forwarded,
+ TAO::Argument ** args,
+ int num_args,
+ const char * op,
+ size_t op_len,
+ TAO::Collocation_Strategy strategy);
+
protected:
/// Default constructor, only derived classes can be created.
diff --git a/TAO/tao/PortableServer/Servant_Upcall.cpp b/TAO/tao/PortableServer/Servant_Upcall.cpp
index 5b3383148c2..e172081ef7c 100644
--- a/TAO/tao/PortableServer/Servant_Upcall.cpp
+++ b/TAO/tao/PortableServer/Servant_Upcall.cpp
@@ -54,7 +54,7 @@ namespace TAO
{
bool wait_occurred_restart_call = false;
- int result =
+ int const result =
this->prepare_for_upcall_i (key,
operation,
forward_to,
diff --git a/TAO/tao/Remote_Object_Proxy_Broker.cpp b/TAO/tao/Remote_Object_Proxy_Broker.cpp
index 8dbf58e2a23..3d5d61b6032 100644
--- a/TAO/tao/Remote_Object_Proxy_Broker.cpp
+++ b/TAO/tao/Remote_Object_Proxy_Broker.cpp
@@ -34,7 +34,7 @@ namespace TAO
2,
"_is_a",
5,
- 0);
+ TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
tao_call.invoke (0, 0);
@@ -58,7 +58,7 @@ namespace TAO
1,
"_non_existent",
13,
- 0);
+ TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
_tao_call.invoke (0, 0);
@@ -80,7 +80,7 @@ namespace TAO
1,
"_component",
10,
- 0);
+ TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
_tao_call.invoke (0, 0);
@@ -118,7 +118,7 @@ namespace TAO
1,
"_repository_id",
14,
- 0);
+ TAO::TAO_CO_NONE | TAO::TAO_CO_THRU_POA_STRATEGY);
_tao_call.invoke (0, 0);
diff --git a/TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.cpp b/TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.cpp
index bcb3e3c3849..b9018137a4b 100644
--- a/TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.cpp
+++ b/TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.cpp
@@ -14,7 +14,7 @@ namespace TAO
int arg_number,
const char *operation,
size_t op_len,
- Collocation_Proxy_Broker *p,
+ int collocation_opportunity,
Invocation_Type type,
Invocation_Mode mode)
: Invocation_Adapter (target->equivalent_objref (),
@@ -22,7 +22,7 @@ namespace TAO
arg_number,
operation,
op_len,
- p,
+ collocation_opportunity,
type,
mode)
{
diff --git a/TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.h b/TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.h
index afac495a54f..498dd7eaae1 100644
--- a/TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.h
+++ b/TAO/tao/Valuetype/AbstractBase_Invocation_Adapter.h
@@ -51,7 +51,7 @@ namespace TAO
int arg_number,
const char *operation,
size_t op_len,
- Collocation_Proxy_Broker *cpb,
+ int collocation_opportunity,
TAO::Invocation_Type type = TAO_TWOWAY_INVOCATION,
TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION);
diff --git a/TAO/tao/Valuetype/AbstractBase_T.cpp b/TAO/tao/Valuetype/AbstractBase_T.cpp
index 01f4e0ab83f..18d9b04672e 100644
--- a/TAO/tao/Valuetype/AbstractBase_T.cpp
+++ b/TAO/tao/Valuetype/AbstractBase_T.cpp
@@ -14,47 +14,23 @@ namespace TAO
template<typename T> T *
AbstractBase_Narrow_Utils<T>::narrow (
CORBA::AbstractBase_ptr obj,
- const char *repo_id,
- Proxy_Broker_Factory pbf)
+ const char *repo_id)
{
if (CORBA::is_nil (obj))
{
return T::_nil ();
}
- if (obj->_is_a (repo_id) == false)
+ if (!obj->_is_a (repo_id))
{
return T::_nil ();
}
- return
- AbstractBase_Narrow_Utils<T>::unchecked_narrow (obj, repo_id, pbf);
+ return AbstractBase_Narrow_Utils<T>::unchecked_narrow (obj);
}
template<typename T> T *
- AbstractBase_Narrow_Utils<T>::unchecked_narrow (
- CORBA::AbstractBase_ptr obj,
- Proxy_Broker_Factory pbf)
- {
- T *proxy = 0;
-
- try
- {
- proxy =
- AbstractBase_Narrow_Utils<T>::unchecked_narrow (obj, 0, pbf);
- }
- catch (const ::CORBA::Exception&)
- {
- }
-
- return proxy;
- }
-
- template<typename T> T *
- AbstractBase_Narrow_Utils<T>::unchecked_narrow (
- CORBA::AbstractBase_ptr obj,
- const char *,
- Proxy_Broker_Factory pbf)
+ AbstractBase_Narrow_Utils<T>::unchecked_narrow (CORBA::AbstractBase_ptr obj)
{
if (CORBA::is_nil (obj))
{
@@ -63,27 +39,32 @@ namespace TAO
T_ptr proxy = T::_nil ();
- if (obj->_is_objref ())
+ try
{
- TAO_Stub* stub = obj->_stubobj ();
-
- bool const collocated =
- !CORBA::is_nil (stub->servant_orb_var ().in ())
- && stub->optimize_collocation_objects ()
- && obj->_is_collocated ()
- && pbf != 0;
-
- ACE_NEW_THROW_EX (proxy,
- T (obj->_stubobj (),
- collocated,
- obj->_servant ()),
- CORBA::NO_MEMORY ());
+ if (obj->_is_objref ())
+ {
+ TAO_Stub* stub = obj->_stubobj ();
+
+ bool const collocated =
+ !CORBA::is_nil (stub->servant_orb_var ().in ())
+ && stub->optimize_collocation_objects ()
+ && obj->_is_collocated ();
+
+ ACE_NEW_RETURN (proxy,
+ T (obj->_stubobj (),
+ collocated,
+ obj->_servant ()),
+ T::_nil ());
+ }
+ else
+ {
+ proxy = dynamic_cast<T *> (obj);
+ if (proxy)
+ proxy->_add_ref ();
+ }
}
- else
+ catch (const ::CORBA::Exception&)
{
- proxy = dynamic_cast<T *> (obj);
- if (proxy)
- proxy->_add_ref ();
}
return proxy;
diff --git a/TAO/tao/Valuetype/AbstractBase_T.h b/TAO/tao/Valuetype/AbstractBase_T.h
index 3d088a6645b..54eb936be9f 100644
--- a/TAO/tao/Valuetype/AbstractBase_T.h
+++ b/TAO/tao/Valuetype/AbstractBase_T.h
@@ -37,15 +37,9 @@ namespace TAO
typedef T *T_ptr;
static T_ptr narrow (CORBA::AbstractBase_ptr,
- const char *repo_id,
- Proxy_Broker_Factory);
+ const char *repo_id);
- static T_ptr unchecked_narrow (CORBA::AbstractBase_ptr,
- Proxy_Broker_Factory);
-
- static T_ptr unchecked_narrow (CORBA::AbstractBase_ptr,
- const char *repo_id,
- Proxy_Broker_Factory);
+ static T_ptr unchecked_narrow (CORBA::AbstractBase_ptr);
};
}
diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h
index 4d14a5af3a1..8e8efb4f900 100644
--- a/TAO/tao/orbconf.h
+++ b/TAO/tao/orbconf.h
@@ -885,6 +885,10 @@ enum TAO_Policy_Scope
# define TAO_HAS_SEQUENCE_ITERATORS 0
#endif
+#if !defined (TAO_DEFAULT_COLLOCATION_STRATEGY)
+# define TAO_DEFAULT_COLLOCATION_STRATEGY TAO_COLLOCATION_THRU_POA
+#endif
+
TAO_END_VERSIONED_NAMESPACE_DECL
#include /**/ "ace/post.h"
diff --git a/TAO/tao/tao.mpc b/TAO/tao/tao.mpc
index 3318978a531..d431edf9503 100644
--- a/TAO/tao/tao.mpc
+++ b/TAO/tao/tao.mpc
@@ -105,7 +105,6 @@ project(TAO) : acelib, install, tao_output, taodefaults, pidl, extra_core, taoid
Codeset_Manager_Factory_Base.cpp
Codeset_Translator_Base.cpp
Collocated_Invocation.cpp
- Collocation_Proxy_Broker.cpp
Collocation_Resolver.cpp
Connect_Strategy.cpp
Connection_Handler.cpp
@@ -361,7 +360,6 @@ project(TAO) : acelib, install, tao_output, taodefaults, pidl, extra_core, taoid
Codeset_Manager_Factory_Base.h
Codeset_Translator_Base.h
Collocated_Invocation.h
- Collocation_Proxy_Broker.h
Collocation_Resolver.h
Collocation_Strategy.h
Condition.h