diff options
Diffstat (limited to 'TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled')
4 files changed, 44 insertions, 67 deletions
diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.cpp index 0c5e9f31e86..47a13d574c1 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.cpp +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/Basic.cpp @@ -29,37 +29,32 @@ void Basic::remove_member (void) ACE_THROW_SPEC ((CORBA::SystemException)) { - ACE_TRY + try { PortableGroup::Location location (1); location.length (1); location[0].id = CORBA::string_dup (this->location_); this->lm_->remove_member (this->object_group_.in (), - location - ACE_ENV_ARG_PARAMETER); + location); ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Removed Member at Location <%s>\n", this->location_)); } - ACE_CATCH (PortableGroup::ObjectNotFound, ex) + catch (const PortableGroup::ObjectNotFound& ex) { - ACE_PRINT_EXCEPTION (ex, - "Caught exception in remove_member"); - ACE_TRY_THROW (CORBA::INTERNAL ()); + ex._tao_print_exception ("Caught exception in remove_member"); + throw CORBA::INTERNAL (); } - ACE_CATCH (PortableGroup::MemberNotFound, ex) + catch (const PortableGroup::MemberNotFound& ex) { - ACE_PRINT_EXCEPTION (ex, - "Caught exception in remove_member"); - ACE_TRY_THROW (CORBA::INTERNAL ()); + ex._tao_print_exception ("Caught exception in remove_member"); + throw CORBA::INTERNAL (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught while destroying member\n"); + ex._tao_print_exception ("Exception caught while destroying member\n"); } - ACE_ENDTRY; } @@ -67,5 +62,5 @@ void Basic::shutdown (void) ACE_THROW_SPEC ((CORBA::SystemException)) { - this->orb_->shutdown (0 ACE_ENV_ARG_PARAMETER); + this->orb_->shutdown (0); } diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.cpp index d91fc041946..3c25251db36 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.cpp +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/LB_server.cpp @@ -17,22 +17,20 @@ LB_server::LB_server (int argc, char **argv) int LB_server::destroy (void) { - ACE_TRY_NEW_ENV + try { - this->lm_->delete_object (this->fcid_.in () - ACE_ENV_ARG_PARAMETER); + this->lm_->delete_object (this->fcid_.in ()); - this->root_poa_->destroy (1, 1 ACE_ENV_ARG_PARAMETER); + this->root_poa_->destroy (1, 1); this->orb_->destroy (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught while destroying LB_server\n"); + ex._tao_print_exception ( + "Exception caught while destroying LB_server\n"); return -1; } - ACE_ENDTRY; return 1; } @@ -76,25 +74,22 @@ LB_server::write_ior_to_file (const char *ior) int LB_server::start_orb_and_poa (void) { - ACE_DECLARE_NEW_CORBA_ENV; - ACE_TRY + try { // Initialise the ORB. this->orb_ = CORBA::ORB_init (this->argc_, this->argv_, - "" ACE_ENV_ARG_PARAMETER); + ""); CORBA::Object_var poa_object = - this->orb_->resolve_initial_references("RootPOA" - ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references("RootPOA"); if (CORBA::is_nil (poa_object.in ())) ACE_ERROR_RETURN ((LM_ERROR, " (%P|%t) Unable to initialize the POA.\n"), 1); - this->root_poa_ = PortableServer::POA::_narrow (poa_object.in () - ACE_ENV_ARG_PARAMETER); + this->root_poa_ = PortableServer::POA::_narrow (poa_object.in ()); PortableServer::POAManager_var poa_manager = this->root_poa_->the_POAManager (); @@ -102,11 +97,10 @@ LB_server::start_orb_and_poa (void) poa_manager->activate (); CORBA::Object_var obj = - this->orb_->resolve_initial_references ("LoadManager" ACE_ENV_ARG_PARAMETER); + this->orb_->resolve_initial_references ("LoadManager"); this->lm_ = - CosLoadBalancing::LoadManager::_narrow (obj.in () - ACE_ENV_ARG_PARAMETER); + CosLoadBalancing::LoadManager::_narrow (obj.in ()); if (CORBA::is_nil (this->lm_.in ())) ACE_ERROR_RETURN ((LM_ERROR, @@ -114,13 +108,11 @@ LB_server::start_orb_and_poa (void) 1); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception raised initialising ORB or POA"); + ex._tao_print_exception ("Exception raised initialising ORB or POA"); return -1; } - ACE_ENDTRY; return 1; @@ -129,7 +121,7 @@ LB_server::start_orb_and_poa (void) int LB_server::create_object_group (void) { - ACE_TRY_NEW_ENV + try { const char *repository_id = "IDL:Test/Basic:1.0"; @@ -148,22 +140,19 @@ LB_server::create_object_group (void) this->object_group_ = this->lm_->create_object (repository_id, criteria, - this->fcid_.out () - ACE_ENV_ARG_PARAMETER); + this->fcid_.out ()); CORBA::String_var ior = - this->orb_->object_to_string (this->object_group_.in () - ACE_ENV_ARG_PARAMETER); + this->orb_->object_to_string (this->object_group_.in ()); this->write_ior_to_file (ior.in ()); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception raised while creating object group"); + ex._tao_print_exception ( + "Exception raised while creating object group"); return -1; } - ACE_ENDTRY; return 1; @@ -172,7 +161,7 @@ LB_server::create_object_group (void) int LB_server::register_servant (Basic *servant, const char *loc) { - ACE_TRY_NEW_ENV + try { Test::Basic_var basic = servant->_this (); @@ -184,16 +173,13 @@ LB_server::register_servant (Basic *servant, const char *loc) this->lm_->add_member (this->object_group_.in (), location, - basic.in () - ACE_ENV_ARG_PARAMETER); + basic.in ()); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception raised while registering servant"); + ex._tao_print_exception ("Exception raised while registering servant"); return -1; } - ACE_ENDTRY; return 1; } diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/client.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/client.cpp index a87be7e3a74..212ed2b2c70 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/client.cpp +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/client.cpp @@ -36,19 +36,19 @@ parse_args (int argc, char *argv[]) int main (int argc, char *argv[]) { - ACE_TRY_NEW_ENV + try { CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + CORBA::ORB_init (argc, argv, ""); if (parse_args (argc, argv) != 0) return 1; CORBA::Object_var tmp = - orb->string_to_object (ior ACE_ENV_ARG_PARAMETER); + orb->string_to_object (ior); Test::Basic_var basic = - Test::Basic::_narrow (tmp.in () ACE_ENV_ARG_PARAMETER); + Test::Basic::_narrow (tmp.in ()); if (CORBA::is_nil (basic.in ())) { @@ -73,13 +73,11 @@ main (int argc, char *argv[]) orb->destroy (); } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught in client.cpp:"); + ex._tao_print_exception ("Exception caught in client.cpp:"); return 1; } - ACE_ENDTRY; return 0; } diff --git a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/server.cpp b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/server.cpp index 240e4e281a1..426e83d82b1 100644 --- a/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/server.cpp +++ b/TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/server.cpp @@ -8,7 +8,7 @@ ACE_RCSID (Application_Controlled, int main (int argc, char *argv[]) { - ACE_TRY_NEW_ENV + try { const char *location1 = "MyLocation 1"; const char *location2 = "MyLocation 2"; @@ -99,13 +99,11 @@ main (int argc, char *argv[]) return 1; } - ACE_CATCHANY + catch (const CORBA::Exception& ex) { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "lb_server exception"); + ex._tao_print_exception ("lb_server exception"); return 1; } - ACE_ENDTRY; return 0; } |