summaryrefslogtreecommitdiff
path: root/ACE/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ACE/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp')
-rw-r--r--ACE/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp71
1 files changed, 71 insertions, 0 deletions
diff --git a/ACE/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp b/ACE/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp
new file mode 100644
index 00000000000..dee11993c13
--- /dev/null
+++ b/ACE/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Manage_Object_Group/Basic.cpp
@@ -0,0 +1,71 @@
+#include "Basic.h"
+#include "LB_server.h"
+
+
+ACE_RCSID (Application_Controlled,
+ Basic,
+ "$Id$")
+
+
+Basic::Basic (CORBA::Object_ptr object_group,
+ CosLoadBalancing::LoadManager_ptr lm,
+ CORBA::ORB_ptr orb,
+ CORBA::Short num,
+ const char *loc)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ number_ (num)
+{
+ this->object_group_ = CORBA::Object::_duplicate (object_group);
+ this->lm_ = CosLoadBalancing::LoadManager::_duplicate (lm);
+ this->location_ = CORBA::string_dup (loc);
+}
+
+CORBA::Short
+Basic::number (void)
+{
+ return this->number_;
+}
+
+char *
+Basic::get_string (void)
+{
+ return CORBA::string_dup (this->location_);
+}
+
+void
+Basic::remove_member (void)
+{
+ try
+ {
+ PortableGroup::Location location (1);
+ location.length (1);
+ location[0].id = CORBA::string_dup (this->location_);
+ this->lm_->remove_member (this->object_group_.in (),
+ location);
+
+ ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Removed Member at Location <%s>\n",
+ this->location_));
+
+ }
+ 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);
+}