summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp')
-rw-r--r--TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp111
1 files changed, 39 insertions, 72 deletions
diff --git a/TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp b/TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp
index eca1cfc94de..bb339d83c73 100644
--- a/TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp
+++ b/TAO/orbsvcs/tests/Bug_2287_Regression/server.cpp
@@ -17,7 +17,7 @@ ACE_RCSID (Hello,
const char *ior_output_file = "test.ior";
TAO_IOP::TAO_IOR_Manipulation_var iorm = 0;
-
+
int
parse_args (int argc, char *argv[])
{
@@ -45,17 +45,16 @@ parse_args (int argc, char *argv[])
}
CORBA::Object_ptr
-make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_version, CORBA::Object_ptr ref ACE_ENV_ARG_DECL)
+make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_version, CORBA::Object_ptr ref)
{
FT::TagFTGroupTaggedComponent ft_tag_component;
// Create the list
TAO_IOP::TAO_IOR_Manipulation::IORList iors (1);
iors.length(1);
iors [0] = CORBA::Object::_duplicate (ref);
-
+
CORBA::Object_var new_ref =
- iorm->merge_iors (iors ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
+ iorm->merge_iors (iors);
// Property values
@@ -78,9 +77,7 @@ make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_
// Set the property
CORBA::Boolean retval = iorm->set_property (&iogr_prop,
- new_ref.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
+ new_ref.in ());
// Set the primary
// See we are setting the second ior as the primary
@@ -88,9 +85,7 @@ make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_
{
retval = iorm->set_primary (&iogr_prop,
new_ref.in (),
- new_ref.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_CHECK_RETURN (0);
+ new_ref.in ());
}
return new_ref._retn ();
@@ -99,7 +94,7 @@ make_iogr (const char* domain_id, CORBA::ULongLong group_id, CORBA::ULong group_
int
main (int argc, char *argv[])
{
- ACE_TRY_NEW_ENV
+ try
{
Server_ORBInitializer2 *temp_initializer = 0;
ACE_NEW_RETURN (temp_initializer,
@@ -108,21 +103,16 @@ main (int argc, char *argv[])
PortableInterceptor::ORBInitializer_var orb_initializer =
temp_initializer;
- PortableInterceptor::register_orb_initializer (orb_initializer.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
+ PortableInterceptor::register_orb_initializer (orb_initializer.in ());
+
CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CORBA::ORB_init (argc, argv, "");
CORBA::Object_var poa_object =
- orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->resolve_initial_references("RootPOA");
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ PortableServer::POA::_narrow (poa_object.in ());
if (CORBA::is_nil (root_poa.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -130,35 +120,27 @@ 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);
policies[0] =
- root_poa->create_id_assignment_policy (PortableServer::USER_ID
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK
+ root_poa->create_id_assignment_policy (PortableServer::USER_ID);
policies[1] =
- root_poa->create_lifespan_policy (PortableServer::PERSISTENT
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->create_lifespan_policy (PortableServer::PERSISTENT);
PortableServer::POA_var my_poa =
root_poa->create_POA ("my_poa",
poa_manager.in (),
- policies
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ policies);
// 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 ();
}
@@ -169,42 +151,33 @@ main (int argc, char *argv[])
ACE_NEW_RETURN (hello_impl,
Hello (orb.in (), Test::Hello::_nil ()),
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;
+ hello_impl);
CORBA::Object_var hello =
- my_poa->id_to_reference (server_id.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
+ my_poa->id_to_reference (server_id.in ());
+
CORBA::String_var ior =
- orb->object_to_string (hello.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
+ orb->object_to_string (hello.in ());
+
// Get a ref to the IORManipulation object
CORBA::Object_var IORM =
orb->resolve_initial_references (TAO_OBJID_IORMANIPULATION,
- 0
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ 0);
// Narrow
iorm =
- TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in() ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
- CORBA::Object_var iogr = make_iogr ("Domain_1", 1, 1, orb->string_to_object (ior.in ()) ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
+ TAO_IOP::TAO_IOR_Manipulation::_narrow (IORM.in());
+
+ CORBA::Object_var iogr = make_iogr ("Domain_1", 1, 1, orb->string_to_object (ior.in ()));
+
CORBA::String_var iorgr_string =
- orb->object_to_string (iogr.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
-
+ orb->object_to_string (iogr.in ());
+
// Output the IOR to the <ior_output_file>
FILE *output_file= ACE_OS::fopen (ior_output_file, "w");
if (output_file == 0)
@@ -214,30 +187,24 @@ main (int argc, char *argv[])
1);
ACE_OS::fprintf (output_file, "%s", iorgr_string.in ());
ACE_OS::fclose (output_file);
-
+
TAO249_ServerRequest_Interceptor2::server_iogr_ = CORBA::Object::_duplicate (iogr.in ());
-
- 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 ();
ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n"));
- root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->destroy (1, 1);
- orb->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->destroy ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Exception caught:");
+ ex._tao_print_exception ("Exception caught:");
return 1;
}
- ACE_ENDTRY;
return 0;
}