summaryrefslogtreecommitdiff
path: root/TAO/tests/RTCORBA/Diffserv/server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/RTCORBA/Diffserv/server.cpp')
-rw-r--r--TAO/tests/RTCORBA/Diffserv/server.cpp56
1 files changed, 20 insertions, 36 deletions
diff --git a/TAO/tests/RTCORBA/Diffserv/server.cpp b/TAO/tests/RTCORBA/Diffserv/server.cpp
index 98035dc47ef..076f959d777 100644
--- a/TAO/tests/RTCORBA/Diffserv/server.cpp
+++ b/TAO/tests/RTCORBA/Diffserv/server.cpp
@@ -42,7 +42,7 @@ void
Test_i::shutdown (void)
ACE_THROW_SPEC ((CORBA::SystemException))
{
- this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER);
+ this->orb_->shutdown (0);
}
static const char *simple_servant_ior_file = "simple_servant.ior";
@@ -79,20 +79,17 @@ void
create_object (PortableServer::POA_ptr poa,
CORBA::ORB_ptr orb,
PortableServer::Servant servant,
- const char *filename
- ACE_ENV_ARG_DECL)
+ const char *filename)
{
// Register with poa.
PortableServer::ObjectId_var id =
- poa->activate_object (servant
- ACE_ENV_ARG_PARAMETER);
+ poa->activate_object (servant);
CORBA::Object_var object =
- poa->id_to_reference (id.in ()
- ACE_ENV_ARG_PARAMETER);
+ poa->id_to_reference (id.in ());
CORBA::String_var ior =
- orb->object_to_string (object.in () ACE_ENV_ARG_PARAMETER);
+ orb->object_to_string (object.in ());
FILE *output_file= ACE_OS::fopen (filename, "w");
ACE_OS::fprintf (output_file, "%s", ior.in ());
@@ -102,14 +99,13 @@ create_object (PortableServer::POA_ptr poa,
int
main (int argc, char *argv[])
{
- ACE_TRY_NEW_ENV
+ try
{
CORBA::Object_var object;
// ORB.
CORBA::ORB_var orb =
- CORBA::ORB_init (argc, argv, ""
- ACE_ENV_ARG_PARAMETER);
+ CORBA::ORB_init (argc, argv, "");
// Parse arguments.
if (parse_args (argc, argv) != 0)
@@ -117,11 +113,10 @@ main (int argc, char *argv[])
// RootPOA.
object =
- orb->resolve_initial_references ("RootPOA"
- ACE_ENV_ARG_PARAMETER);
+ orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER);
+ PortableServer::POA::_narrow (object.in ());
// POAManager.
PortableServer::POAManager_var poa_manager =
@@ -134,16 +129,13 @@ main (int argc, char *argv[])
create_object (root_poa.in (),
orb.in (),
&servant,
- simple_servant_ior_file
- ACE_ENV_ARG_PARAMETER);
+ simple_servant_ior_file);
object =
- orb->resolve_initial_references ("NetworkPriorityMappingManager"
- ACE_ENV_ARG_PARAMETER);
+ orb->resolve_initial_references ("NetworkPriorityMappingManager");
RTCORBA::NetworkPriorityMappingManager_var mapping_manager =
- RTCORBA::NetworkPriorityMappingManager::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
+ RTCORBA::NetworkPriorityMappingManager::_narrow (object.in ());
Custom_Network_Priority_Mapping *cnpm = 0;
ACE_NEW_RETURN (cnpm,
@@ -156,12 +148,10 @@ main (int argc, char *argv[])
// RTORB.
object =
- orb->resolve_initial_references ("RTORB"
- ACE_ENV_ARG_PARAMETER);
+ orb->resolve_initial_references ("RTORB");
RTCORBA::RTORB_var rt_orb =
- RTCORBA::RTORB::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
+ RTCORBA::RTORB::_narrow (object.in ());
// Set transport protocol properties
RTCORBA::TCPProtocolProperties_var tcp_properties =
@@ -170,8 +160,7 @@ main (int argc, char *argv[])
1,
0,
1,
- 1
- ACE_ENV_ARG_PARAMETER);
+ 1);
RTCORBA::ProtocolList protocols;
protocols.length (1);
@@ -185,22 +174,19 @@ main (int argc, char *argv[])
policy_list.length (1);
policy_list[0] =
- rt_orb->create_server_protocol_policy (protocols
- ACE_ENV_ARG_PARAMETER);
+ rt_orb->create_server_protocol_policy (protocols);
// Create POA with Diffserv enabled
PortableServer::POA_var poa_with_diffserv =
root_poa->create_POA ("POA_WITH_DS",
poa_manager.in (),
- policy_list
- ACE_ENV_ARG_PARAMETER);
+ policy_list);
// Create object 2.
create_object (poa_with_diffserv.in (),
orb.in (),
&servant,
- diffserv_servant_ior_file
- ACE_ENV_ARG_PARAMETER);
+ diffserv_servant_ior_file);
// Activate POA manager.
poa_manager->activate ();
@@ -210,13 +196,11 @@ main (int argc, char *argv[])
ACE_DEBUG ((LM_DEBUG, "Server ORB event loop finished\n\n"));
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
- "Unexpected exception caught:");
+ ex._tao_print_exception ("Unexpected exception caught:");
return -1;
}
- ACE_ENDTRY;
return 0;
}