summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/tests/Security/BiDirectional/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/tests/Security/BiDirectional/server.cpp')
-rw-r--r--TAO/orbsvcs/tests/Security/BiDirectional/server.cpp57
1 files changed, 18 insertions, 39 deletions
diff --git a/TAO/orbsvcs/tests/Security/BiDirectional/server.cpp b/TAO/orbsvcs/tests/Security/BiDirectional/server.cpp
index 44ddec21390..2014504133c 100644
--- a/TAO/orbsvcs/tests/Security/BiDirectional/server.cpp
+++ b/TAO/orbsvcs/tests/Security/BiDirectional/server.cpp
@@ -43,15 +43,13 @@ parse_args (int argc, char *argv[])
int
main (int argc, char *argv[])
{
- ACE_TRY_NEW_ENV
+ try
{
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");
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -59,12 +57,10 @@ main (int argc, char *argv[])
1);
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (poa_object.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ PortableServer::POA::_narrow (poa_object.in ());
PortableServer::POAManager_var poa_manager =
- root_poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->the_POAManager ();
// Policies for the childPOA to be created.
CORBA::PolicyList policies (1);
@@ -74,9 +70,7 @@ main (int argc, char *argv[])
pol <<= BiDirPolicy::BOTH;
policies[0] =
orb->create_policy (BiDirPolicy::BIDIRECTIONAL_POLICY_TYPE,
- pol
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ pol);
// Create POA as child of RootPOA with the above policies. This POA
// will receive request in the same connection in which it sent
@@ -84,21 +78,17 @@ main (int argc, char *argv[])
PortableServer::POA_var child_poa =
root_poa->create_POA ("childPOA",
poa_manager.in (),
- policies
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ policies);
// Creation of childPOA is over. Destroy the Policy objects.
for (CORBA::ULong i = 0;
i < policies.length ();
++i)
{
- policies[i]->destroy (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ policies[i]->destroy ();
}
- poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ poa_manager->activate ();
if (parse_args (argc, argv) != 0)
return 1;
@@ -110,18 +100,13 @@ main (int argc, char *argv[])
PortableServer::string_to_ObjectId ("simple_server");
child_poa->activate_object_with_id (id.in (),
- &server_impl
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ &server_impl);
CORBA::Object_var obj =
- child_poa->id_to_reference (id.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ child_poa->id_to_reference (id.in ());
CORBA::String_var ior =
- orb->object_to_string (obj.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->object_to_string (obj.in ());
ACE_DEBUG ((LM_DEBUG, "(%P|%t) Server activated as <%s>\n", ior.in ()));
@@ -144,32 +129,26 @@ main (int argc, char *argv[])
// Just process one upcall. We know that we would get the
// clients IOR in that call.
CORBA::Boolean pending =
- orb->work_pending(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->work_pending();
if (pending)
{
- orb->perform_work(ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->perform_work();
}
// Now that hopefully we have the clients IOR, just start
// making remote calls to the client.
- retval = server_impl.call_client (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ retval = server_impl.call_client ();
}
ACE_DEBUG ((LM_DEBUG, "event loop finished\n"));
- root_poa->destroy (1, 1 ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ root_poa->destroy (1, 1);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Caught exception:");
+ ex._tao_print_exception ("Caught exception:");
return 1;
}
- ACE_ENDTRY;
return 0;
}