summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TAO/ChangeLog14
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp34
-rw-r--r--TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h5
-rw-r--r--TAO/tao/ORB_Core.cpp10
-rw-r--r--TAO/tao/ORB_Core.h15
-rw-r--r--TAO/tao/ORB_Core.inl36
-rw-r--r--TAO/tao/Service_Callbacks.cpp15
-rw-r--r--TAO/tao/Service_Callbacks.h10
-rw-r--r--TAO/tao/Stub.cpp4
-rw-r--r--TAO/tao/Stub.inl18
10 files changed, 67 insertions, 94 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index 682142164c0..cc611aba879 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,17 @@
+Thu Nov 30 09:58:02 UTC 2006 Vadym Ridosh <vridosh@prismtech.com>
+
+ * tao/Stub.cpp
+ * tao/Stub.inl
+ * tao/Service_Callbacks.cpp
+ * tao/Service_Callbacks.h
+ * tao/ORB_Core.cpp
+ * tao/ORB_Core.inl
+ * tao/ORB_Core.h
+ * orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h
+ * orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp
+
+ Fix for bugzilla 2709.
+
Thu Nov 30 05:52:05 UTC 2006 J.T. Conklin <jtc@acorntoolworks.com>
* tests/Bug_2417_Regression/Makefile.am:
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp
index 88dedebea60..36813b33d7d 100644
--- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp
@@ -37,6 +37,40 @@ TAO_FT_Service_Callbacks::~TAO_FT_Service_Callbacks (void)
delete this->profile_lock_;
}
+CORBA::Boolean
+TAO_FT_Service_Callbacks::select_profile (const TAO_MProfile &mprofile,
+ TAO_Profile *&pfile)
+{
+ CORBA::ULong sz =
+ mprofile.size ();
+
+ // Iterate through the list in a circular fashion. Stop one before
+ // the list instead of trying the same thing again.
+ for (CORBA::ULong i = 0;
+ i != sz;
+ ++i)
+ {
+ const TAO_Profile *curr_pfile = mprofile.get_profile (i);
+
+ IOP::TaggedComponent tagged_component;
+ tagged_component.tag = IOP::TAG_FT_PRIMARY;
+
+ // Get the tagged component from the profile
+ const TAO_Tagged_Components &pfile_tagged =
+ curr_pfile->tagged_components ();
+
+ // Search for the TaggedComponent that we want
+ if (pfile_tagged.get_component (tagged_component) == 1)
+ {
+ // We have found a primary IOR
+ pfile = const_cast<TAO_Profile *>(curr_pfile);
+ return true;
+ }
+ }
+
+ return false;
+}
+
CORBA::Boolean
TAO_FT_Service_Callbacks::object_is_nil (CORBA::Object_ptr obj)
{
diff --git a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h
index b8f0b2a4d1f..b2f0403176f 100644
--- a/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h
+++ b/TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h
@@ -49,6 +49,11 @@ public:
/// Dtor
virtual ~TAO_FT_Service_Callbacks (void);
+ /// Select the profile from MProfile as the needs of the services
+ /// may be. Return the profile in <pfile>
+ virtual CORBA::Boolean select_profile (const TAO_MProfile &mprofile,
+ TAO_Profile *&pfile);
+
/// Check whether <obj> is nil or not. FT spec suggests some
/// extensions for a CORBA::is_nil () operation.
virtual CORBA::Boolean object_is_nil (CORBA::Object_ptr obj);
diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp
index da12853bf47..317178f03d9 100644
--- a/TAO/tao/ORB_Core.cpp
+++ b/TAO/tao/ORB_Core.cpp
@@ -2102,13 +2102,21 @@ CORBA::Boolean
TAO_ORB_Core::is_collocation_enabled (TAO_ORB_Core *orb_core,
const TAO_MProfile &mp)
{
+ TAO_MProfile mp_temp;
+
+ TAO_Profile* profile = 0;
+ if (this->service_profile_selection(mp, profile) && profile)
+ {
+ mp_temp.add_profile(profile);
+ }
+
if (!orb_core->optimize_collocation_objects ())
return 0;
if (!orb_core->use_global_collocation () && orb_core != this)
return 0;
- if (!orb_core->is_collocated (mp))
+ if (!orb_core->is_collocated (profile ? mp_temp : mp))
return 0;
return 1;
diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h
index 6c4403358d4..8bf85dcd2f7 100644
--- a/TAO/tao/ORB_Core.h
+++ b/TAO/tao/ORB_Core.h
@@ -727,23 +727,10 @@ public:
* services do make the selection they would return the selected
* profile through <profile>.
*/
- CORBA::Boolean service_profile_selection (TAO_MProfile &mprofile,
+ CORBA::Boolean service_profile_selection (const TAO_MProfile &mprofile,
TAO_Profile *&profile);
/**
- * The loaded service in the ORB_Core would determine if the profile
- * reselection is going to be made by the services or not. If the
- * services do make the reselection they would return the selected
- * profile through <profile>. The reselction is for the
- * multi-profile IORS.
- */
- CORBA::Boolean service_profile_reselection (TAO_Stub *stub,
- TAO_Profile *&profile);
-
- /// Reset the flags in the loaded services.
- void reset_service_profile_flags (void);
-
- /**
* The loaded service would determine if the CORBA::Object_ptr is
* actually nil or not. This would be useful to accomodate new
* enhanced definitions as defined by the service specification.
diff --git a/TAO/tao/ORB_Core.inl b/TAO/tao/ORB_Core.inl
index 480a0df637c..d5aa24ff2ed 100644
--- a/TAO/tao/ORB_Core.inl
+++ b/TAO/tao/ORB_Core.inl
@@ -76,7 +76,7 @@ TAO_ORB_Core::get_protocols_hooks (void)
}
ACE_INLINE CORBA::Boolean
-TAO_ORB_Core::service_profile_selection (TAO_MProfile &mprofile,
+TAO_ORB_Core::service_profile_selection (const TAO_MProfile &mprofile,
TAO_Profile *&profile)
{
CORBA::Boolean retval = 0;
@@ -86,45 +86,13 @@ TAO_ORB_Core::service_profile_selection (TAO_MProfile &mprofile,
if (this->ft_service_.service_callback ())
{
retval =
- this->ft_service_.service_callback ()->select_profile (&mprofile,
+ this->ft_service_.service_callback ()->select_profile (mprofile,
profile);
}
return retval;
}
ACE_INLINE CORBA::Boolean
-TAO_ORB_Core::service_profile_reselection (TAO_Stub *stub,
- TAO_Profile *&profile)
-{
- CORBA::Boolean retval = 0;
- // @@ If different services have the same feature we may want to
- // prioritise them here. We need to decide here whose selection of
- // profile is more important.
- if (this->ft_service_.service_callback ())
- {
- retval =
- this->ft_service_.service_callback ()->reselect_profile (stub,
- profile);
- }
- return retval;
-}
-
-ACE_INLINE void
-TAO_ORB_Core::reset_service_profile_flags (void)
-{
- // @@ If different services have the same feature we may want to
- // prioritise them here. We need to decide here whose selection of
- // profile is more important.
-
- if (this->ft_service_.service_callback ())
- {
- this->ft_service_.service_callback ()->reset_profile_flags ();
- }
- return;
-}
-
-
-ACE_INLINE CORBA::Boolean
TAO_ORB_Core::object_is_nil (CORBA::Object_ptr obj)
{
CORBA::Boolean retval = 0;
diff --git a/TAO/tao/Service_Callbacks.cpp b/TAO/tao/Service_Callbacks.cpp
index 0e9b89c9ff1..53a12caf6e0 100644
--- a/TAO/tao/Service_Callbacks.cpp
+++ b/TAO/tao/Service_Callbacks.cpp
@@ -16,19 +16,12 @@ TAO_Service_Callbacks::~TAO_Service_Callbacks (void)
}
CORBA::Boolean
-TAO_Service_Callbacks::select_profile (TAO_MProfile * /*mprofile*/,
+TAO_Service_Callbacks::select_profile (const TAO_MProfile & /*mprofile*/,
TAO_Profile *& /*pfile*/)
{
return false;
}
-CORBA::Boolean
-TAO_Service_Callbacks::reselect_profile (TAO_Stub * /*stub*/,
- TAO_Profile *& /*pfile*/)
-{
- return false;
-}
-
CORBA::Boolean
TAO_Service_Callbacks::object_is_nil (CORBA::Object_ptr /* obj */)
@@ -38,12 +31,6 @@ TAO_Service_Callbacks::object_is_nil (CORBA::Object_ptr /* obj */)
return true;
}
-void
-TAO_Service_Callbacks::reset_profile_flags (void)
-{
- return;
-}
-
TAO_Service_Callbacks::Profile_Equivalence
TAO_Service_Callbacks::is_profile_equivalent (const TAO_Profile *,
diff --git a/TAO/tao/Service_Callbacks.h b/TAO/tao/Service_Callbacks.h
index 60b5ac1df3b..1c9e89ff0a3 100644
--- a/TAO/tao/Service_Callbacks.h
+++ b/TAO/tao/Service_Callbacks.h
@@ -77,17 +77,9 @@ public:
/// Select the profile from MProfile as the needs of the services
/// may be. Return the profile in <pfile>
- virtual CORBA::Boolean select_profile (TAO_MProfile *mprofile,
+ virtual CORBA::Boolean select_profile (const TAO_MProfile &mprofile,
TAO_Profile *&pfile);
- /// Select the profile from MProfile as the needs of the services
- /// may be. Return the profile in <pfile>
- virtual CORBA::Boolean reselect_profile (TAO_Stub *stub,
- TAO_Profile *&pfile);
-
- /// Reset the profile flags that the services could have
- virtual void reset_profile_flags (void);
-
/// Check whether <obj> is nil or not.
virtual CORBA::Boolean object_is_nil (CORBA::Object_ptr obj);
diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp
index df0e1fe9ecb..5cf600ee90c 100644
--- a/TAO/tao/Stub.cpp
+++ b/TAO/tao/Stub.cpp
@@ -152,10 +152,6 @@ TAO_Stub::add_forward_profiles (const TAO_MProfile &mprofiles,
// Since we have been forwarded, we must set profile_success_ to false
// since we are starting a new with a new set of profiles!
this->profile_success_ = false;
-
- // Reset any flags that may be appropriate in the services that
- // selects profiles for invocation
- this->orb_core_->reset_service_profile_flags ();
}
int
diff --git a/TAO/tao/Stub.inl b/TAO/tao/Stub.inl
index 51bc7a28e27..265d599d312 100644
--- a/TAO/tao/Stub.inl
+++ b/TAO/tao/Stub.inl
@@ -212,24 +212,6 @@ TAO_Stub::next_profile_retry (void)
}
return false;
-#if 0
- else
- {
- // Check whether the loaded services have something to say about
- // this condition
- TAO_Profile *prof = 0;
- this->orb_core_->service_profile_reselection (this,
- prof);
-
- // If the service is loaded and has a profile then try it.
- if (prof)
- {
- return true;
- }
- this->reset_profiles_i ();
- return false;
- }
-#endif /*If 0 */
}
ACE_INLINE const TAO_MProfile&