summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp')
-rw-r--r--TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp50
1 files changed, 15 insertions, 35 deletions
diff --git a/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp b/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp
index 845ee110d77..ce42d9e6b87 100644
--- a/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp
+++ b/TAO/orbsvcs/examples/CosEC/Factory/FactoryDriver.cpp
@@ -52,14 +52,11 @@ FactoryDriver::parse_args (int argc, char *argv [])
int
FactoryDriver::start (int argc, char *argv [])
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
orb_ = CORBA::ORB_init (argc,
argv,
- ""
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ "");
if (this->parse_args (argc, argv) == -1)
return -1;
@@ -70,9 +67,7 @@ FactoryDriver::start (int argc, char *argv [])
-1);
CORBA::Object_var poa_object =
- orb_->resolve_initial_references("RootPOA"
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ orb_->resolve_initial_references("RootPOA");
if (CORBA::is_nil (poa_object.in ()))
ACE_ERROR_RETURN ((LM_ERROR,
@@ -80,18 +75,14 @@ FactoryDriver::start (int argc, char *argv [])
-1);
root_poa_ =
- PortableServer::POA::_narrow (poa_object.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ PortableServer::POA::_narrow (poa_object.in ());
PortableServer::POAManager_var poa_manager =
- root_poa_->the_POAManager (ACE_ENV_SINGLE_ARG_PARAMETER);
+ root_poa_->the_POAManager ();
- ACE_TRY_CHECK;
- poa_manager->activate (ACE_ENV_SINGLE_ARG_PARAMETER);
+ poa_manager->activate ();
- ACE_TRY_CHECK;
// Initialization of the naming service.
if (naming_client_.init (orb_.in ()) != 0)
@@ -105,25 +96,20 @@ FactoryDriver::start (int argc, char *argv [])
if (factory_servant_->init (root_poa_.in (),
child_poa_name_,
- context.in ()
- ACE_ENV_ARG_PARAMETER) != 0)
+ context.in ()) != 0)
ACE_ERROR_RETURN ((LM_ERROR,
"(%P|%t) Unable to initialize "
"the factory. \n"),
1);
// activate the factory in the root poa.
- factory_ = factory_servant_->_this (ACE_ENV_SINGLE_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ factory_ = factory_servant_->_this ();
// Give the ownership to the POA.
- factory_servant_->_remove_ref (ACE_ENV_SINGLE_ARG_PARAMETER);
+ factory_servant_->_remove_ref ();
- ACE_TRY_CHECK;
CORBA::String_var
- str = orb_->object_to_string (factory_.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ str = orb_->object_to_string (factory_.in ());
ACE_DEBUG ((LM_DEBUG,
"CosEvent_Service: The Cos Event Channel Factory IOR is <%s>\n",
@@ -133,29 +119,23 @@ FactoryDriver::start (int argc, char *argv [])
name.length (1);
name[0].id = CORBA::string_dup (factoryName_);
naming_client_->rebind (name,
- factory_.in ()
- ACE_ENV_ARG_PARAMETER);
- ACE_TRY_CHECK;
+ factory_.in ());
ACE_DEBUG ((LM_DEBUG,
"Registered with the naming service as %s\n", factoryName_));
orb_->run ();
}
- ACE_CATCH (CORBA::UserException, ue)
+ catch (const CORBA::UserException& ue)
{
- ACE_PRINT_EXCEPTION (ue,
- "cosecfactory: ");
+ ue._tao_print_exception ("cosecfactory: ");
return 1;
}
- ACE_CATCH (CORBA::SystemException, se)
+ catch (const CORBA::SystemException& se)
{
- ACE_PRINT_EXCEPTION (se,
- "cosecfactory: ");
+ se._tao_print_exception ("cosecfactory: ");
return 1;
}
- ACE_ENDTRY;
- ACE_CHECK_RETURN (1);
return 0;
}