diff options
Diffstat (limited to 'TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp')
-rw-r--r-- | TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp | 57 |
1 files changed, 52 insertions, 5 deletions
diff --git a/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp b/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp index 70070e94104..615c659c985 100644 --- a/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp @@ -21,6 +21,54 @@ ACE_RCSID(tao, RT_Invocation_Endpoint_Selectors, "$Id$") // **************************************************************** +void +TAO_RT_Default_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV) +{ + TAO_RT_Stub *rt_stub = + ACE_dynamic_cast (TAO_RT_Stub *, + invocation->stub ()); + + do + { + invocation->profile (invocation->stub ()->profile_in_use ()); + invocation->endpoint (invocation->profile ()->endpoint ()); + + // If known endpoint, select it. + if (invocation->endpoint () != 0) + { + int status; + if (rt_stub->private_connection ()) + { + TAO_Private_Transport_Descriptor private_desc (invocation->endpoint (), + ACE_reinterpret_cast (long, invocation->stub ())); + + status = invocation->perform_call (private_desc, ACE_TRY_ENV); + ACE_CHECK; + } + else + { + TAO_Base_Transport_Property default_desc (invocation->endpoint ()); + + status = invocation->perform_call (default_desc, ACE_TRY_ENV); + ACE_CHECK; + } + + // Check if the invocation has completed. + if (status == 1) + return; + } + } + while (invocation->stub ()->next_profile_retry () != 0); + + // If we get here, we completely failed to find an endpoint selector + // that we know how to use, so throw an exception. + ACE_THROW (CORBA::TRANSIENT (TAO_OMG_VMCID | 2, + CORBA::COMPLETED_NO)); +} + +// **************************************************************** + TAO_Priority_Endpoint_Selector::~TAO_Priority_Endpoint_Selector (void) { } @@ -37,8 +85,8 @@ TAO_Priority_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation *invocation TAO_Protocols_Hooks *tph = invocation->orb_core ()->get_protocols_hooks (ACE_TRY_ENV); ACE_CHECK; - if (tph->get_thread_CORBA_priority (client_priority, - ACE_TRY_ENV) + if (tph->get_thread_priority (client_priority, + ACE_TRY_ENV) == -1) ACE_THROW (CORBA::DATA_CONVERSION (1, CORBA::COMPLETED_NO)); @@ -204,9 +252,8 @@ TAO_Bands_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation *invocation, { // Get Client priority. - int status = - protocol_hooks->get_thread_CORBA_priority (p, // side effect - ACE_TRY_ENV); + int status = protocol_hooks->get_thread_priority (p, // side effect + ACE_TRY_ENV); ACE_CHECK; if (status == -1) { |