diff options
author | yamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-08-07 05:20:19 +0000 |
---|---|---|
committer | yamuna <yamuna@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2002-08-07 05:20:19 +0000 |
commit | fa95e8dff2f1dde7b90bf015b942a14c4cbc06eb (patch) | |
tree | b72a99fdf107daf127fc6492aeb9c47700f9422f /TAO/tao/RTPortableServer | |
parent | 81d1e89e478c4dea7312d39def9bc894f14c2d6a (diff) | |
download | ATCD-fa95e8dff2f1dde7b90bf015b942a14c4cbc06eb.tar.gz |
ChangelogTag: Wed Aug 7 24:35:45 2002 Yamuna Krishnamurthy <yamuna@oomworks.com>
Diffstat (limited to 'TAO/tao/RTPortableServer')
-rw-r--r-- | TAO/tao/RTPortableServer/RT_POA.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/RTPortableServer/RT_POA.h | 2 | ||||
-rw-r--r-- | TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp | 51 | ||||
-rw-r--r-- | TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h | 5 |
4 files changed, 68 insertions, 6 deletions
diff --git a/TAO/tao/RTPortableServer/RT_POA.cpp b/TAO/tao/RTPortableServer/RT_POA.cpp index bb73f5a0c6e..a5d99278519 100644 --- a/TAO/tao/RTPortableServer/RT_POA.cpp +++ b/TAO/tao/RTPortableServer/RT_POA.cpp @@ -906,6 +906,22 @@ TAO_RT_POA::id (ACE_ENV_SINGLE_ARG_DECL) return this->TAO_POA::id (ACE_ENV_SINGLE_ARG_PARAMETER); } +CORBA::Policy * +TAO_RT_POA::server_protocol (void) +{ + CORBA::Policy *result = + this->policies ().get_cached_policy (TAO_CACHED_POLICY_RT_SERVER_PROTOCOL); + + if (result == 0) + { + TAO_Policy_Manager *policy_manager = + this->orb_core_.policy_manager (); + if (policy_manager != 0) + result = policy_manager->get_cached_policy (TAO_CACHED_POLICY_RT_SERVER_PROTOCOL); + } + return result; +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) diff --git a/TAO/tao/RTPortableServer/RT_POA.h b/TAO/tao/RTPortableServer/RT_POA.h index b39a0f553bf..7638c55aec9 100644 --- a/TAO/tao/RTPortableServer/RT_POA.h +++ b/TAO/tao/RTPortableServer/RT_POA.h @@ -270,6 +270,8 @@ public: void *thread_pool (void) const; + CORBA::Policy *server_protocol (void); + protected: /// Template method for creating new POA's of this type. diff --git a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp index d0878accf2a..3e6fe63d0ea 100644 --- a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp +++ b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.cpp @@ -1,10 +1,14 @@ // @(#) $Id$ + #include "RT_Servant_Dispatcher.h" #include "RT_POA.h" #include "tao/RTCORBA/Thread_Pool.h" #include "tao/ORB_Core.h" #include "tao/TAO_Server_Request.h" +#include "tao/Transport.h" +#include "tao/IIOP_Transport.h" +#include "tao/IIOP_Connection_Handler.h" #include "tao/Service_Context.h" #include "tao/Protocols_Hooks.h" #include "tao/debug.h" @@ -13,6 +17,7 @@ ACE_RCSID (RTPortableServer, RT_Servant_Dispatcher, "$Id$") + TAO_RT_Servant_Dispatcher::~TAO_RT_Servant_Dispatcher (void) { } @@ -20,11 +25,13 @@ 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_Service_Context &request_service_context, - TAO_Service_Context &reply_service_context, + 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 &reply_service_context = req.reply_service_context (); + TAO_Thread_Pool *thread_pool = (TAO_Thread_Pool *) poa.thread_pool (); @@ -60,11 +67,49 @@ 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) + { + /* + int send_buffer_size; + int recv_buffer_size; + int no_delay; + int enable_network_priority; + */ + const char protocol [] = "iiop"; + const char *protocol_type = protocol; + + TAO_RT_POA *rt_poa = ACE_dynamic_cast (TAO_RT_POA *, + &poa); + + TAO_IIOP_Transport *iiop_transport = ACE_dynamic_cast (TAO_IIOP_Transport *, + req.transport ()); + + CORBA::Policy* policy = rt_poa->server_protocol (); + + int result = + 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, + no_delay, + 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) diff --git a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h index 8f600e77152..780fed149c3 100644 --- a/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h +++ b/TAO/tao/RTPortableServer/RT_Servant_Dispatcher.h @@ -42,9 +42,8 @@ public: /// Pre_invoke remote request. void pre_invoke_remote_request (TAO_POA &poa, CORBA::Short servant_priority, - TAO_Service_Context &request_service_context, - TAO_Service_Context &reply_service_context, - TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State &pre_invoke_state + TAO_ServerRequest &req, + TAO_Object_Adapter::Servant_Upcall::Pre_Invoke_State &pre_invoke_state ACE_ENV_ARG_DECL); /// Pre_invoke collocated request. |