diff options
author | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-08-12 23:54:12 +0000 |
---|---|---|
committer | irfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-08-12 23:54:12 +0000 |
commit | 1b35161801c2f999ec1343a36d3e93d8fcaad594 (patch) | |
tree | 41579bdfa1ee04fac306e19db8307ca40787be28 | |
parent | 74b2748cebf44a9ba928557cf0c75c6c3763063b (diff) | |
download | ATCD-1b35161801c2f999ec1343a36d3e93d8fcaad594.tar.gz |
Fixed TAO's Private Connection feature that was not working
when the only RT policy used was the PRIVATE connection
policy.
-rw-r--r-- | TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.cpp | 15 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.h | 4 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp | 50 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.h | 34 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.i | 1 | ||||
-rw-r--r-- | TAO/tao/RTPortableServer/RT_POA.cpp | 4 |
6 files changed, 82 insertions, 26 deletions
diff --git a/TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.cpp b/TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.cpp index a87cff52a16..425c34bee14 100644 --- a/TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.cpp +++ b/TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.cpp @@ -27,8 +27,8 @@ RT_Endpoint_Selector_Factory::RT_Endpoint_Selector_Factory (void) ACE_NEW (this->bands_protocol_selector_, TAO_Bands_Protocol_Selector); - ACE_NEW (this->default_endpoint_selector_, - TAO_Default_Endpoint_Selector); + ACE_NEW (this->rt_default_endpoint_selector_, + TAO_RT_Default_Endpoint_Selector); } RT_Endpoint_Selector_Factory::~RT_Endpoint_Selector_Factory (void) @@ -38,7 +38,7 @@ RT_Endpoint_Selector_Factory::~RT_Endpoint_Selector_Factory (void) delete this->protocol_endpoint_selector_; delete this->priority_protocol_selector_; delete this->bands_protocol_selector_; - delete this->default_endpoint_selector_; + delete this->rt_default_endpoint_selector_; } TAO_Invocation_Endpoint_Selector * @@ -57,8 +57,8 @@ RT_Endpoint_Selector_Factory::get_selector (TAO_GIOP_Invocation *invocation, ACE_THROW_RETURN (CORBA::INTERNAL ( CORBA_SystemException::_tao_minor_code ( - TAO_DEFAULT_MINOR_CODE, - EINVAL), + TAO_DEFAULT_MINOR_CODE, + EINVAL), CORBA::COMPLETED_NO), 0); } @@ -97,7 +97,7 @@ RT_Endpoint_Selector_Factory::get_selector (TAO_GIOP_Invocation *invocation, } if (client_protocol_policy.ptr () == 0) - return this->default_endpoint_selector_; + return this->rt_default_endpoint_selector_; else return this->protocol_endpoint_selector_; } @@ -135,7 +135,7 @@ RT_Endpoint_Selector_Factory::get_selector (TAO_GIOP_Invocation *invocation, { // CASE 5: SERVER_DECLARED priority model, no bands. if (client_protocol_policy.ptr () == 0) - return this->default_endpoint_selector_; + return this->rt_default_endpoint_selector_; else return this->protocol_endpoint_selector_; } @@ -183,4 +183,3 @@ ACE_STATIC_SVC_DEFINE (RT_Endpoint_Selector_Factory, ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, 0) ACE_FACTORY_DEFINE (TAO_RTCORBA, RT_Endpoint_Selector_Factory) - diff --git a/TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.h b/TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.h index 43cf89279b2..9d73b7392a1 100644 --- a/TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.h +++ b/TAO/tao/RTCORBA/RT_Endpoint_Selector_Factory.h @@ -32,7 +32,7 @@ class TAO_Bands_Endpoint_Selector; class TAO_Protocol_Endpoint_Selector; class TAO_Priority_Protocol_Selector; class TAO_Bands_Protocol_Selector; -class TAO_Default_Endpoint_Selector; +class TAO_RT_Default_Endpoint_Selector; // **************************************************************** /** @@ -85,7 +85,7 @@ private: /// The possible endpoint selector strategies that can be /// returned by this factory - TAO_Default_Endpoint_Selector *default_endpoint_selector_; + TAO_RT_Default_Endpoint_Selector *rt_default_endpoint_selector_; TAO_Priority_Endpoint_Selector *priority_endpoint_selector_; TAO_Bands_Endpoint_Selector *bands_endpoint_selector_; TAO_Protocol_Endpoint_Selector *protocol_endpoint_selector_; diff --git a/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp b/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.cpp index b87c0afe729..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) { } @@ -502,5 +550,3 @@ TAO_Priority_Protocol_Selector::is_multihomed (TAO_Endpoint *endpoint) TAO_Bands_Protocol_Selector::~TAO_Bands_Protocol_Selector (void) { } - - diff --git a/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.h b/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.h index ea1e1092a83..32dee2d0702 100644 --- a/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.h +++ b/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.h @@ -30,6 +30,25 @@ #include "tao/Invocation_Endpoint_Selectors.h" /** + * @class TAO_RT_Default_Endpoint_Selector + * + * @brief TAO_RT_Default_Endpoint_Selector + * + * This strategy is used when the only policy that might be set is the + * private connection policy. + * + **/ +class TAO_RTCORBA_Export TAO_RT_Default_Endpoint_Selector : + public TAO_Default_Endpoint_Selector +{ +public: + virtual void select_endpoint (TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV); +}; + +// **************************************************************** + +/** * @class TAO_Priority_Endpoint_Selector * * @brief TAO_Priority_Endpoint_Selector @@ -49,8 +68,7 @@ public: virtual ~TAO_Priority_Endpoint_Selector (void); virtual void select_endpoint (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV = - TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV); private: /// Helper for <select_endpoint>. int is_multihomed (TAO_Endpoint *endpoint); @@ -78,8 +96,7 @@ public: virtual ~TAO_Bands_Endpoint_Selector (void); virtual void select_endpoint (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV = - TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV); }; // **************************************************************** @@ -105,15 +122,12 @@ public: virtual ~TAO_Protocol_Endpoint_Selector (void); virtual void select_endpoint (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV = - TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV); virtual void next (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV = - TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV); virtual void forward (TAO_GIOP_Invocation *invocation, const TAO_MProfile &mprofile, - CORBA::Environment &ACE_TRY_ENV = - TAO_default_environment ()); + CORBA::Environment &ACE_TRY_ENV); virtual void success (TAO_GIOP_Invocation *invocation); virtual void close_connection (TAO_GIOP_Invocation *invocation); }; diff --git a/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.i b/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.i index f38e9b32fc6..916934eb0f3 100644 --- a/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.i +++ b/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.i @@ -33,4 +33,3 @@ ACE_INLINE TAO_Bands_Protocol_Selector::TAO_Bands_Protocol_Selector (void) { } - diff --git a/TAO/tao/RTPortableServer/RT_POA.cpp b/TAO/tao/RTPortableServer/RT_POA.cpp index d8323c2007e..18432d2e5b3 100644 --- a/TAO/tao/RTPortableServer/RT_POA.cpp +++ b/TAO/tao/RTPortableServer/RT_POA.cpp @@ -108,9 +108,7 @@ TAO_RT_POA::parse_rt_policies (TAO_POA_Policy_Set &policies, priority_model->priority_model (ACE_TRY_ENV); ACE_CHECK; - this->cached_policies ().priority_model ( - TAO_POA_Cached_Policies::PriorityModel ( - rt_priority_model)); + this->cached_policies ().priority_model (TAO_POA_Cached_Policies::PriorityModel (rt_priority_model)); RTCORBA::Priority priority = priority_model->server_priority (ACE_TRY_ENV); |