diff options
Diffstat (limited to 'TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp')
-rw-r--r-- | TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp | 49 |
1 files changed, 17 insertions, 32 deletions
diff --git a/TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp b/TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp index 1b102beac2f..47d97183f2a 100644 --- a/TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp +++ b/TAO/orbsvcs/examples/Log/Event/Event_Consumer.cpp @@ -27,65 +27,52 @@ 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); - ACE_TRY_CHECK; + CORBA::ORB_init (argc, argv, ""); // Do *NOT* make a copy because we don't want the ORB to outlive // the Consumer object. this->orb_ = orb.in (); CORBA::Object_var object = - orb->resolve_initial_references ("RootPOA" ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + orb->resolve_initial_references ("RootPOA"); PortableServer::POA_var poa = - PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + PortableServer::POA::_narrow (object.in ()); PortableServer::POAManager_var poa_manager = - poa->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; + poa->the_POAManager (); + poa_manager->activate (); // Obtain the event channel CORBA::Object_var naming_obj = - this->orb_->resolve_initial_references (NAMING_SERVICE_NAME - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->orb_->resolve_initial_references (NAMING_SERVICE_NAME); // Need to check return value for errors. if (CORBA::is_nil (naming_obj.in ())) ACE_THROW_RETURN (CORBA::UNKNOWN (),0); this->naming_context_ = - CosNaming::NamingContext::_narrow (naming_obj.in () ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + CosNaming::NamingContext::_narrow (naming_obj.in ()); CosNaming::Name name (1); name.length (1); name[0].id = CORBA::string_dup (EVENT_TLS_LOG_FACTORY_NAME); CORBA::Object_var obj = - this->naming_context_->resolve (name - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + this->naming_context_->resolve (name); this->event_log_factory_ = - DsEventLogAdmin::EventLogFactory::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; + DsEventLogAdmin::EventLogFactory::_narrow (obj.in ()); this->supplier_ = this->event_log_factory_->obtain_push_supplier (); CosEventComm::PushConsumer_var consumer = - this->_this (ACE_ENV_SINGLE_ARG_PARAMETER); + this->_this (); - this->supplier_->connect_push_consumer (consumer.in () ACE_ENV_ARG_PARAMETER); + this->supplier_->connect_push_consumer (consumer.in ()); orb_->run (); @@ -96,18 +83,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 CORBA::Any & - ACE_ENV_ARG_DECL_NOT_USED) +Consumer::push (const CORBA::Any &) ACE_THROW_SPEC ((CORBA::SystemException)) { @@ -120,12 +105,12 @@ Consumer::push (const CORBA::Any & } void -Consumer::disconnect_push_consumer (ACE_ENV_SINGLE_ARG_DECL) +Consumer::disconnect_push_consumer (void) ACE_THROW_SPEC ((CORBA::SystemException)) { // 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); } |