diff options
Diffstat (limited to 'TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp')
-rw-r--r-- | TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp | 52 |
1 files changed, 17 insertions, 35 deletions
diff --git a/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp b/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp index a25e9f67569..e474a7706d7 100644 --- a/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp +++ b/TAO/orbsvcs/examples/RtEC/IIOPGateway/EC.cpp @@ -34,8 +34,7 @@ EC::run (int argc, char* argv[]) { TAO_EC_Default_Factory::init_svcs (); - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { // First parse our command line options if (this->parse_args(argc, argv) != 0) @@ -45,41 +44,32 @@ EC::run (int argc, char* argv[]) // ORB initialization boiler plate... CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CORBA::ORB_init (argc, argv, ""); CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + orb->resolve_initial_references ("RootPOA"); PortableServer::POA_var rootpoa = - PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + PortableServer::POA::_narrow (object.in ()); PortableServer::POAManager_var root_poa_manager = - rootpoa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + rootpoa->the_POAManager (); // Create persistent POA CORBA::PolicyList policies (2); policies.length (2); policies[0] = - rootpoa->create_id_assignment_policy (PortableServer::USER_ID - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + rootpoa->create_id_assignment_policy (PortableServer::USER_ID); policies[1] = - rootpoa->create_lifespan_policy (PortableServer::PERSISTENT - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + rootpoa->create_lifespan_policy (PortableServer::PERSISTENT); ACE_CString poaname = "POA"; PortableServer::POA_var child_poa_ = rootpoa->create_POA (poaname.c_str (), root_poa_manager.in (), - policies - ACE_ENV_ARG_PARAMETER); + policies); // Create a local event channel and register it with the RootPOA. TAO_EC_Event_Channel_Attributes attributes (rootpoa.in (), rootpoa.in ()); @@ -91,23 +81,18 @@ EC::run (int argc, char* argv[]) PortableServer::ObjectId_var ecId = PortableServer::string_to_ObjectId(ecname); - child_poa_->activate_object_with_id(ecId.in(), &ec_impl ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + child_poa_->activate_object_with_id(ecId.in(), &ec_impl); - CORBA::Object_var ec_obj = child_poa_->id_to_reference(ecId.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CORBA::Object_var ec_obj = child_poa_->id_to_reference(ecId.in()); RtecEventChannelAdmin::EventChannel_var ec = - RtecEventChannelAdmin::EventChannel::_narrow(ec_obj.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + RtecEventChannelAdmin::EventChannel::_narrow(ec_obj.in()); // Find the Naming Service. - object = orb->resolve_initial_references("NameService" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + object = orb->resolve_initial_references("NameService"); CosNaming::NamingContextExt_var naming_context = - CosNaming::NamingContextExt::_narrow(object.in() ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CosNaming::NamingContextExt::_narrow(object.in()); // Create a name. CosNaming::Name name; @@ -116,22 +101,19 @@ EC::run (int argc, char* argv[]) name[0].kind = CORBA::string_dup (""); // Register with the name server - naming_context->rebind (name, ec.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + naming_context->rebind (name, ec.in ()); - root_poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + root_poa_manager->activate (); // Wait for events, using work_pending()/perform_work() may help // or using another thread, this example is too simple for that. orb->run (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "EC::run"); + ex._tao_print_exception ("EC::run"); return 1; } - ACE_ENDTRY; return 0; } |