diff options
author | vridosh <vridosh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-11-30 10:12:08 +0000 |
---|---|---|
committer | vridosh <vridosh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2006-11-30 10:12:08 +0000 |
commit | 0e207f1abd2d7a1db9ecbbcde7573686cfd52d39 (patch) | |
tree | 4a4d3ccf794998cb0d4948b2a72fb11f2a87bec3 /TAO/orbsvcs/orbsvcs/FaultTolerance | |
parent | 307c46da010ada63b4f3ff44f20415b469a41eae (diff) | |
download | ATCD-0e207f1abd2d7a1db9ecbbcde7573686cfd52d39.tar.gz |
ChangeLogTag: Thu Nov 30 09:58:02 UTC 2006 Vadym Ridosh <vridosh@prismtech.com>
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/FaultTolerance')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.cpp | 34 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/FaultTolerance/FT_Service_Callbacks.h | 5 |
2 files changed, 39 insertions, 0 deletions
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); |