diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2002-08-16 17:02:24 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2002-08-16 17:02:24 +0000 |
commit | fcaed6e4d4c13e70c1456ea9ceb7015cf579bca5 (patch) | |
tree | 432d72353d933e238373287ac00bdf0d74ff2b52 | |
parent | 09d60beefa8a22e70a2f389c908a948ab1d9fee8 (diff) | |
download | ATCD-fcaed6e4d4c13e70c1456ea9ceb7015cf579bca5.tar.gz |
ChangeLogTag:Fri Aug 16 09:43:03 2002 Ossama Othman <ossama@uci.edu>
-rw-r--r-- | TAO/ChangeLog | 19 | ||||
-rw-r--r-- | TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp | 7 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp | 4 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp | 143 |
4 files changed, 94 insertions, 79 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 2b34af9d0a3..755f53e4eed 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,22 @@ +Fri Aug 16 09:43:03 2002 Ossama Othman <ossama@uci.edu> + + * orbsvcs/LoadBalancer/LoadMonitor.cpp: + + Removed unused "monitor_ior_file" variable. Fixes a + compile-time warning. + + * orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp (loads): + + Fixed an "unreachable code" warning. + + * tao/RTCORBA/RT_Protocols_Hooks.cpp (get_dscp_codepoint): + + Do not print exception if debugging output is not enabled. + Libraries should not print debugging information unless + configured to do so. + + Fixed "statement is unreachable" warning. + Fri Aug 16 09:12:48 2002 Ossama Othman <ossama@uci.edu> * orbsvcs/orbsvcs/PortableGroup/POA_Hooks.h (TAO_POA_Hooks): diff --git a/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp b/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp index c76e4e3280c..bdac3d44b17 100644 --- a/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp +++ b/TAO/orbsvcs/LoadBalancer/LoadMonitor.cpp @@ -17,7 +17,6 @@ static const char * location_kind = 0; static const char * mtype = "CPU"; static const char * mstyle = "PUSH"; static const char * custom_monitor_ior = 0; -static const char * monitor_ior_file = "monitor.ior"; static long push_interval = 15; void @@ -44,7 +43,7 @@ parse_args (int argc, ACE_TCHAR *argv[] ACE_ENV_ARG_DECL) { - ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("l:k:t:s:i:m:o:h")); + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT ("l:k:t:s:i:m:h")); int c = 0; const char * s; @@ -57,10 +56,6 @@ parse_args (int argc, ::custom_monitor_ior = get_opts.opt_arg (); break; - case 'o': - ::monitor_ior_file = get_opts.opt_arg (); - break; - case 'l': ::location_id = get_opts.opt_arg (); break; diff --git a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp index 1dbea1b2b54..0ed902b46c8 100644 --- a/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp +++ b/TAO/orbsvcs/orbsvcs/LoadBalancing/LB_CPU_Monitor.cpp @@ -115,6 +115,8 @@ TAO_LB_CPU_Monitor::loads (ACE_ENV_SINGLE_ARG_DECL) #endif +#if defined (WINDOWS) || defined (linux) + CosLoadBalancing::LoadList * tmp; ACE_NEW_THROW_EX (tmp, CosLoadBalancing::LoadList (1), @@ -133,4 +135,6 @@ TAO_LB_CPU_Monitor::loads (ACE_ENV_SINGLE_ARG_DECL) load_list[0].value = load; return load_list._retn (); + +#endif /* WINDOWS || linux */ } diff --git a/TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp b/TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp index 6daee4c4192..7332454b776 100644 --- a/TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp +++ b/TAO/tao/RTCORBA/RT_Protocols_Hooks.cpp @@ -8,7 +8,6 @@ #include "tao/Acceptor_Registry.h" #include "tao/Thread_Lane_Resources.h" #include "tao/Protocol_Factory.h" -//#include "tao/Pluggable.h" #include "tao/Transport_Acceptor.h" #include "tao/Transport_Connector.h" #include "Priority_Mapping_Manager.h" @@ -17,20 +16,19 @@ #include "ace/Dynamic_Service.h" -ACE_RCSID (TAO, + +ACE_RCSID (RTCORBA, RT_Protocols_Hooks, "$Id$") - TAO_RT_Protocols_Hooks::Client_Protocols_Hook TAO_RT_Protocols_Hooks::client_protocols_hook_ = 0; +TAO_RT_Protocols_Hooks::Client_Protocols_Hook TAO_RT_Protocols_Hooks::client_protocols_hook_ = 0; TAO_RT_Protocols_Hooks::Server_Protocols_Hook TAO_RT_Protocols_Hooks::server_protocols_hook_ = 0; -/// constructor TAO_RT_Protocols_Hooks::TAO_RT_Protocols_Hooks (void) { } -/// destructor TAO_RT_Protocols_Hooks::~TAO_RT_Protocols_Hooks (void) { } @@ -40,7 +38,7 @@ TAO_RT_Protocols_Hooks::init_hooks (TAO_ORB_Core *orb_core ACE_ENV_ARG_DECL) { this->orb_core_ = orb_core; - + // Save a reference to the priority mapping manager. CORBA::Object_var obj = orb_core->object_ref_table ().resolve_initial_references (TAO_OBJID_PRIORITYMAPPINGMANAGER @@ -57,12 +55,12 @@ TAO_RT_Protocols_Hooks::init_hooks (TAO_ORB_Core *orb_core orb_core->object_ref_table ().resolve_initial_references (TAO_OBJID_NETWORKPRIORITYMAPPINGMANAGER ACE_ENV_ARG_PARAMETER); ACE_CHECK; - + this->network_mapping_manager_ = TAO_Network_Priority_Mapping_Manager::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; - + } int @@ -123,7 +121,7 @@ TAO_RT_Protocols_Hooks::set_server_protocols_hook (Server_Protocols_Hook hook) // Saving the hook pointer so that we can use it later when needed. } -int +int TAO_RT_Protocols_Hooks::update_client_protocol_properties (TAO_Stub *stub, TAO_Connection_Handler *connection_handler, const char *protocol_type) @@ -139,29 +137,29 @@ TAO_RT_Protocols_Hooks::update_client_protocol_properties (TAO_Stub *stub, TAO_RT_Stub *rt_stub = ACE_dynamic_cast (TAO_RT_Stub *, stub); - + CORBA::Policy* policy = rt_stub->client_protocol (); - + RTCORBA::ClientProtocolPolicy_var client_protocols_policy; TAO_ClientProtocolPolicy *client_protocols = 0; - + if (!CORBA::is_nil (policy)) { client_protocols_policy = RTCORBA::ClientProtocolPolicy::_narrow (policy ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + client_protocols = ACE_dynamic_cast (TAO_ClientProtocolPolicy *, client_protocols_policy.in ()); - + if (client_protocols != 0) { //TAO_ClientProtocolPolicy RTCORBA::ProtocolList & protocols = client_protocols->protocols_rep (); - + for (CORBA::ULong j = 0; j < protocols.length (); ++j) { if (protocols[j].protocol_type == TAO_TAG_IIOP_PROFILE) @@ -171,22 +169,22 @@ TAO_RT_Protocols_Hooks::update_client_protocol_properties (TAO_Stub *stub, protocols[j].transport_protocol_properties.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + if (ACE_OS::strcmp (protocol_type, "iiop") == 0) break; } } } - + if (ACE_OS::strcmp (protocol_type, "iiop") == 0) { - if (!CORBA::is_nil (properties.in ())) + if (!CORBA::is_nil (properties.in ())) { RTCORBA::TCPProtocolProperties_var tcp_properties = RTCORBA::TCPProtocolProperties::_narrow (properties.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + int send_buffer_size = tcp_properties->send_buffer_size (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -210,13 +208,13 @@ TAO_RT_Protocols_Hooks::update_client_protocol_properties (TAO_Stub *stub, } } } - } + } ACE_CATCHANY { if (TAO_debug_level > 4) ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_RT_Protocols_Hooks::get_effective_client_protocol_properties"); - + return -1; } ACE_ENDTRY; @@ -224,41 +222,41 @@ TAO_RT_Protocols_Hooks::update_client_protocol_properties (TAO_Stub *stub, return 0; } -int +int TAO_RT_Protocols_Hooks::update_server_protocol_properties (CORBA::Policy *policy, TAO_Connection_Handler *connection_handler, const char *protocol_type) { - + if (TAO_debug_level) ACE_DEBUG ((LM_DEBUG, "TAO_RT_Protocols_Hooks::get_effective_server_protocol_properties\n")); - + ACE_TRY_NEW_ENV { RTCORBA::ProtocolProperties_var properties = RTCORBA::ProtocolProperties::_nil (); - + RTCORBA::ServerProtocolPolicy_var server_protocols_policy; TAO_ServerProtocolPolicy *server_protocols = 0; - + if (!CORBA::is_nil (policy)) { server_protocols_policy = RTCORBA::ServerProtocolPolicy::_narrow (policy ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + server_protocols = ACE_dynamic_cast (TAO_ServerProtocolPolicy *, server_protocols_policy.in ()); - + if (server_protocols != 0) { //TAO_ServerProtocolPolicy RTCORBA::ProtocolList & protocols = server_protocols->protocols_rep (); - + for (CORBA::ULong j = 0; j < protocols.length (); ++j) { if (protocols[j].protocol_type == TAO_TAG_IIOP_PROFILE) @@ -268,22 +266,22 @@ TAO_RT_Protocols_Hooks::update_server_protocol_properties (CORBA::Policy *policy protocols[j].transport_protocol_properties.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + if (ACE_OS::strcmp (protocol_type, "iiop") == 0) break; } } } - + if (ACE_OS::strcmp (protocol_type, "iiop") == 0) { - if (!CORBA::is_nil (properties.in ())) + if (!CORBA::is_nil (properties.in ())) { RTCORBA::TCPProtocolProperties_var tcp_properties = RTCORBA::TCPProtocolProperties::_narrow (properties.in () ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + int send_buffer_size = tcp_properties->send_buffer_size (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; @@ -300,24 +298,24 @@ TAO_RT_Protocols_Hooks::update_server_protocol_properties (CORBA::Policy *policy ACE_dynamic_cast (TAO_IIOP_Connection_Handler *, connection_handler); - iiop_handler->update_protocol_properties (send_buffer_size, - recv_buffer_size, + iiop_handler->update_protocol_properties (send_buffer_size, + recv_buffer_size, no_delay, enable_network_priority); } } } - } + } ACE_CATCHANY { if (TAO_debug_level > 4) ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_RT_Protocols_Hooks::get_effective_client_protocol_properties"); - + return -1; } ACE_ENDTRY; - + return 0; } @@ -328,44 +326,58 @@ TAO_RT_Protocols_Hooks::get_dscp_codepoint (void) ACE_DEBUG ((LM_DEBUG, "TAO_RT_Protocols_Hooks::get_dscp_codepoint\n")); - ACE_TRY_NEW_ENV + CORBA::Long codepoint = 0; + + ACE_DECLARE_NEW_CORBA_ENV; + ACE_TRY { - // Make several invocation, changing the priority of this thread // for each. CORBA::Object_var object = - this->orb_core_->object_ref_table ().resolve_initial_references ("RTCurrent" ACE_ENV_ARG_PARAMETER); + this->orb_core_->object_ref_table ().resolve_initial_references ( + "RTCurrent" + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + RTCORBA::Current_var current = - RTCORBA::Current::_narrow (object.in () ACE_ENV_ARG_PARAMETER); + RTCORBA::Current::_narrow (object.in () + ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; - + RTCORBA::NetworkPriorityMapping *pm = this->network_mapping_manager_->mapping (); - - CORBA::Long codepoint = 0; - - CORBA::Short priority = + + CORBA::Short priority = current->the_priority (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - + if (pm->to_network (priority, codepoint) == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot convert corba priority %d to network priority\n", - priority), - -1); - return codepoint; - + { + if (TAO_debug_level > 0) + { + ACE_ERROR ((LM_ERROR, + "Cannot convert corba priority %d " + "to network priority\n", + priority)); + } + + return -1; + } } ACE_CATCHANY { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Caught exception:"); + if (TAO_debug_level > 0) + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "TAO_RT_Protocols_Hooks::get_dscp_codepoint"); + } + return -1; } ACE_ENDTRY; - return 0; + ACE_CHECK_RETURN (-1); + + return codepoint; } void @@ -725,18 +737,3 @@ ACE_STATIC_SVC_DEFINE (TAO_RT_Protocols_Hooks, #pragma instantiate ACE_Dynamic_Service<TAO_RT_Protocols_Hooks> #endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ - - - - - - - - - - - - - - - |