3 // In case this is a static build we have to force
4 // the ImR_Client to be linked.
5 #include "tao/ImR_Client/ImR_Client.h"
7 Test_i::Test_i (CORBA::ORB_ptr orb
) :
8 orb_ (CORBA::ORB::_duplicate(orb
)),
13 CORBA::Object_var obj
=
14 orb_
->resolve_initial_references ("RootPOA");
16 PortableServer::POA::_narrow (obj
.in ());
19 root_poa_
->create_lifespan_policy (PortableServer::PERSISTENT
);
21 this->root_poa_
->the_POAManager ();
23 catch (const CORBA::Exception
& ex
)
25 ex
._tao_print_exception ("Caught exception");
27 ACE_ASSERT (0); // Force termination!
31 Test_i::~Test_i (void)
33 this->policies_
[0]->destroy ();
37 Test_i::try_and_create_POA (void)
41 PortableServer::POA_var persistent_poa
=
42 root_poa_
->create_POA ("MyPoa",
46 catch (const CORBA::TRANSIENT
&)
48 // A transient exception exception may be expected,
49 // so we won't print out the word exception but we
50 // will let the user know that a transient exception occurred
52 "CORBA::TRANSIENT in Test_i::try_and_create_POA\n"));
55 catch (const CORBA::Exception
& ex
)
57 ex
._tao_print_exception ("try_and_create_POA Exception ...");
65 Test_i::shutdown (void)