diff options
Diffstat (limited to 'TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp')
-rw-r--r-- | TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp | 41 |
1 files changed, 13 insertions, 28 deletions
diff --git a/TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp b/TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp index 43a23d567ec..026d111275d 100644 --- a/TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp +++ b/TAO/orbsvcs/tests/Bug_2285_Regression/server2.cpp @@ -16,7 +16,7 @@ ACE_RCSID (Hello, const char *ior_output_file = ""; CORBA::ULong my_id_number = 0; - + int parse_args (int argc, char *argv[]) { @@ -32,7 +32,7 @@ parse_args (int argc, char *argv[]) case 'n': my_id_number = (CORBA::ULong) ACE_OS::atoi (get_opts.opt_arg ()); ior_file += get_opts.opt_arg (); - ior_file += ".ior"; + ior_file += ".ior"; ior_output_file = CORBA::string_dup (ior_file.c_str ()); break; case '?': @@ -65,19 +65,15 @@ main (int argc, char *argv[]) PortableInterceptor::register_orb_initializer (orb_initializer.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; CORBA::Object_var poa_object = orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; PortableServer::POA_var root_poa = PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; if (CORBA::is_nil (root_poa.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -85,9 +81,8 @@ main (int argc, char *argv[]) 1); PortableServer::POAManager_var poa_manager = - root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - + root_poa->the_POAManager (); + CORBA::PolicyList policies (2); policies.length (2); @@ -99,21 +94,18 @@ main (int argc, char *argv[]) policies[1] = root_poa->create_lifespan_policy (PortableServer::PERSISTENT ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; PortableServer::POA_var my_poa = root_poa->create_POA ("my_poa", poa_manager.in (), policies ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; // Creation of the new POA is over, so destroy the Policy_ptr's. for (CORBA::ULong i = 0; i < policies.length (); ++i) { CORBA::Policy_ptr policy = policies[i]; - policy->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + policy->destroy (); } @@ -124,23 +116,20 @@ main (int argc, char *argv[]) ACE_NEW_RETURN (hello_impl, Hello (orb.in (), Test::Hello::_nil (), my_id_number), 1); - + PortableServer::ObjectId_var server_id = PortableServer::string_to_ObjectId ("server_id"); my_poa->activate_object_with_id (server_id.in (), hello_impl ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; CORBA::Object_var hello = my_poa->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + CORBA::String_var ior = orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - + // Output the IOR to the <ior_output_file> FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); if (output_file == 0) @@ -150,18 +139,14 @@ main (int argc, char *argv[]) 1); ACE_OS::fprintf (output_file, "%s", ior.in ()); ACE_OS::fclose (output_file); - - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - orb->run (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + poa_manager->activate (); + + orb->run (); root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + orb->destroy (); } ACE_CATCHANY { |