summaryrefslogtreecommitdiff
path: root/TAO/orbsvcs/LoadBalancer
diff options
context:
space:
mode:
authorelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-25 18:04:11 +0000
committerelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-25 18:04:11 +0000
commitc979767a00db4ea1299af482033a68829cc16675 (patch)
tree3e959cad0a053f1adad663e7c02bc7a239f383d8 /TAO/orbsvcs/LoadBalancer
parent0f3847bc7fd735ab88276fee59e2ebd6cb8d1f99 (diff)
downloadATCD-c979767a00db4ea1299af482033a68829cc16675.tar.gz
ChangeLogTag: Thu Jan 25 17:39:59 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'TAO/orbsvcs/LoadBalancer')
-rw-r--r--TAO/orbsvcs/LoadBalancer/LoadManager.cpp52
-rw-r--r--TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp69
-rw-r--r--TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.cpp11
-rw-r--r--TAO/orbsvcs/LoadBalancer/Push_Handler.cpp11
-rw-r--r--TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp14
5 files changed, 57 insertions, 100 deletions
diff --git a/TAO/orbsvcs/LoadBalancer/LoadManager.cpp b/TAO/orbsvcs/LoadBalancer/LoadManager.cpp
index f522c570e45..820cd1ff934 100644
--- a/TAO/orbsvcs/LoadBalancer/LoadManager.cpp
+++ b/TAO/orbsvcs/LoadBalancer/LoadManager.cpp
@@ -40,8 +40,7 @@ usage (const ACE_TCHAR * cmd)
void
parse_args (int argc,
ACE_TCHAR *argv[],
- int & default_strategy
- ACE_ENV_ARG_DECL)
+ int & default_strategy)
{
ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("o:s:h"));
@@ -77,7 +76,7 @@ parse_args (int argc,
default:
::usage (argv[0]);
- ACE_THROW (CORBA::BAD_PARAM ());
+ throw CORBA::BAD_PARAM ();
}
}
}
@@ -97,19 +96,17 @@ TAO_LB_run_load_manager (void * orb_arg)
// delivered to this thread on Linux.
ACE_Sig_Guard signal_guard;
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
orb->run ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_PRINT_EXCEPTION (ex,
"TAO Load Manager");
return reinterpret_cast<void *> (-1);
}
- ACE_ENDTRY;
return 0;
}
@@ -118,23 +115,19 @@ TAO_LB_run_load_manager (void * orb_arg)
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
// The usual server side boilerplate code.
CORBA::ORB_var orb = CORBA::ORB_init (argc,
argv,
- ""
- ACE_ENV_ARG_PARAMETER);
+ "");
CORBA::Object_var obj =
- orb->resolve_initial_references ("RootPOA"
- ACE_ENV_ARG_PARAMETER);
+ orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ PortableServer::POA::_narrow (obj.in ());
PortableServer::POAManager_var poa_manager =
root_poa->the_POAManager ();
@@ -150,8 +143,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// Check the non-ORB arguments.
::parse_args (argc,
argv,
- default_strategy
- ACE_ENV_ARG_PARAMETER);
+ default_strategy);
TAO_LB_LoadManager * lm = 0;
ACE_NEW_THROW_EX (lm,
@@ -167,8 +159,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// Initalize the LoadManager servant.
lm->init (orb->orb_core ()->reactor (),
orb.in (),
- root_poa.in ()
- ACE_ENV_ARG_PARAMETER);
+ root_poa.in ());
PortableGroup::Properties props (1);
props.length (1);
@@ -198,26 +189,22 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
props[0].val <<= strategy_info;
- lm->set_default_properties (props
- ACE_ENV_ARG_PARAMETER);
+ lm->set_default_properties (props);
CosLoadBalancing::LoadManager_var load_manager =
lm->_this ();
CORBA::String_var str =
- orb->object_to_string (load_manager.in ()
- ACE_ENV_ARG_PARAMETER);
+ orb->object_to_string (load_manager.in ());
// to support corbaloc
// Get a reference to the IOR table.
- CORBA::Object_var tobj = orb->resolve_initial_references ("IORTable"
- ACE_ENV_ARG_PARAMETER);
+ CORBA::Object_var tobj = orb->resolve_initial_references ("IORTable");
- IORTable::Table_var table = IORTable::Table::_narrow (tobj.in ()
- ACE_ENV_ARG_PARAMETER);
+ IORTable::Table_var table = IORTable::Table::_narrow (tobj.in ());
// bind your stringified IOR in the IOR table
- table->bind ("LoadManager", str.in () ACE_ENV_ARG_PARAMETER);
+ table->bind ("LoadManager", str.in ());
FILE * lm_ior = ACE_OS::fopen (lm_ior_file, "w");
ACE_OS::fprintf (lm_ior, "%s", str.in ());
@@ -275,18 +262,17 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
orb->destroy ();
}
-// ACE_CATCH (PortableGroup::InvalidProperty, ex)
+// catch (const PortableGroup::InvalidProperty& ex)
// {
// ACE_DEBUG ((LM_DEBUG, "Property ----> %s\n", ex.nam[0].id.in ()));
// }
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_PRINT_EXCEPTION (ex,
"TAO Load Manager");
return -1;
}
- ACE_ENDTRY;
return 0;
}
diff --git a/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp b/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp
index b309f43b49d..a23edc1bbfc 100644
--- a/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp
+++ b/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp
@@ -48,8 +48,7 @@ usage (const ACE_TCHAR * cmd)
void
parse_args (int argc,
- ACE_TCHAR *argv[]
- ACE_ENV_ARG_DECL)
+ ACE_TCHAR *argv[])
{
ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("l:k:t:s:i:m:h"));
@@ -89,7 +88,7 @@ parse_args (int argc,
ACE_TEXT ("ERROR: Invalid push interval: %s\n"),
s));
- ACE_THROW (CORBA::BAD_PARAM ());
+ throw CORBA::BAD_PARAM ();
}
break;
@@ -100,7 +99,7 @@ parse_args (int argc,
default:
::usage (argv[0]);
- ACE_THROW (CORBA::BAD_PARAM ());
+ throw CORBA::BAD_PARAM ();
}
}
}
@@ -120,19 +119,17 @@ TAO_LB_run_load_monitor (void * orb_arg)
// delivered to this thread on Linux.
ACE_Sig_Guard signal_guard;
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
orb->run ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_PRINT_EXCEPTION (ex,
"TAO Load Monitor");
return reinterpret_cast<void *> (-1);
}
- ACE_ENDTRY;
return 0;
}
@@ -141,17 +138,14 @@ TAO_LB_run_load_monitor (void * orb_arg)
CosLoadBalancing::LoadMonitor_ptr
get_load_monitor (CORBA::ORB_ptr orb,
- PortableServer::POA_ptr root_poa
- ACE_ENV_ARG_DECL)
+ PortableServer::POA_ptr root_poa)
{
if (::custom_monitor_ior != 0)
{
CORBA::Object_var obj =
- orb->string_to_object (::custom_monitor_ior
- ACE_ENV_ARG_PARAMETER);
+ orb->string_to_object (::custom_monitor_ior);
- return CosLoadBalancing::LoadMonitor::_narrow (obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ return CosLoadBalancing::LoadMonitor::_narrow (obj.in ());
}
else
{
@@ -205,8 +199,7 @@ register_load_monitor (CosLoadBalancing::LoadManager_ptr manager,
CosLoadBalancing::LoadMonitor_ptr monitor,
TAO_LB_Push_Handler * handler,
ACE_Reactor * reactor,
- long & timer_id
- ACE_ENV_ARG_DECL)
+ long & timer_id)
{
if (ACE_OS::strcasecmp (::mstyle, "PULL") == 0)
{
@@ -214,8 +207,7 @@ register_load_monitor (CosLoadBalancing::LoadManager_ptr manager,
monitor->the_location ();
manager->register_load_monitor (location.in (),
- monitor
- ACE_ENV_ARG_PARAMETER);
+ monitor);
}
else if (ACE_OS::strcasecmp (::mstyle, "PUSH") == 0)
{
@@ -232,7 +224,7 @@ register_load_monitor (CosLoadBalancing::LoadManager_ptr manager,
ACE_TEXT ("ERROR: Unable to schedule timer for ")
ACE_TEXT ("\"PUSH\" style load monitoring.\n")));
- ACE_THROW (CORBA::INTERNAL ());
+ throw CORBA::INTERNAL ();
}
}
else
@@ -242,52 +234,44 @@ register_load_monitor (CosLoadBalancing::LoadManager_ptr manager,
ACE_TEXT ("style: <%s>.\n"),
::mstyle));
- ACE_THROW (CORBA::BAD_PARAM ());
+ throw CORBA::BAD_PARAM ();
}
}
int
ACE_TMAIN (int argc, ACE_TCHAR *argv[])
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
// The usual server side boilerplate code.
CORBA::ORB_var orb = CORBA::ORB_init (argc,
argv,
- ""
- ACE_ENV_ARG_PARAMETER);
+ "");
// Check the non-ORB arguments.
::parse_args (argc,
- argv
- ACE_ENV_ARG_PARAMETER);
+ argv);
CORBA::Object_var obj =
- orb->resolve_initial_references ("RootPOA"
- ACE_ENV_ARG_PARAMETER);
+ orb->resolve_initial_references ("RootPOA");
PortableServer::POA_var root_poa =
- PortableServer::POA::_narrow (obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ PortableServer::POA::_narrow (obj.in ());
CosLoadBalancing::LoadMonitor_var load_monitor =
::get_load_monitor (orb.in (),
- root_poa.in ()
- ACE_ENV_ARG_PARAMETER);
+ root_poa.in ());
PortableGroup::Location_var location =
load_monitor->the_location ();
// The "LoadManager" reference should have already been
// registered with the ORB by its ORBInitializer.
- obj = orb->resolve_initial_references ("LoadManager"
- ACE_ENV_ARG_PARAMETER);
+ obj = orb->resolve_initial_references ("LoadManager");
CosLoadBalancing::LoadManager_var load_manager =
- CosLoadBalancing::LoadManager::_narrow (obj.in ()
- ACE_ENV_ARG_PARAMETER);
+ CosLoadBalancing::LoadManager::_narrow (obj.in ());
// This "push" handler will only be used if the load monitor
// style is "PUSH".
@@ -303,8 +287,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
load_monitor.in (),
&push_handler,
reactor,
- timer_id
- ACE_ENV_ARG_PARAMETER);
+ timer_id);
CosLoadBalancing::LoadManager_ptr tmp;;
@@ -345,8 +328,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
// load monitoring case.
if (timer_id == -1)
{
- load_manager->remove_load_monitor (location.in ()
- ACE_ENV_ARG_PARAMETER);
+ load_manager->remove_load_monitor (location.in ());
}
#else
// Activate/register the signal handler that (attempts) to
@@ -384,14 +366,13 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
orb->destroy ();
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_PRINT_EXCEPTION (ex,
"TAO Load Monitor");
return -1;
}
- ACE_ENDTRY;
return 0;
}
diff --git a/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.cpp b/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.cpp
index 64a76141ddd..78dedf29364 100644
--- a/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.cpp
+++ b/TAO/orbsvcs/LoadBalancer/Monitor_Signal_Handler.cpp
@@ -21,20 +21,18 @@ TAO_LB_Monitor_Signal_Handler::TAO_LB_Monitor_Signal_Handler (
int
TAO_LB_Monitor_Signal_Handler::perform_cleanup (int signum)
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
// Deregister the LoadMonitor from the LoadManager in the PULL
// load monitoring case.
if (!CORBA::is_nil (this->load_manager_.in ()))
{
- this->load_manager_->remove_load_monitor (this->location_
- ACE_ENV_ARG_PARAMETER);
+ this->load_manager_->remove_load_monitor (this->location_);
}
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_PRINT_EXCEPTION (ex,
"Caught exception");
ACE_ERROR_RETURN ((LM_ERROR,
@@ -43,7 +41,6 @@ TAO_LB_Monitor_Signal_Handler::perform_cleanup (int signum)
signum),
-1);
}
- ACE_ENDTRY;
return this->TAO_LB_Signal_Handler::perform_cleanup (signum);
}
diff --git a/TAO/orbsvcs/LoadBalancer/Push_Handler.cpp b/TAO/orbsvcs/LoadBalancer/Push_Handler.cpp
index ef5085cccb6..45c866503ef 100644
--- a/TAO/orbsvcs/LoadBalancer/Push_Handler.cpp
+++ b/TAO/orbsvcs/LoadBalancer/Push_Handler.cpp
@@ -23,8 +23,7 @@ TAO_LB_Push_Handler::handle_timeout (
const ACE_Time_Value & /* current_time */,
const void * /* arg */)
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
CosLoadBalancing::LoadList_var loads =
this->monitor_->loads ();
@@ -37,19 +36,17 @@ TAO_LB_Push_Handler::handle_timeout (
// loads[0].value));
this->manager_->push_loads (this->location_,
- loads.in ()
- ACE_ENV_ARG_PARAMETER);
+ loads.in ());
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
// Catch the exception and ignore it.
// @@ Yah?
if (TAO_debug_level > 0)
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_PRINT_EXCEPTION (ex,
"(%P|%t) Push_Handler::handle_timeout()\n");
}
- ACE_ENDTRY;
return 0;
}
diff --git a/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp b/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp
index 4b139aef6a1..cd1b29bc34c 100644
--- a/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp
+++ b/TAO/orbsvcs/LoadBalancer/Signal_Handler.cpp
@@ -113,24 +113,21 @@ TAO_LB_Signal_Handler::handle_signal (int signum, siginfo_t *, ucontext_t *)
int
TAO_LB_Signal_Handler::perform_cleanup (int signum)
{
- ACE_DECLARE_NEW_CORBA_ENV;
- ACE_TRY
+ try
{
// Shutdown the POA.
//
// Shutting down the POA will cause servants "owned" by the POA
// to be destroyed. Servants will then have the opportunity to
// clean up all resources they are responsible for.
- this->poa_->destroy (1, 1
- ACE_ENV_ARG_PARAMETER);
+ this->poa_->destroy (1, 1);
// Now shutdown the ORB.
- this->orb_->shutdown (1
- ACE_ENV_ARG_PARAMETER);
+ this->orb_->shutdown (1);
}
- ACE_CATCHANY
+ catch (const CORBA::Exception& ex)
{
- ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION,
+ ACE_PRINT_EXCEPTION (ex,
"Caught exception");
ACE_ERROR_RETURN ((LM_ERROR,
@@ -138,7 +135,6 @@ TAO_LB_Signal_Handler::perform_cleanup (int signum)
signum),
-1);
}
- ACE_ENDTRY;
return 0;
}