diff options
Diffstat (limited to 'TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp')
-rw-r--r-- | TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp b/TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp index 42be12fb429..8ed196efb49 100644 --- a/TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp +++ b/TAO/orbsvcs/examples/RtEC/Simple/Consumer.cpp @@ -27,28 +27,27 @@ Consumer::Consumer (void) int Consumer::run (int argc, char* argv[]) { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { // ORB initialization boiler plate... CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argc, argv, ""); // Do *NOT* make a copy because we don't want the ORB to outlive // the run() method. this->orb_ = orb.in (); CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references ("RootPOA"); PortableServer::POA_var poa = - PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); + PortableServer::POA::_narrow (object.in ()); PortableServer::POAManager_var poa_manager = poa->the_POAManager (); poa_manager->activate (); // Obtain the event channel from the naming service CORBA::Object_var naming_obj = - orb->resolve_initial_references ("NameService" ACE_ENV_ARG_PARAMETER); + orb->resolve_initial_references ("NameService"); if (CORBA::is_nil (naming_obj.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -56,18 +55,17 @@ Consumer::run (int argc, char* argv[]) 1); CosNaming::NamingContext_var naming_context = - CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER); + CosNaming::NamingContext::_narrow (naming_obj.in ()); CosNaming::Name name (1); name.length (1); name[0].id = CORBA::string_dup ("EventService"); CORBA::Object_var ec_obj = - naming_context->resolve (name ACE_ENV_ARG_PARAMETER); + naming_context->resolve (name); RtecEventChannelAdmin::EventChannel_var event_channel = - RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in () - ACE_ENV_ARG_PARAMETER); + RtecEventChannelAdmin::EventChannel::_narrow (ec_obj.in ()); // The canonical protocol to connect to the EC RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin = @@ -93,8 +91,7 @@ Consumer::run (int argc, char* argv[]) h1.type = ACE_ES_EVENT_UNDEFINED; // first free event type h1.source = ACE_ES_EVENT_SOURCE_ANY; - supplier->connect_push_consumer (consumer.in (), qos - ACE_ENV_ARG_PARAMETER); + supplier->connect_push_consumer (consumer.in (), qos); // Wait for events, using work_pending()/perform_work() may help // or using another thread, this example is too simple for that. @@ -107,18 +104,16 @@ Consumer::run (int argc, char* argv[]) // work_pending()/perform_work() to do more interesting stuff. // Check the supplier for the proper way to do cleanup. } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "Consumer::run"); + ex._tao_print_exception ("Consumer::run"); return 1; } - ACE_ENDTRY; return 0; } void -Consumer::push (const RtecEventComm::EventSet& events - ACE_ENV_ARG_DECL_NOT_USED) +Consumer::push (const RtecEventComm::EventSet& events) ACE_THROW_SPEC ((CORBA::SystemException)) { if (events.length () == 0) @@ -144,6 +139,6 @@ Consumer::disconnect_push_consumer (void) // In this example we shutdown the ORB when we disconnect from the // EC (or rather the EC disconnects from us), but this doesn't have // to be the case.... - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + this->orb_->shutdown (0); } |