Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / TAO / orbsvcs / tests / FT_Naming / FaultTolerant / Basic.cpp
blob70f4f233719baa6dc4a4316fc96666bb5aeb53d7
1 #include "Basic.h"
3 Basic::Basic (CORBA::Object_ptr object_group,
4 FT_Naming::NamingManager_ptr lm,
5 CORBA::ORB_ptr orb,
6 const char *loc)
7 : object_group_name_ ("BasicGroup"),
8 orb_ (CORBA::ORB::_duplicate (orb))
10 this->object_group_ = CORBA::Object::_duplicate (object_group);
11 this->nm_ = FT_Naming::NamingManager::_duplicate (lm);
12 this->location_ = loc;
15 char *
16 Basic::get_string ()
18 return CORBA::string_dup (this->location_.in ());
21 void
22 Basic::remove_member ()
24 try
26 PortableGroup::Location location (1);
27 location.length (1);
28 location[0].id = CORBA::string_dup (this->location_.in ());
29 this->object_group_ =
30 this->nm_->remove_member (this->object_group_.in (),
31 location);
33 ACE_DEBUG ((LM_DEBUG,
34 ACE_TEXT ("(%P|%t) - Removed Member at Location <%s>\n"),
35 this->location_.in ()));
37 catch (const PortableGroup::ObjectNotFound& ex)
39 ex._tao_print_exception (
40 ACE_TEXT ("Caught exception in remove_member"));
41 throw CORBA::INTERNAL ();
43 catch (const PortableGroup::MemberNotFound& ex)
45 ex._tao_print_exception (
46 ACE_TEXT ("Caught exception in remove_member"));
47 throw CORBA::INTERNAL ();
49 catch (const CORBA::Exception& ex)
51 ex._tao_print_exception (
52 ACE_TEXT ("Exception caught while destroying member\n"));
58 void
59 Basic::shutdown ()
61 this->orb_->shutdown (false);