diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2002-08-29 22:01:37 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2002-08-29 22:01:37 +0000 |
commit | 111d3363c9e9458990ae8be0c2d069b8521ba88f (patch) | |
tree | 00440b18f8bd4b0f32d550a65f7fe59c56d680f7 /TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp | |
parent | b35bdd17c51341d5aca9c8361a2f5965820db984 (diff) | |
download | ATCD-111d3363c9e9458990ae8be0c2d069b8521ba88f.tar.gz |
ChangeLogTag:Thu Aug 29 14:48:51 2002 Ossama Othman <ossama@uci.edu>
Diffstat (limited to 'TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp')
-rw-r--r-- | TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp | 82 |
1 files changed, 45 insertions, 37 deletions
diff --git a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp index 87640e240a8..9cf01195077 100644 --- a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp +++ b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp @@ -1,6 +1,3 @@ -// @(#) $Id$ - - #include "RT_Servant_Dispatcher.h" #include "RT_POA.h" #include "tao/RTCORBA/Thread_Pool.h" @@ -13,6 +10,7 @@ #include "tao/Protocols_Hooks.h" #include "tao/debug.h" + ACE_RCSID (RTPortableServer, RT_Servant_Dispatcher, "$Id$") @@ -23,15 +21,17 @@ TAO_RT_Servant_Dispatcher::~TAO_RT_Servant_Dispatcher (void) } void -TAO_RT_Servant_Dispatcher::pre_invoke_remote_request (TAO_POA &poa, - CORBA::Short servant_priority, - TAO_ServerRequest &req, - TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State &pre_invoke_state - ACE_ENV_ARG_DECL) +TAO_RT_Servant_Dispatcher::pre_invoke_remote_request ( + TAO_POA &poa, + CORBA::Short servant_priority, + TAO_ServerRequest &req, + TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State &pre_invoke_state + ACE_ENV_ARG_DECL) { - TAO_Service_Context &request_service_context = req.request_service_context (); + TAO_Service_Context &request_service_context = + req.request_service_context (); TAO_Service_Context &reply_service_context = req.reply_service_context (); - + TAO_Thread_Pool *thread_pool = (TAO_Thread_Pool *) poa.thread_pool (); @@ -57,7 +57,8 @@ TAO_RT_Servant_Dispatcher::pre_invoke_remote_request (TAO_POA &poa, ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("Using thread pool with lane ") - ACE_TEXT ("(%P|%t|%d|%d): original thread CORBA/native priority %d/%d not changed\n"), + ACE_TEXT ("(%P|%t|%d|%d): original thread ") + ACE_TEXT ("CORBA/native priority %d/%d not changed\n"), lane->pool ().id (), lane->id (), lane->lane_priority (), @@ -67,15 +68,13 @@ TAO_RT_Servant_Dispatcher::pre_invoke_remote_request (TAO_POA &poa, return; } - - // Remember current thread's priority. TAO_Protocols_Hooks *tph = poa.orb_core ().get_protocols_hooks (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_CHECK; - - - if (req.transport ()->tag () == TAO_TAG_IIOP_PROFILE) + + + if (req.transport ()->tag () == IOP::TAG_INTERNET_IOP) { /* int send_buffer_size; @@ -85,20 +84,23 @@ TAO_RT_Servant_Dispatcher::pre_invoke_remote_request (TAO_POA &poa, */ const char protocol [] = "iiop"; const char *protocol_type = protocol; - - TAO_IIOP_Transport *iiop_transport = ACE_dynamic_cast (TAO_IIOP_Transport *, - req.transport ()); - + + TAO_IIOP_Transport *iiop_transport = + ACE_dynamic_cast (TAO_IIOP_Transport *, + req.transport ()); + CORBA::Policy* policy = poa.server_protocol (); - + int result = - tph->update_server_protocol_properties (policy, - iiop_transport-> connection_handler_i (), - protocol_type); + tph->update_server_protocol_properties ( + policy, + iiop_transport-> connection_handler_i (), + protocol_type); + if (result != 0) ACE_ERROR((LM_ERROR, "Error in getting the effective protocol properties\n")); - + /* iiop_transport ()->connection_handler ()->update_protocol_properties (send_buffer_size, recv_buffer_size, @@ -106,12 +108,12 @@ TAO_RT_Servant_Dispatcher::pre_invoke_remote_request (TAO_POA &poa, enable_network_priority); */ } - - if (tph->get_thread_CORBA_and_native_priority (pre_invoke_state.original_CORBA_priority_, - pre_invoke_state.original_native_priority_ - ACE_ENV_ARG_PARAMETER) - == -1) - ACE_THROW (CORBA::DATA_CONVERSION (1, + + if (tph->get_thread_CORBA_and_native_priority ( + pre_invoke_state.original_CORBA_priority_, + pre_invoke_state.original_native_priority_ + ACE_ENV_ARG_PARAMETER) == -1) + ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO)); const char *priority_model; @@ -193,7 +195,8 @@ TAO_RT_Servant_Dispatcher::pre_invoke_remote_request (TAO_POA &poa, if (tph->set_thread_CORBA_priority (target_priority ACE_ENV_ARG_PARAMETER) == -1) - ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); + ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 2, + CORBA::COMPLETED_NO)); pre_invoke_state.state_ = TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State::PRIORITY_RESET_REQUIRED; @@ -295,7 +298,7 @@ TAO_RT_Servant_Dispatcher::pre_invoke_collocated_request (TAO_POA &poa, pre_invoke_state.original_native_priority_ ACE_ENV_ARG_PARAMETER) == -1) - ACE_THROW (CORBA::DATA_CONVERSION (1, + ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 2, CORBA::COMPLETED_NO)); // Change the priority of the current thread for the duration of @@ -305,7 +308,8 @@ TAO_RT_Servant_Dispatcher::pre_invoke_collocated_request (TAO_POA &poa, if (tph->set_thread_CORBA_priority (servant_priority ACE_ENV_ARG_PARAMETER) == -1) - ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); + ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 2, + CORBA::COMPLETED_NO)); pre_invoke_state.state_ = TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State::PRIORITY_RESET_REQUIRED; @@ -333,17 +337,21 @@ TAO_RT_Servant_Dispatcher::post_invoke (TAO_POA &poa, poa.orb_core ().get_protocols_hooks (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - if (tph->set_thread_native_priority (pre_invoke_state.original_native_priority_ + if (tph->set_thread_native_priority ( + pre_invoke_state.original_native_priority_ ACE_ENV_ARG_PARAMETER) == -1) - ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); + ACE_THROW (CORBA::DATA_CONVERSION (CORBA::OMGVMCID | 2, + CORBA::COMPLETED_NO)); ACE_TRY_CHECK; } ACE_CATCHANY { // Eat up the exception. ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "Exception caught: TAO (%P|%t) - Priority_Model_Processing::~Priority_Model_Processing"); + "Exception caught: TAO (%P|%t) - " + "Priority_Model_Processing::" + "~Priority_Model_Processing"); } ACE_ENDTRY; } |