summaryrefslogtreecommitdiff
path: root/TAO/tao/ORB_Core.cpp
diff options
context:
space:
mode:
authormcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-10-20 09:46:10 +0000
committermcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-10-20 09:46:10 +0000
commit02686f8d5108580e8a3d56bfe9b124405fdedd18 (patch)
tree0426ac218b7505e1c06dbf5ff8d2b10144d7ce75 /TAO/tao/ORB_Core.cpp
parentb2334408ebeffc6686b1f976247926df8411caec (diff)
downloadATCD-02686f8d5108580e8a3d56bfe9b124405fdedd18.tar.gz
Tue Oct 20 09:30:13 UTC 2011 Martin Corino <mcorino@remedy.nl>
Merged changes from Remedy work branch.
Diffstat (limited to 'TAO/tao/ORB_Core.cpp')
-rw-r--r--TAO/tao/ORB_Core.cpp50
1 files changed, 11 insertions, 39 deletions
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