summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp')
-rw-r--r--TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp49
1 files changed, 17 insertions, 32 deletions
diff --git a/TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp b/TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp
index bcf4fcfc551..6934b616a9a 100644
--- a/TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp
+++ b/TAO/orbsvcs/examples/CosEC/Simple/Consumer.cpp
@@ -25,13 +25,11 @@ 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.
@@ -45,44 +43,33 @@ Consumer::run (int argc, char* 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 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, we could use a naming service, a
// command line argument or resolve_initial_references(), but
// this is simpler...
object =
- orb->string_to_object (argv[1] ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb->string_to_object (argv[1]);
CosEventChannelAdmin::EventChannel_var event_channel =
- CosEventChannelAdmin::EventChannel::_narrow (object.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ CosEventChannelAdmin::EventChannel::_narrow (object.in ());
// The canonical protocol to connect to the EC
CosEventChannelAdmin::ConsumerAdmin_var consumer_admin =
- event_channel->for_consumers (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ event_channel->for_consumers ();
CosEventChannelAdmin::ProxyPushSupplier_var supplier =
- consumer_admin->obtain_push_supplier (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ consumer_admin->obtain_push_supplier ();
CosEventComm::PushConsumer_var consumer =
- this->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ this->_this ();
- supplier->connect_push_consumer (consumer.in () ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ supplier->connect_push_consumer (consumer.in ());
// Wait for events, using work_pending()/perform_work() may help
// or using another thread, this example is too simple for that.
@@ -95,18 +82,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))
{
this->event_count_ ++;
@@ -119,12 +104,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);
}