summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp')
-rw-r--r--TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp61
1 files changed, 61 insertions, 0 deletions
diff --git a/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp
new file mode 100644
index 00000000000..b850af5e4a1
--- /dev/null
+++ b/TAO/orbsvcs/tests/FT_Naming/Load_Balancing/Basic.cpp
@@ -0,0 +1,61 @@
+// $Id$
+
+#include "Basic.h"
+#include "LB_server.h"
+#include "orbsvcs/PortableGroup/PG_Property_Set.h"
+
+Basic::Basic (CORBA::Object_ptr object_group,
+ FT::NamingManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ const char *loc)
+ : object_group_name_ ("Basic Group"), orb_ (CORBA::ORB::_duplicate (orb))
+{
+ this->object_group_ = CORBA::Object::_duplicate (object_group);
+ this->nm_ = FT::NamingManager::_duplicate (lm);
+ this->location_ = CORBA::string_dup (loc);
+}
+
+char *
+Basic::get_string (void)
+{
+ return CORBA::string_dup (this->location_.in ());
+}
+
+void
+Basic::remove_member (void)
+{
+ try
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+ location[0].id = CORBA::string_dup (this->location_.in ());
+ this->nm_->remove_member (this->object_group_.in (),
+ location);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Removed Member at Location <%s>\n",
+ this->location_.in ()));
+
+ }
+ catch (const PortableGroup::ObjectNotFound& ex)
+ {
+ ex._tao_print_exception ("Caught exception in remove_member");
+ throw CORBA::INTERNAL ();
+ }
+ catch (const PortableGroup::MemberNotFound& ex)
+ {
+ ex._tao_print_exception ("Caught exception in remove_member");
+ throw CORBA::INTERNAL ();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught while destroying member\n");
+ }
+
+}
+
+
+void
+Basic::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}