diff options
author | bala <balanatarajan@users.noreply.github.com> | 1999-04-06 23:34:05 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 1999-04-06 23:34:05 +0000 |
commit | 3fe470d7292344670fc5369c89f2faa0a9b5d578 (patch) | |
tree | c0af287f94a81c151a454f766405b818d7a69fc4 | |
parent | e541ece8cf6ff21e4e0fc3336b1112f2cafa9af6 (diff) | |
download | ATCD-3fe470d7292344670fc5369c89f2faa0a9b5d578.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/ChangeLog-99c | 1 | ||||
-rw-r--r-- | TAO/examples/POA/NewPOA/NewPOA.cpp | 119 |
2 files changed, 36 insertions, 84 deletions
diff --git a/TAO/ChangeLog-99c b/TAO/ChangeLog-99c index 2da5628417e..57e41565d22 100644 --- a/TAO/ChangeLog-99c +++ b/TAO/ChangeLog-99c @@ -1,5 +1,6 @@ Tue Apr 6 17:55:48 1999 Balachandran Natarajan <bala@cs.wustl.edu> + * examples/POA/NewPOA/NewPOA.cpp (main): * examples/POA/Loader/server.cpp: * examples/POA/Identity/Identity.cpp: * examples/POA/Generic_Servant/client.cpp: Changed ACE_TRY_NEW_ENV diff --git a/TAO/examples/POA/NewPOA/NewPOA.cpp b/TAO/examples/POA/NewPOA/NewPOA.cpp index d9afbb72c53..8a52461c054 100644 --- a/TAO/examples/POA/NewPOA/NewPOA.cpp +++ b/TAO/examples/POA/NewPOA/NewPOA.cpp @@ -28,29 +28,25 @@ ACE_RCSID(NewPOA, NewPOA, "$Id$") int main (int argc, char **argv) { - CORBA::Environment env; + // CORBA::Environment env; - // The first step Initialize the ORB - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, 0, env); - if (env.exception () != 0) - { - env.print_exception ("CORBA::ORB_init"); - return -1; - } + ACE_DECLARE_NEW_CORBA_ENV; + // The first step Initialize the ORB + CORBA::ORB_var orb = CORBA::ORB_init (argc, + argv, + 0, + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + // Obtain the object reference to the RootPOA. CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); // _narrow() the Object to get the POA object, i.e., the root_poa. PortableServer::POA_var root_poa = - PortableServer::POA::_narrow (obj.in (), env); - - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::_narrow"); - return -1; - } + PortableServer::POA::_narrow (obj.in (), ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); // Policies for the new POAs CORBA::PolicyList policies (2); @@ -58,23 +54,13 @@ main (int argc, char **argv) // Threading policy policies[0] = - root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL, env); - - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::create_thread_policy"); - return -1; - } + root_poa->create_thread_policy (PortableServer::ORB_CTRL_MODEL, ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); // Lifespan policy policies[1] = - root_poa->create_lifespan_policy (PortableServer::TRANSIENT, env); - - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::create_lifespan_policy"); - return -1; - } + root_poa->create_lifespan_policy (PortableServer::TRANSIENT, ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); // Creation of the firstPOA ACE_CString name = "firstPOA"; @@ -82,12 +68,8 @@ main (int argc, char **argv) root_poa->create_POA (name.c_str (), PortableServer::POAManager::_nil (), policies, - env); - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::create_POA"); - return -1; - } + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); // Creation of the new POA, i.e. firstPOA/secondPOA name = "secondPOA"; @@ -95,12 +77,8 @@ main (int argc, char **argv) first_poa->create_POA (name.c_str (), PortableServer::POAManager::_nil (), policies, - env); - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::create_POA"); - return -1; - } + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); // Creating thirdPOA. name = "thirdPOA"; @@ -109,61 +87,38 @@ main (int argc, char **argv) root_poa->create_POA (name.c_str (), PortableServer::POAManager::_nil (), policies, - env); - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::create_POA"); - return -1; - } + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); // Creation of the new POAs over, so destroy the Policy_ptr's. for (CORBA::ULong i = 0; - i < policies.length () && env.exception () == 0; + i < policies.length () && ACE_TRY_ENV.exception () == 0; ++i) { CORBA::Policy_ptr policy = policies[i]; - policy->destroy (env); + policy->destroy (ACE_TRY_ENV); } - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::create_POA"); - return -1; - } + ACE_CHECK_RETURN (-1); // Get the names of all the POAs and print them out. CORBA::String_var root_poa_name = - root_poa->the_name (env); - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::_narrow"); - return -1; - } + root_poa->the_name (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); CORBA::String_var first_poa_name = - first_poa->the_name (env); - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::_narrow"); - return -1; - } + first_poa->the_name (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); CORBA::String_var second_poa_name = - second_poa->the_name (env); - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::_narrow"); - return -1; - } + second_poa->the_name (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); + CORBA::String_var third_poa_name = - third_poa->the_name (env); - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::_narrow"); - return -1; - } + third_poa->the_name (ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); ACE_DEBUG ((LM_DEBUG, "%s\n%s\n%s\n%s\n", @@ -175,12 +130,8 @@ main (int argc, char **argv) // This should destroy all its children root_poa->destroy (1, 1, - env); - if (env.exception () != 0) - { - env.print_exception ("PortableServer::POA::destroy"); - return -1; - } + ACE_TRY_ENV); + ACE_CHECK_RETURN (-1); return 0; } |