diff options
author | fhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-05 16:26:35 +0000 |
---|---|---|
committer | fhunleth <fhunleth@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-04-05 16:26:35 +0000 |
commit | 19b7f5041ecf02b3c9accabc7e7b733f1f5c913a (patch) | |
tree | 92bf53e0eb4d8b8b4ca6b3721196ec4d0fe0e15a /TAO/tao | |
parent | 798862dbb57bb2cde9bd16493a5172dbbbc3bce1 (diff) | |
download | ATCD-19b7f5041ecf02b3c9accabc7e7b733f1f5c913a.tar.gz |
ChangeLogTag: Thu Apr 5 11:04:52 2001 Frank Hunleth <fhunleth@cs.wustl.edu>
Diffstat (limited to 'TAO/tao')
-rw-r--r-- | TAO/tao/Endpoint_Selector_Factory.cpp | 27 | ||||
-rw-r--r-- | TAO/tao/Endpoint_Selector_Factory.h | 73 | ||||
-rw-r--r-- | TAO/tao/Invocation.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Invocation.h | 12 | ||||
-rw-r--r-- | TAO/tao/Invocation.i | 16 | ||||
-rw-r--r-- | TAO/tao/Invocation_Endpoint_Selectors.cpp | 282 | ||||
-rw-r--r-- | TAO/tao/Invocation_Endpoint_Selectors.h | 68 | ||||
-rw-r--r-- | TAO/tao/Invocation_Endpoint_Selectors.i | 10 | ||||
-rw-r--r-- | TAO/tao/Makefile | 6 | ||||
-rw-r--r-- | TAO/tao/Makefile.am | 6 | ||||
-rw-r--r-- | TAO/tao/Makefile.bor | 2 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 56 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.h | 29 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.i | 42 | ||||
-rw-r--r-- | TAO/tao/RTCORBA/README | 26 | ||||
-rw-r--r-- | TAO/tao/RT_Endpoint_Selector_Factory.cpp | 302 | ||||
-rw-r--r-- | TAO/tao/RT_Endpoint_Selector_Factory.h | 110 | ||||
-rw-r--r-- | TAO/tao/RT_Invocation_Endpoint_Selectors.cpp | 3 | ||||
-rw-r--r-- | TAO/tao/RT_Invocation_Endpoint_Selectors.h | 171 | ||||
-rw-r--r-- | TAO/tao/TAO.dsp | 16 | ||||
-rw-r--r-- | TAO/tao/TAO_Static.dsp | 20 |
21 files changed, 680 insertions, 603 deletions
diff --git a/TAO/tao/Endpoint_Selector_Factory.cpp b/TAO/tao/Endpoint_Selector_Factory.cpp new file mode 100644 index 00000000000..6d1551957f7 --- /dev/null +++ b/TAO/tao/Endpoint_Selector_Factory.cpp @@ -0,0 +1,27 @@ +// $Id$ + +#include "tao/Endpoint_Selector_Factory.h" +#include "tao/Invocation.h" + +ACE_RCSID(tao, Endpoint_Selector_Factory, "$Id$") + +TAO_Endpoint_Selector_Factory::TAO_Endpoint_Selector_Factory (void) +{ + ACE_NEW (this->default_endpoint_selector_, + TAO_Default_Endpoint_Selector); + +} + +ACE_INLINE +TAO_Endpoint_Selector_Factory::~TAO_Endpoint_Selector_Factory (void) +{ + delete this->default_endpoint_selector_; +} + + +TAO_Invocation_Endpoint_Selector * +TAO_Endpoint_Selector_Factory::get_selector (TAO_GIOP_Invocation *, + CORBA::Environment &) +{ + return this->default_endpoint_selector_; +} diff --git a/TAO/tao/Endpoint_Selector_Factory.h b/TAO/tao/Endpoint_Selector_Factory.h new file mode 100644 index 00000000000..dff1bbe0c9c --- /dev/null +++ b/TAO/tao/Endpoint_Selector_Factory.h @@ -0,0 +1,73 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file Endpoint_Selector_Factory.h + * + * $Id$ + * + * Strategies for selecting profile/endpoint from an IOR for making an + * invocation. + * + * @author Marina Spivak <marina@cs.wustl.edu> + * @author Frank Hunleth <fhunleth@cs.wustl.edu> + */ +//============================================================================= + + +#ifndef TAO_ENDPOINT_SELECTOR_FACTORY_H +#define TAO_ENDPOINT_SELECTOR_FACTORY_H +#include "ace/pre.h" + +#include "tao/corbafwd.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +class TAO_GIOP_Invocation; +class TAO_Default_Endpoint_Selector; +class TAO_Invocation_Endpoint_Selector; + +// **************************************************************** + +/** + * @class TAO_Endpoint_Selector_Factory + * + * @brief Factory for initializing <Endpoint_Selection_State> and + * obtaining appropriate <Invocation_Endpoint_Selector>. + * + * Used by Invocation classes to intialize its endpoint selection + * strategy and state based on the effective policies. + * Endpoint selection strategies are stateless objects - all the + * state they need is contained by Invocation in + * <Endpoint_Selection_State>. Thus, rather than allocating an + * endpoint selection strategy object for each Invocation, the + * factory simply returns the appropriate one from the + * set preallocated in the ORB_Core. One endpoint selection + * strategy object can be used by many invocations concurrently. + */ +class TAO_Export TAO_Endpoint_Selector_Factory +{ +public: + /// Constructor. + TAO_Endpoint_Selector_Factory (void); + + /// Destructor. + virtual ~TAO_Endpoint_Selector_Factory (void); + + /// Get an Invocation's endpoint selection strategy and + /// initialize the endpoint selection state instance. + virtual TAO_Invocation_Endpoint_Selector *get_selector ( + TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV); + +protected: + /// The possible endpoint selector strategies that can be + /// returned by this factory + + TAO_Default_Endpoint_Selector *default_endpoint_selector_; +}; + +#include "ace/post.h" +#endif /* TAO_ENDPOINT_SELECTOR_FACTORY_H */ diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index 4aaff683b55..5501e1e3694 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -23,6 +23,7 @@ #include "GIOP_Utils.h" #include "ORB_Core.h" #include "Pluggable_Messaging_Utils.h" +#include "Endpoint_Selector_Factory.h" #include "ace/Dynamic_Service.h" @@ -197,8 +198,9 @@ TAO_GIOP_Invocation::start (CORBA::Environment &ACE_TRY_ENV) // Initialize endpoint selection strategy. if (!this->is_selector_initialized_) { - this->orb_core_->endpoint_selector_factory ()->get_selector (this, - ACE_TRY_ENV); + this->endpoint_selector_ = + this->orb_core_->endpoint_selector_factory ()->get_selector (this, + ACE_TRY_ENV); ACE_CHECK; this->is_selector_initialized_ = 1; diff --git a/TAO/tao/Invocation.h b/TAO/tao/Invocation.h index 84b217935f6..c6f26b9727e 100644 --- a/TAO/tao/Invocation.h +++ b/TAO/tao/Invocation.h @@ -71,7 +71,7 @@ enum TAO_Invoke_Status */ class TAO_Export TAO_GIOP_Invocation { - friend class TAO_Endpoint_Selector_Factory; + friend class RT_Endpoint_Selector_Factory; friend class TAO_Default_Endpoint_Selector; friend class TAO_Priority_Endpoint_Selector; friend class TAO_Bands_Endpoint_Selector; @@ -152,16 +152,6 @@ public: /// give up its ownership. User must deallocate memory. CORBA::PolicyList *get_inconsistent_policies (void); -#if (TAO_HAS_RT_CORBA == 1) - - /// Get the protected variable <endpoint_selection_state_> - TAO_Endpoint_Selection_State get_endpoint_selection_state (void); - - /// Get the pointer to stub. - TAO_Stub *get_stub (void); - -#endif /* TAO_HAS_RT_CORBA == 1 */ - /** * Add the given object reference to the list of forward profiles. * This basically emulates a LOCATION_FORWARD reply from the diff --git a/TAO/tao/Invocation.i b/TAO/tao/Invocation.i index 64056d9fac2..98e1766fcfc 100644 --- a/TAO/tao/Invocation.i +++ b/TAO/tao/Invocation.i @@ -71,22 +71,6 @@ TAO_GIOP_Invocation::get_inconsistent_policies (void) return this->inconsistent_policies_._retn (); } -#if (TAO_HAS_RT_CORBA == 1) - -ACE_INLINE TAO_Endpoint_Selection_State -TAO_GIOP_Invocation::get_endpoint_selection_state (void) -{ - return this->endpoint_selection_state_; -} - -ACE_INLINE TAO_Stub * -TAO_GIOP_Invocation::get_stub (void) -{ - return this->stub_; -} - -#endif /* TAO_HAS_RT_CORBA == 1 */ - ACE_INLINE void TAO_GIOP_Invocation::location_forward_i (TAO_Stub *stubobj, CORBA::Environment &ACE_TRY_ENV) diff --git a/TAO/tao/Invocation_Endpoint_Selectors.cpp b/TAO/tao/Invocation_Endpoint_Selectors.cpp index 4b604e611dd..809e3ba3510 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/Invocation_Endpoint_Selectors.cpp @@ -15,290 +15,8 @@ ACE_RCSID(tao, Invocation_Endpoint_Selectors, "$Id$") -// **************************************************************** -void -TAO_Endpoint_Selector_Factory::get_selector (TAO_GIOP_Invocation - *invocation, - CORBA::Environment &ACE_TRY_ENV) -{ #if (TAO_HAS_RT_CORBA == 1) - // Obtains correct selector if TAO::Client_Priority_Policy is - // enabled. - this->check_client_priority_policy (invocation, - ACE_TRY_ENV); - ACE_CHECK; - - // CASE 1: TAO::Client_Priority_Policy is enabled. - if (invocation->endpoint_selector_ != 0) - return; - - // Initialize selection state with all RTCORBA policies affecting - // endpoint selection. - TAO_Endpoint_Selection_State &state = - invocation->endpoint_selection_state_; - - state.priority_model_policy_ = - invocation->stub_->exposed_priority_model (ACE_TRY_ENV); - ACE_CHECK; - - state.private_connection_ = - invocation->stub_->private_connection (); - - this->init_client_protocol (invocation, ACE_TRY_ENV); - ACE_CHECK; - this->init_bands (invocation, ACE_TRY_ENV); - ACE_CHECK; - - // - // Look at RTCORBA policies to decide on appropriate selector. - // - - // CASE 2: No PriorityModelPolicy set. - if (state.priority_model_policy_ == 0) - { - // Bands without priority model do not make sense. - if (state.bands_policy_ != 0) - { - if (invocation->inconsistent_policies_.ptr ()) - { - invocation->inconsistent_policies_->length (1); - invocation->inconsistent_policies_[0u] = - CORBA::Policy::_duplicate (state.bands_policy_); - } - ACE_THROW (CORBA::INV_POLICY ()); - } - - if (state.client_protocol_policy_ == 0) - invocation->endpoint_selector_ = - invocation->orb_core_->default_endpoint_selector (); - else - { - invocation->endpoint_selector_ = - invocation->orb_core_->protocol_endpoint_selector (); - } - return; - } - - CORBA::Boolean is_client_propagated = 0; - - // @@ This is to be used in case 3: - CORBA::Short server_priority = 0; - - invocation->orb_core_->get_protocols_hooks () ->get_selector_hook ( - state.priority_model_policy_, - is_client_propagated, - server_priority); - - if (is_client_propagated) - { - // Get client priority. - if (invocation->orb_core_->get_protocols_hooks () - ->get_thread_priority (invocation->orb_core_, - state.client_priority_, - ACE_TRY_ENV) - == -1) - ACE_THROW (CORBA::DATA_CONVERSION (1, - CORBA::COMPLETED_NO)); - } - - // CASE 3: PriorityBandedConnection Policy is set. - if (state.bands_policy_ != 0) - { - // Figure out target priority. - CORBA::Short p; - if (is_client_propagated) - p = state.client_priority_; - else - p = server_priority; - - int in_range = 0; - - invocation->orb_core_->get_protocols_hooks - ()->get_selector_bands_policy_hook (state.bands_policy_, - state.min_priority_, - state.max_priority_, - p, - in_range); - - // If priority doesn't fall into any of the bands - if (!in_range) - { - if (invocation->inconsistent_policies_.ptr ()) - { - invocation->inconsistent_policies_->length (2); - invocation->inconsistent_policies_[0u] = - CORBA::Policy::_duplicate (state.bands_policy_); - invocation->inconsistent_policies_[1u] = - CORBA::Policy::_duplicate (state.priority_model_policy_); - } - ACE_THROW (CORBA::INV_POLICY ()); - } - - // Matching band found. Instantiate appropriate selector. - if (state.client_protocol_policy_ == 0) - invocation->endpoint_selector_ = - invocation->orb_core_->bands_endpoint_selector (); - else - invocation->endpoint_selector_ = - invocation->orb_core_->bands_protocol_selector (); - - return; - } - - // CASE 4: CLIENT_PROPAGATED priority model, no bands. - if (is_client_propagated) - { - if (state.client_protocol_policy_ == 0) - invocation->endpoint_selector_ = - invocation->orb_core_->priority_endpoint_selector (); - else - invocation->endpoint_selector_ = - invocation->orb_core_->priority_protocol_selector (); - } - else - { - // CASE 5: SERVER_DECLARED priority model, no bands. - if (state.client_protocol_policy_ == 0) - invocation->endpoint_selector_ = - invocation->orb_core_->default_endpoint_selector (); - else - invocation->endpoint_selector_ = - invocation->orb_core_->protocol_endpoint_selector (); - } -#else /* TAO_HAS_RT_CORBA == 1 */ - - ACE_UNUSED_ARG (ACE_TRY_ENV); // FUZZ: ignore check_for_ace_check - - invocation->endpoint_selector_ = - invocation->orb_core_->default_endpoint_selector (); - -#endif /* TAO_HAS_RT_CORBA == 1 */ -} - -#if (TAO_HAS_RT_CORBA == 1) - -void -TAO_Endpoint_Selector_Factory:: -check_client_priority_policy (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV) -{ -#if (TAO_HAS_CLIENT_PRIORITY_POLICY == 1) - - TAO_Client_Priority_Policy *policy = - invocation->stub_->client_priority (); - - // Automatically release the policy - CORBA::Object_var auto_release = policy; - - if (policy == 0) - invocation->endpoint_selector_ = - invocation->orb_core_->default_endpoint_selector (); - - else - { - // Policy is set. - TAO::PrioritySpecification priority_spec = - policy->priority_specification (ACE_TRY_ENV); - ACE_CHECK; - - TAO::PrioritySelectionMode mode = priority_spec.mode; - - if (mode == TAO::USE_NO_PRIORITY) - // Don't care about priority - use default selector. - invocation->endpoint_selector_ = - invocation->orb_core_->default_endpoint_selector (); - else - // Care about priority - use client priority policy selector. - { - invocation->endpoint_selector_ = - invocation->orb_core_->client_priority_policy_selector (); - - // Initialize endpoint selection state. - if (mode == TAO::USE_PRIORITY_RANGE) - { - invocation->endpoint_selection_state_.min_priority_ = - priority_spec.min_priority; - invocation->endpoint_selection_state_.max_priority_ = - priority_spec.max_priority; - } - else - // mode == TAO::USE_THREAD_PRIORITY - { - CORBA::Short priority; - if (invocation->orb_core_->get_protocols_hooks - ()->get_thread_priority (invocation->orb_core_, - priority, - ACE_TRY_ENV) - == -1) - ACE_THROW (CORBA::DATA_CONVERSION (1, - CORBA::COMPLETED_NO)); - - invocation->endpoint_selection_state_.min_priority_ = - priority; - invocation->endpoint_selection_state_.max_priority_ = - priority; - } - } - } - -#else - - ACE_UNUSED_ARG (invocation); - ACE_UNUSED_ARG (ACE_TRY_ENV); // FUZZ: ignore check_for_ace_check - -#endif /* TAO_HAS_CLIENT_PRIORITY_POLICY == 1 */ -} - -void -TAO_Endpoint_Selector_Factory:: -init_client_protocol (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV) -{ - ACE_TRY - { - invocation->endpoint_selection_state_.client_protocol_policy_ = - invocation->stub_->effective_client_protocol (ACE_TRY_ENV); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::INV_POLICY, ex) - { - if (invocation->inconsistent_policies_.ptr ()) - { - invocation->inconsistent_policies_->length (1); - invocation->inconsistent_policies_[0u] = - invocation->stub_->client_protocol (); - } - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK; -} - -void -TAO_Endpoint_Selector_Factory:: -init_bands (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV) -{ - ACE_TRY - { - invocation->endpoint_selection_state_.bands_policy_ = - invocation->stub_->effective_priority_banded_connection (ACE_TRY_ENV); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::INV_POLICY, ex) - { - if (invocation->inconsistent_policies_.ptr ()) - { - invocation->inconsistent_policies_->length (1); - invocation->inconsistent_policies_[0u] = - invocation->stub_->priority_banded_connection (); - } - ACE_RE_THROW; - } - ACE_ENDTRY; - ACE_CHECK; -} TAO_Endpoint_Selection_State::~TAO_Endpoint_Selection_State (void) { diff --git a/TAO/tao/Invocation_Endpoint_Selectors.h b/TAO/tao/Invocation_Endpoint_Selectors.h index a615dfeb413..f07da2f3e26 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.h +++ b/TAO/tao/Invocation_Endpoint_Selectors.h @@ -9,7 +9,6 @@ * Strategies for selecting profile/endpoint from an IOR for making an * invocation. * - * * @author Marina Spivak <marina@cs.wustl.edu> */ //============================================================================= @@ -28,73 +27,6 @@ #include "tao/MProfile.h" class TAO_GIOP_Invocation; -class TAO_Endpoint; -class TAO_PrivateConnectionPolicy; -class TAO_PriorityModelPolicy; -class TAO_ClientProtocolPolicy; -class TAO_PriorityBandedConnectionPolicy; - -// **************************************************************** - -/** - * @class TAO_Endpoint_Selector_Factory - * - * @brief Factory for initializing <Endpoint_Selection_State> and - * obtaining appropriate <Invocation_Endpoint_Selector>. - * - * Used by Invocation classes to intialize its endpoint selection - * strategy and state based on the effective policies. - * Endpoint selection strategies are stateless objects - all the - * state they need is contained by Invocation in - * <Endpoint_Selection_State>. Thus, rather than allocating an - * endpoint selection strategy object for each Invocation, the - * factory simply returns the appropriate one from the - * set preallocated in the ORB_Core. One endpoint selection - * strategy object can be used by many invocations concurrently. - */ -class TAO_Export TAO_Endpoint_Selector_Factory -{ -public: - /// Constructor. - TAO_Endpoint_Selector_Factory (void); - - /// Destructor. - ~TAO_Endpoint_Selector_Factory (void); - - /// Initialize Invocation's endpoint selection strategy and - /// state. - void get_selector (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV = - TAO_default_environment ()); - -private: - - // = Helpers for <get_selector>. - -#if (TAO_HAS_RT_CORBA == 1) - - /** - * Gets the appropriate selector if TAO_HAS_CLIENT_PRIORITY_POLICY - * is enabled. Also initializes endpoint selection state as - * necessary. WARNING: TAO::Client_Pririority_Policy is - * deprecated. See TAO RTCORBA documentation for more details. - */ - void check_client_priority_policy (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV); - - /// Initializes RTCORBA::ClientProtocolPolicy in the endpoint - /// selection state. - void init_client_protocol (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV); - - /// Initializes RTCORBA::PriorityBandsPolicy in the endpoint - /// selection state. - void init_bands (TAO_GIOP_Invocation *invocation, - CORBA::Environment &ACE_TRY_ENV); - -#endif /* TAO_HAS_RT_CORBA == 1 */ - -}; #if (TAO_HAS_RT_CORBA == 1) diff --git a/TAO/tao/Invocation_Endpoint_Selectors.i b/TAO/tao/Invocation_Endpoint_Selectors.i index 1fc8ac1e6f2..5ed9a4cf7b4 100644 --- a/TAO/tao/Invocation_Endpoint_Selectors.i +++ b/TAO/tao/Invocation_Endpoint_Selectors.i @@ -3,16 +3,6 @@ // **************************************************************** -ACE_INLINE -TAO_Endpoint_Selector_Factory::TAO_Endpoint_Selector_Factory (void) -{ -} - -ACE_INLINE -TAO_Endpoint_Selector_Factory::~TAO_Endpoint_Selector_Factory (void) -{ -} - // **************************************************************** #if (TAO_HAS_RT_CORBA == 1) diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index 78cb0ee8ccd..70ba609fb89 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -17,7 +17,7 @@ DIRS = \ IORManipulation \ IORTable \ Strategies \ - SmartProxies + SmartProxies # These are headers for things which are exported and must be # installed. (Currently not used). @@ -236,7 +236,9 @@ ORB_CORE_FILES = \ BiDir_Adapter \ CodecFactory \ CodecFactory_ORBInitializer \ - CDR_Encaps_Codec + CDR_Encaps_Codec \ + Endpoint_Selector_Factory \ + RT_Endpoint_Selector_Factory DYNAMIC_ANY_FILES = diff --git a/TAO/tao/Makefile.am b/TAO/tao/Makefile.am index 52ff87d885a..56ec28ab513 100644 --- a/TAO/tao/Makefile.am +++ b/TAO/tao/Makefile.am @@ -182,6 +182,8 @@ ORB_CORE_FILES = \ GIOPC.cpp \ TAO_Singleton_Manager.cpp \ DLL_ORB.cpp \ + Endpoint_Selector_Factory.cpp \ + RT_Endpoint_Selector_Factory.cpp # Build a libtool library, libTAO.la for installation in libdir. lib_LTLIBRARIES = libTAO.la @@ -404,7 +406,9 @@ HEADER_FILES = \ qt_resource.h \ rtcorbafwd.h \ try_macros.h \ - xt_resource.h + xt_resource.h \ + Endpoint_Selector_Factory.h \ + RT_Endpoint_Selector_Factory.h INLINE_FILES = \ Acceptor_Impl.i \ diff --git a/TAO/tao/Makefile.bor b/TAO/tao/Makefile.bor index 99fe2ff053b..cc0cf74a805 100644 --- a/TAO/tao/Makefile.bor +++ b/TAO/tao/Makefile.bor @@ -63,6 +63,7 @@ OBJFILES = \ $(OBJDIR)\DynamicC.obj \ $(OBJDIR)\Encodable.obj \ $(OBJDIR)\Endpoint.obj \ + $(OBJDIR)\Endpoint_Selector_Factory.obj \ $(OBJDIR)\Environment.obj \ $(OBJDIR)\Exception.obj \ $(OBJDIR)\Exclusive_TMS.obj \ @@ -154,6 +155,7 @@ OBJFILES = \ $(OBJDIR)\Resource_Factory.obj \ $(OBJDIR)\RequestInfo_Util.obj \ $(OBJDIR)\RT_Current.obj \ + $(OBJDIR)\RT_Endpoint_Selector_Factory.obj \ $(OBJDIR)\RT_Invocation_Endpoint_Selectors.obj \ $(OBJDIR)\RT_Mutex.obj \ $(OBJDIR)\RT_ORB.obj \ diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 04d14f768aa..fba0b4ec0fa 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -30,9 +30,11 @@ #include "Services_Activate.h" #include "Invocation.h" #include "BiDir_Adapter.h" +#include "Endpoint_Selector_Factory.h" -#include "Invocation_Endpoint_Selectors.h" -#include "RT_Invocation_Endpoint_Selectors.h" +#if (TAO_HAS_RT_CORBA == 1) +#include "RT_Endpoint_Selector_Factory.h" +#endif /* TAO_HAS_RT_CORBA == 1 */ #include "IORInfo.h" @@ -139,14 +141,7 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) open_lock_ (), open_called_ (0), endpoint_selector_factory_ (0), - default_endpoint_selector_ (0), #if (TAO_HAS_RT_CORBA == 1) - priority_endpoint_selector_ (0), - bands_endpoint_selector_ (0), - protocol_endpoint_selector_ (0), - priority_protocol_selector_ (0), - bands_protocol_selector_ (0), - client_priority_policy_selector_ (0), rt_orb_ (), rt_current_ (), priority_mapping_manager_ (), @@ -194,34 +189,15 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) ACE_NEW (this->policy_current_, TAO_Policy_Current); +#endif /* TAO_HAS_CORBA_MESSAGING == 1 */ + +#if (TAO_HAS_RT_CORBA == 1) + ACE_NEW (this->endpoint_selector_factory_, + RT_Endpoint_Selector_Factory); +#else /* TAO_HAS_RT_CORBA == 1 */ ACE_NEW (this->endpoint_selector_factory_, TAO_Endpoint_Selector_Factory); - -#if (TAO_HAS_RT_CORBA==1) - - ACE_NEW (this->priority_endpoint_selector_, - TAO_Priority_Endpoint_Selector); - - ACE_NEW (this->bands_endpoint_selector_, - TAO_Bands_Endpoint_Selector); - - ACE_NEW (this->protocol_endpoint_selector_, - TAO_Protocol_Endpoint_Selector); - - ACE_NEW (this->priority_protocol_selector_, - TAO_Priority_Protocol_Selector); - - ACE_NEW (this->bands_protocol_selector_, - TAO_Bands_Protocol_Selector); - - ACE_NEW (this->client_priority_policy_selector_, - TAO_Client_Priority_Policy_Selector); - #endif /* TAO_HAS_RT_CORBA == 1 */ -#endif /* TAO_HAS_CORBA_MESSAGING == 1 */ - - ACE_NEW (this->default_endpoint_selector_, - TAO_Default_Endpoint_Selector); ACE_NEW (this->transport_sync_strategy_, TAO_Transport_Sync_Strategy); @@ -251,18 +227,6 @@ TAO_ORB_Core::~TAO_ORB_Core (void) #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ delete this->endpoint_selector_factory_; - delete this->default_endpoint_selector_; - -#if (TAO_HAS_RT_CORBA == 1) - - delete this->priority_endpoint_selector_; - delete this->bands_endpoint_selector_; - delete this->protocol_endpoint_selector_; - delete this->priority_protocol_selector_; - delete this->bands_protocol_selector_; - delete this->client_priority_policy_selector_; - -#endif /* TAO_HAS_RT_CORBA == 1 */ delete this->transport_sync_strategy_; } diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index a2345fb542d..9f422a14c29 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -70,14 +70,6 @@ class TAO_Profile; class TAO_GIOP_Invocation; class TAO_Endpoint_Selector_Factory; -class TAO_Invocation_Endpoint_Selector; -class TAO_Default_Endpoint_Selector; -class TAO_Priority_Endpoint_Selector; -class TAO_Bands_Endpoint_Selector; -class TAO_Protocol_Endpoint_Selector; -class TAO_Priority_Protocol_Selector; -class TAO_Bands_Protocol_Selector; -class TAO_Client_Priority_Policy_Selector; class TAO_Message_State_Factory; class TAO_ServerRequest; class TAO_Protocols_Hooks; @@ -454,18 +446,6 @@ public: //@} TAO_Endpoint_Selector_Factory *endpoint_selector_factory (void); - TAO_Default_Endpoint_Selector *default_endpoint_selector (void); - -#if (TAO_HAS_RT_CORBA == 1) - - TAO_Protocol_Endpoint_Selector *protocol_endpoint_selector (void); - TAO_Priority_Endpoint_Selector *priority_endpoint_selector (void); - TAO_Bands_Endpoint_Selector *bands_endpoint_selector (void); - TAO_Priority_Protocol_Selector *priority_protocol_selector (void); - TAO_Bands_Protocol_Selector *bands_protocol_selector (void); - TAO_Client_Priority_Policy_Selector *client_priority_policy_selector (void); - -#endif /* TAO_HAS_RT_CORBA == 1 */ #if (TAO_HAS_CORBA_MESSAGING == 1) @@ -1145,17 +1125,8 @@ protected: int open_called_; TAO_Endpoint_Selector_Factory *endpoint_selector_factory_; - TAO_Default_Endpoint_Selector* default_endpoint_selector_; #if (TAO_HAS_RT_CORBA == 1) - - TAO_Priority_Endpoint_Selector *priority_endpoint_selector_; - TAO_Bands_Endpoint_Selector *bands_endpoint_selector_; - TAO_Protocol_Endpoint_Selector *protocol_endpoint_selector_; - TAO_Priority_Protocol_Selector *priority_protocol_selector_; - TAO_Bands_Protocol_Selector *bands_protocol_selector_; - TAO_Client_Priority_Policy_Selector *client_priority_policy_selector_; - /// Implementation of RTCORBA::RTORB interface. CORBA::Object_var rt_orb_; diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index bf29a3fd249..c7cfd3e8de4 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -611,50 +611,8 @@ TAO_ORB_Core::endpoint_selector_factory (void) return this->endpoint_selector_factory_; } -ACE_INLINE TAO_Default_Endpoint_Selector * -TAO_ORB_Core::default_endpoint_selector (void) -{ - return this->default_endpoint_selector_; -} - #if (TAO_HAS_RT_CORBA == 1) -ACE_INLINE TAO_Protocol_Endpoint_Selector * -TAO_ORB_Core::protocol_endpoint_selector (void) -{ - return this->protocol_endpoint_selector_; -} - -ACE_INLINE TAO_Priority_Endpoint_Selector * -TAO_ORB_Core::priority_endpoint_selector (void) -{ - return this->priority_endpoint_selector_; -} - -ACE_INLINE TAO_Bands_Endpoint_Selector * -TAO_ORB_Core::bands_endpoint_selector (void) -{ - return this->bands_endpoint_selector_; -} - -ACE_INLINE TAO_Priority_Protocol_Selector * -TAO_ORB_Core::priority_protocol_selector (void) -{ - return this->priority_protocol_selector_; -} - -ACE_INLINE TAO_Bands_Protocol_Selector * -TAO_ORB_Core::bands_protocol_selector (void) -{ - return this->bands_protocol_selector_; -} - -ACE_INLINE TAO_Client_Priority_Policy_Selector * -TAO_ORB_Core::client_priority_policy_selector (void) -{ - return this->client_priority_policy_selector_; -} - ACE_INLINE CORBA::Object_ptr TAO_ORB_Core::rt_orb (CORBA::Environment &ACE_TRY_ENV) { diff --git a/TAO/tao/RTCORBA/README b/TAO/tao/RTCORBA/README index 9838bd392e1..9a37157b9e6 100644 --- a/TAO/tao/RTCORBA/README +++ b/TAO/tao/RTCORBA/README @@ -1,10 +1,8 @@ -RTCORBA Subsetting Plan +RTCORBA Subsetting Plan, Status, and Notes In this file, we're keeping track of the status of the subsetting of RTCORBA and its effect on TAO files. -*******YOU ARE HEREBY WARNED****** - The steps of the subsetting process are the following: 1. Separate out all TAO_HAS_RT_CORBA blocks from non RTCORBA code @@ -85,11 +83,16 @@ examples/PluggableUDP/DIOP/DIOP_Profile GIOP ---- tao/Invocation: -tao/Invocation: -tao/Invocation: tao/Invocation_Endpoint_Selectors: -tao/RT_Invocation_Endpoint_Selectors -tao/Private_Transport_Descriptor + Almost clean - some work will need to be done to handle the selector state + +tao/Private_Transport_Descriptor: + +clean: + tao/Endpoint_Selector_Factory: + tao/RT_Invocation_Endpoint_Selectors: + tao/RT_Endpoint_Selector_Factory: + Other ----- @@ -110,3 +113,12 @@ Tests tests/Exposed_policies/* tests/RTCORBA/* + +--------------------------------------------------------------------------- +RTCORBA DLL registration hooks + +The purpose of this section is to document all of the hooks that the RTCORBA +library needs to register. + +1. Invocation Endpoint Selector Factory - currently hardcoded in a + TAO_HAS_RT_CORBA block in ORB_Core.cpp diff --git a/TAO/tao/RT_Endpoint_Selector_Factory.cpp b/TAO/tao/RT_Endpoint_Selector_Factory.cpp new file mode 100644 index 00000000000..a7257a6033b --- /dev/null +++ b/TAO/tao/RT_Endpoint_Selector_Factory.cpp @@ -0,0 +1,302 @@ +// $Id$ + +#include "tao/RT_Endpoint_Selector_Factory.h" +#include "tao/RT_Invocation_Endpoint_Selectors.h" +#include "tao/Invocation.h" + +ACE_RCSID(tao, RT_Endpoint_Selector_Factory, "$Id$") + +// **************************************************************** +#if (TAO_HAS_RT_CORBA == 1) + +RT_Endpoint_Selector_Factory::RT_Endpoint_Selector_Factory (void) +{ + ACE_NEW (this->priority_endpoint_selector_, + TAO_Priority_Endpoint_Selector); + + ACE_NEW (this->bands_endpoint_selector_, + TAO_Bands_Endpoint_Selector); + + ACE_NEW (this->protocol_endpoint_selector_, + TAO_Protocol_Endpoint_Selector); + + ACE_NEW (this->priority_protocol_selector_, + TAO_Priority_Protocol_Selector); + + ACE_NEW (this->bands_protocol_selector_, + TAO_Bands_Protocol_Selector); + + ACE_NEW (this->client_priority_policy_selector_, + TAO_Client_Priority_Policy_Selector); +} + +ACE_INLINE +RT_Endpoint_Selector_Factory::~RT_Endpoint_Selector_Factory (void) +{ + delete this->priority_endpoint_selector_; + delete this->bands_endpoint_selector_; + delete this->protocol_endpoint_selector_; + delete this->priority_protocol_selector_; + delete this->bands_protocol_selector_; + delete this->client_priority_policy_selector_; +} + +TAO_Invocation_Endpoint_Selector * +RT_Endpoint_Selector_Factory::get_selector (TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV) +{ + // Obtains correct selector if TAO::Client_Priority_Policy is + // enabled. + TAO_Invocation_Endpoint_Selector *selector = + this->check_client_priority_policy (invocation, + ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + // CASE 1: TAO::Client_Priority_Policy is enabled. + if (selector != 0) + return selector; + + // Initialize selection state with all RTCORBA policies affecting + // endpoint selection. + TAO_Endpoint_Selection_State &state = + invocation->endpoint_selection_state_; + + state.priority_model_policy_ = + invocation->stub_->exposed_priority_model (ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + state.private_connection_ = + invocation->stub_->private_connection (); + + this->init_client_protocol (invocation, ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + this->init_bands (invocation, ACE_TRY_ENV); + ACE_CHECK_RETURN (0); + + // + // Look at RTCORBA policies to decide on appropriate selector. + // + + // CASE 2: No PriorityModelPolicy set. + if (state.priority_model_policy_ == 0) + { + // Bands without priority model do not make sense. + if (state.bands_policy_ != 0) + { + if (invocation->inconsistent_policies_.ptr ()) + { + invocation->inconsistent_policies_->length (1); + invocation->inconsistent_policies_[0u] = + CORBA::Policy::_duplicate (state.bands_policy_); + } + ACE_THROW_RETURN (CORBA::INV_POLICY (), 0); + } + + if (state.client_protocol_policy_ == 0) + return this->default_endpoint_selector_; + else + return this->protocol_endpoint_selector_; + } + + CORBA::Boolean is_client_propagated = 0; + + // @@ This is to be used in case 3: + CORBA::Short server_priority = 0; + + invocation->orb_core_->get_protocols_hooks () ->get_selector_hook ( + state.priority_model_policy_, + is_client_propagated, + server_priority); + + if (is_client_propagated) + { + // Get client priority. + if (invocation->orb_core_->get_protocols_hooks () + ->get_thread_priority (invocation->orb_core_, + state.client_priority_, + ACE_TRY_ENV) + == -1) + ACE_THROW_RETURN (CORBA::DATA_CONVERSION (1, + CORBA::COMPLETED_NO), + 0); + } + + // CASE 3: PriorityBandedConnection Policy is set. + if (state.bands_policy_ != 0) + { + // Figure out target priority. + CORBA::Short p; + if (is_client_propagated) + p = state.client_priority_; + else + p = server_priority; + + int in_range = 0; + + invocation->orb_core_->get_protocols_hooks + ()->get_selector_bands_policy_hook (state.bands_policy_, + state.min_priority_, + state.max_priority_, + p, + in_range); + + // If priority doesn't fall into any of the bands + if (!in_range) + { + if (invocation->inconsistent_policies_.ptr ()) + { + invocation->inconsistent_policies_->length (2); + invocation->inconsistent_policies_[0u] = + CORBA::Policy::_duplicate (state.bands_policy_); + invocation->inconsistent_policies_[1u] = + CORBA::Policy::_duplicate (state.priority_model_policy_); + } + ACE_THROW_RETURN (CORBA::INV_POLICY (), 0); + } + + // Matching band found. Instantiate appropriate selector. + if (state.client_protocol_policy_ == 0) + return this->bands_endpoint_selector_; + else + return this->bands_protocol_selector_; + } + + // CASE 4: CLIENT_PROPAGATED priority model, no bands. + if (is_client_propagated) + { + if (state.client_protocol_policy_ == 0) + return this->priority_endpoint_selector_; + else + return this->priority_protocol_selector_; + } + else + { + // CASE 5: SERVER_DECLARED priority model, no bands. + if (state.client_protocol_policy_ == 0) + return this->default_endpoint_selector_; + else + return this->protocol_endpoint_selector_; + } +} + +TAO_Invocation_Endpoint_Selector * +RT_Endpoint_Selector_Factory:: +check_client_priority_policy (TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV) +{ +#if (TAO_HAS_CLIENT_PRIORITY_POLICY == 1) + + TAO_Client_Priority_Policy *policy = + invocation->stub_->client_priority (); + + // Automatically release the policy + CORBA::Object_var auto_release = policy; + + if (policy == 0) + return this->default_endpoint_selector_; + + else + { + // Policy is set. + TAO::PrioritySpecification priority_spec = + policy->priority_specification (ACE_TRY_ENV); + ACE_CHECK; + + TAO::PrioritySelectionMode mode = priority_spec.mode; + + if (mode == TAO::USE_NO_PRIORITY) + // Don't care about priority - use default selector. + return this->default_endpoint_selector_; + else + // Care about priority - use client priority policy selector. + { + // Initialize endpoint selection state. + if (mode == TAO::USE_PRIORITY_RANGE) + { + invocation->endpoint_selection_state_.min_priority_ = + priority_spec.min_priority; + invocation->endpoint_selection_state_.max_priority_ = + priority_spec.max_priority; + } + else + // mode == TAO::USE_THREAD_PRIORITY + { + CORBA::Short priority; + if (invocation->orb_core_->get_protocols_hooks + ()->get_thread_priority (invocation->orb_core_, + priority, + ACE_TRY_ENV) + == -1) + ACE_THROW (CORBA::DATA_CONVERSION (1, + CORBA::COMPLETED_NO)); + + invocation->endpoint_selection_state_.min_priority_ = + priority; + invocation->endpoint_selection_state_.max_priority_ = + priority; + } + + return this->client_priority_policy_selector_; + } + } + +#else + + ACE_UNUSED_ARG (invocation); + ACE_UNUSED_ARG (ACE_TRY_ENV); // FUZZ: ignore check_for_ace_check + + return 0; +#endif /* TAO_HAS_CLIENT_PRIORITY_POLICY == 1 */ +} + +void +RT_Endpoint_Selector_Factory:: +init_client_protocol (TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV) +{ + ACE_TRY + { + invocation->endpoint_selection_state_.client_protocol_policy_ = + invocation->stub_->effective_client_protocol (ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::INV_POLICY, ex) + { + if (invocation->inconsistent_policies_.ptr ()) + { + invocation->inconsistent_policies_->length (1); + invocation->inconsistent_policies_[0u] = + invocation->stub_->client_protocol (); + } + ACE_RE_THROW; + } + ACE_ENDTRY; + ACE_CHECK; +} + +void +RT_Endpoint_Selector_Factory:: +init_bands (TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV) +{ + ACE_TRY + { + invocation->endpoint_selection_state_.bands_policy_ = + invocation->stub_->effective_priority_banded_connection (ACE_TRY_ENV); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::INV_POLICY, ex) + { + if (invocation->inconsistent_policies_.ptr ()) + { + invocation->inconsistent_policies_->length (1); + invocation->inconsistent_policies_[0u] = + invocation->stub_->priority_banded_connection (); + } + ACE_RE_THROW; + } + ACE_ENDTRY; + ACE_CHECK; +} + +#endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/RT_Endpoint_Selector_Factory.h b/TAO/tao/RT_Endpoint_Selector_Factory.h new file mode 100644 index 00000000000..ff105f1e109 --- /dev/null +++ b/TAO/tao/RT_Endpoint_Selector_Factory.h @@ -0,0 +1,110 @@ +// This may look like C, but it's really -*- C++ -*- + +//============================================================================= +/** + * @file RT_Endpoint_Selector_Factory.h + * + * $Id$ + * + * Strategies for selecting profile/endpoint from an IOR for making an + * invocation. + * + * @author Marina Spivak <marina@cs.wustl.edu> + */ +//============================================================================= + + +#ifndef RT_ENDPOINT_SELECTOR_FACTORY_H +#define RT_ENDPOINT_SELECTOR_FACTORY_H +#include "ace/pre.h" + +#include "tao/corbafwd.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Endpoint_Selector_Factory.h" + +class TAO_Priority_Endpoint_Selector; +class TAO_Bands_Endpoint_Selector; +class TAO_Protocol_Endpoint_Selector; +class TAO_Priority_Protocol_Selector; +class TAO_Bands_Protocol_Selector; +class TAO_Client_Priority_Policy_Selector; + +// **************************************************************** +#if (TAO_HAS_RT_CORBA == 1) + +/** + * @class RT_Endpoint_Selector_Factory + * + * @brief Factory for initializing <Endpoint_Selection_State> and + * obtaining appropriate <Invocation_Endpoint_Selector>. + * + * Used by Invocation classes to intialize its endpoint selection + * strategy and state based on the effective policies. + * Endpoint selection strategies are stateless objects - all the + * state they need is contained by Invocation in + * <Endpoint_Selection_State>. Thus, rather than allocating an + * endpoint selection strategy object for each Invocation, the + * factory simply returns the appropriate one from the + * set preallocated in the ORB_Core. One endpoint selection + * strategy object can be used by many invocations concurrently. + */ +class TAO_Export RT_Endpoint_Selector_Factory + : public TAO_Endpoint_Selector_Factory +{ +public: + /// Constructor. + RT_Endpoint_Selector_Factory (void); + + /// Destructor. + virtual ~RT_Endpoint_Selector_Factory (void); + + /// Get an Invocation's endpoint selection strategy and + /// initialize the endpoint selection state instance. + virtual TAO_Invocation_Endpoint_Selector *get_selector ( + TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV); + +protected: + + // = Helpers for <get_selector>. + + /** + * Gets the appropriate selector if TAO_HAS_CLIENT_PRIORITY_POLICY + * is enabled. Also initializes endpoint selection state as + * necessary. WARNING: TAO::Client_Pririority_Policy is + * deprecated. See TAO RTCORBA documentation for more details. + */ + TAO_Invocation_Endpoint_Selector *check_client_priority_policy ( + TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV); + + /// Initializes RTCORBA::ClientProtocolPolicy in the endpoint + /// selection state. + void init_client_protocol (TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV); + + /// Initializes RTCORBA::PriorityBandsPolicy in the endpoint + /// selection state. + void init_bands (TAO_GIOP_Invocation *invocation, + CORBA::Environment &ACE_TRY_ENV); + +private: + /// The possible endpoint selector strategies that can be + /// returned by this factory + + TAO_Priority_Endpoint_Selector *priority_endpoint_selector_; + TAO_Bands_Endpoint_Selector *bands_endpoint_selector_; + TAO_Protocol_Endpoint_Selector *protocol_endpoint_selector_; + TAO_Priority_Protocol_Selector *priority_protocol_selector_; + TAO_Bands_Protocol_Selector *bands_protocol_selector_; + TAO_Client_Priority_Policy_Selector *client_priority_policy_selector_; +}; + +#endif /* TAO_HAS_RT_CORBA == 1 */ + +#include "ace/post.h" +#endif /* RT_ENDPOINT_SELECTOR_FACTORY_H */ diff --git a/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp b/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp index 30a7ce95dc0..07d25c99fd0 100644 --- a/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp +++ b/TAO/tao/RT_Invocation_Endpoint_Selectors.cpp @@ -204,8 +204,7 @@ TAO_Protocol_Endpoint_Selector::select_endpoint (TAO_GIOP_Invocation { /// Narrow down to the right policy. RTCORBA::ClientProtocolPolicy_var cp_policy = - RTCORBA::ClientProtocolPolicy::_narrow ( - invocation->endpoint_selection_state_. + RTCORBA::ClientProtocolPolicy::_narrow (invocation->endpoint_selection_state_. client_protocol_policy_, ACE_TRY_ENV); ACE_CHECK; diff --git a/TAO/tao/RT_Invocation_Endpoint_Selectors.h b/TAO/tao/RT_Invocation_Endpoint_Selectors.h index 2ea44fc9f85..0b60f768ea5 100644 --- a/TAO/tao/RT_Invocation_Endpoint_Selectors.h +++ b/TAO/tao/RT_Invocation_Endpoint_Selectors.h @@ -1,22 +1,19 @@ // This may look like C, but it's really -*- C++ -*- -// $Id$ - -// ============================================================================ -// -// = LIBRARY -// TAO -// -// = FILENAME -// RT_Invocation_Endpoint_Selectors.h -// -// = DESCRIPTION -// Strategies for selecting profile/endpoint from an IOR for making an -// invocation. -// -// = AUTHOR -// Priyanka Gontla <pgontla@ece.uci.edu> -// -// ============================================================================ + +//============================================================================= +/** + * @file RT_Invocation_Endpoint_Selectors.h + * + * $Id$ + * + * Strategies for selecting profile/endpoint from an IOR for making an + * invocation. + * + * + * @author Priyanka Gontla <pgontla@ece.uci.edu> + */ +//============================================================================= + #ifndef TAO_RT_INVOCATION_ENDPOINT_SELECTOR_H #define TAO_RT_INVOCATION_ENDPOINT_SELECTOR_H @@ -33,50 +30,53 @@ #if (TAO_HAS_RT_CORBA == 1) +/** + * @class TAO_Priority_Endpoint_Selector + * + * @brief TAO_Priority_Endpoint_Selector + * + * This strategy is used when RTCORBA::PriorityModelPolicy is + * set and its value is RTCORBA::CLIENT_PROPAGATED. + * + */ class TAO_Export TAO_Priority_Endpoint_Selector : public TAO_Default_Endpoint_Selector { - // = TITLE - // Strategy for selecting endpoints based on the priority of the - // client thread making the invocation. - // - // = DESCRIPTION - // This strategy is used when RTCORBA::PriorityModelPolicy is - // set and its value is RTCORBA::CLIENT_PROPAGATED. - // public: + /// Constructor. TAO_Priority_Endpoint_Selector (void); - // Constructor. + /// Destructor. virtual ~TAO_Priority_Endpoint_Selector (void); - // Destructor. virtual void select_endpoint (TAO_GIOP_Invocation *invocation, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); private: + /// Helper for <select_endpoint>. int is_multihomed (TAO_Endpoint *endpoint); - // Helper for <select_endpoint>. }; // **************************************************************** +/** + * @class TAO_Bands_Endpoint_Selector + * + * @brief TAO_Bands_Endpoint_Selector + * + * This strategy is used when + * RTCORBA::PriorityBandedConnectionPolicy is set. + * + */ class TAO_Export TAO_Bands_Endpoint_Selector : public TAO_Default_Endpoint_Selector { - // = TITLE - // Strategy for selecting endpoints based on the priority range. - // - // = DESCRIPTION - // This strategy is used when - // RTCORBA::PriorityBandedConnectionPolicy is set. - // public: + /// Constructor. TAO_Bands_Endpoint_Selector (void); - // Constructor. + /// Destructor. virtual ~TAO_Bands_Endpoint_Selector (void); - // Destructor. virtual void select_endpoint (TAO_GIOP_Invocation *invocation, CORBA::Environment &ACE_TRY_ENV = @@ -85,23 +85,25 @@ public: // **************************************************************** +/** + * @class TAO_Protocol_Endpoint_Selector + * + * @brief TAO_Protocol_Endpoint_Selector + * + * This strategy is used when only RTCORBA::ClientProtocolPolicy is + * set or RTCORBA::ClientProtocolPolicy plus + * RTCORBA::SERVER_DECLARED priority model. + * + */ class TAO_Export TAO_Protocol_Endpoint_Selector : public TAO_Invocation_Endpoint_Selector { - // = TITLE - // Strategy for selecting endpoints based on protocols. - // - // = DESCRIPTION - // This strategy is used when only RTCORBA::ClientProtocolPolicy is - // set or RTCORBA::ClientProtocolPolicy plus - // RTCORBA::SERVER_DECLARED priority model. - // public: + /// Constructor. TAO_Protocol_Endpoint_Selector (void); - // Constructor. + /// Destructor. virtual ~TAO_Protocol_Endpoint_Selector (void); - // Destructor. virtual void select_endpoint (TAO_GIOP_Invocation *invocation, CORBA::Environment &ACE_TRY_ENV = @@ -117,33 +119,34 @@ public: virtual void close_connection (TAO_GIOP_Invocation *invocation); protected: + /// Helper for <select_endpoint>. virtual void endpoint (TAO_GIOP_Invocation *invocation, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); - // Helper for <select_endpoint>. }; // **************************************************************** +/** + * @class TAO_Client_Priority_Policy_Selector + * + * @brief TAO_Client_Priority_Policy_Selector + * + * TAO::Client_Priority_Policy is deprecated. Similar (and + * beyond) functionality can be achieved through standard RTCORBA + * policies. See TAO Real-Time CORBA documentation for more + * information. + * + */ class TAO_Export TAO_Client_Priority_Policy_Selector : public TAO_Invocation_Endpoint_Selector { - // = TITLE - // Strategy for selecting endpoints when - // TAO::Client_Priority_Policy is set. - // - // = DESCRIPTION - // TAO::Client_Priority_Policy is deprecated. Similar (and - // beyond) functionality can be achieved through standard RTCORBA - // policies. See TAO Real-Time CORBA documentation for more - // information. - // public: + /// Constructor. TAO_Client_Priority_Policy_Selector (void); - // Constructor. + /// Destructor. virtual ~TAO_Client_Priority_Policy_Selector (void); - // Destructor. virtual void select_endpoint (TAO_GIOP_Invocation *invocation, CORBA::Environment &ACE_TRY_ENV = @@ -161,53 +164,55 @@ public: // **************************************************************** +/** + * @class TAO_Priority_Protocol_Selector + * + * @brief TAO_Priority_Protocol_Selector + * + * This strategy is used when RTCORBA::ClientProtocolPolicy is + * set and the priority model is RTCORBA::CLIENT_PROPAGATED. + * + */ class TAO_Export TAO_Priority_Protocol_Selector : public TAO_Protocol_Endpoint_Selector { - // = TITLE - // Strategy for selecting endpoints based on protocols and the - // priority of the client thread making the invocation. - // - // = DESCRIPTION - // This strategy is used when RTCORBA::ClientProtocolPolicy is - // set and the priority model is RTCORBA::CLIENT_PROPAGATED. - // public: + /// Constructor. TAO_Priority_Protocol_Selector (void); - // Constructor. + /// Destructor. virtual ~TAO_Priority_Protocol_Selector (void); - // Destructor. protected: + /// virtual void endpoint (TAO_GIOP_Invocation *invocation, CORBA::Environment &ACE_TRY_ENV = TAO_default_environment ()); - // + /// Helper for <select_endpoint>. int is_multihomed (TAO_Endpoint *endpoint); - // Helper for <select_endpoint>. }; // **************************************************************** +/** + * @class TAO_Bands_Protocol_Selector + * + * @brief TAO_Bands_Protocol_Selector + * + * This strategy is used when both RTCORBA::ClientProtocolPolicy + * and RTCORBA::PriorityBandedConnectionPolicy are set. + * + */ class TAO_Export TAO_Bands_Protocol_Selector : public TAO_Protocol_Endpoint_Selector { - // = TITLE - // Strategy for selecting endpoints based on protocols and a - // priority range. - // - // = DESCRIPTION - // This strategy is used when both RTCORBA::ClientProtocolPolicy - // and RTCORBA::PriorityBandedConnectionPolicy are set. - // public: + /// Constructor. TAO_Bands_Protocol_Selector (void); - // Constructor. + /// Destructor. virtual ~TAO_Bands_Protocol_Selector (void); - // Destructor. protected: virtual void endpoint (TAO_GIOP_Invocation *invocation, diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index db76719831b..7d50c0d98e0 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -339,6 +339,10 @@ SOURCE=.\Endpoint.cpp # End Source File
# Begin Source File
+SOURCE=.\Endpoint_Selector_Factory.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Environment.cpp
# End Source File
# Begin Source File
@@ -683,6 +687,10 @@ SOURCE=.\RT_Current.cpp # End Source File
# Begin Source File
+SOURCE=.\RT_Endpoint_Selector_Factory.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\RT_Invocation_Endpoint_Selectors.cpp
# End Source File
# Begin Source File
@@ -1055,6 +1063,10 @@ SOURCE=.\Endpoint.h # End Source File
# Begin Source File
+SOURCE=.\Endpoint_Selector_Factory.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Environment.h
# End Source File
# Begin Source File
@@ -1439,6 +1451,10 @@ SOURCE=.\RT_Current.h # End Source File
# Begin Source File
+SOURCE=.\RT_Endpoint_Selector_Factory.h
+# End Source File
+# Begin Source File
+
SOURCE=.\RT_Invocation_Endpoint_Selectors.h
# End Source File
# Begin Source File
diff --git a/TAO/tao/TAO_Static.dsp b/TAO/tao/TAO_Static.dsp index 8087319feae..bf426659266 100644 --- a/TAO/tao/TAO_Static.dsp +++ b/TAO/tao/TAO_Static.dsp @@ -40,8 +40,8 @@ RSC=rc.exe # PROP Output_Dir ""
# PROP Intermediate_Dir "LIB\Release"
# PROP Target_Dir ""
-MTL=midl.exe
LINK32=link.exe -lib
+MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /I "../../" /I "../" /D "_WINDOWS" /D "_CONSOLE" /D "NDEBUG" /D "WIN32" /D "TAO_AS_STATIC_LIBS" /D "ACE_AS_STATIC_LIBS" /FD /c
# SUBTRACT CPP /YX
@@ -66,8 +66,8 @@ LIB32=link.exe -lib # PROP Output_Dir ""
# PROP Intermediate_Dir "LIB\Debug"
# PROP Target_Dir ""
-MTL=midl.exe
LINK32=link.exe -lib
+MTL=midl.exe
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../" /I "../" /D "_WINDOWS" /D "_CONSOLE" /D "_DEBUG" /D "WIN32" /D "ACE_AS_STATIC_LIBS" /D "TAO_AS_STATIC_LIBS" /FD /c
# SUBTRACT CPP /YX
@@ -275,6 +275,10 @@ SOURCE=.\Endpoint.h # End Source File
# Begin Source File
+SOURCE=.\Endpoint_Selector_Factory.h
+# End Source File
+# Begin Source File
+
SOURCE=.\Environment.h
# End Source File
# Begin Source File
@@ -655,6 +659,10 @@ SOURCE=.\RT_Current.h # End Source File
# Begin Source File
+SOURCE=.\RT_Endpoint_Selector_Factory.h
+# End Source File
+# Begin Source File
+
SOURCE=.\RT_Invocation_Endpoint_Selectors.h
# End Source File
# Begin Source File
@@ -1643,6 +1651,10 @@ SOURCE=.\Endpoint.cpp # End Source File
# Begin Source File
+SOURCE=.\Endpoint_Selector_Factory.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\Environment.cpp
# End Source File
# Begin Source File
@@ -1987,6 +1999,10 @@ SOURCE=.\RT_Current.cpp # End Source File
# Begin Source File
+SOURCE=.\RT_Endpoint_Selector_Factory.cpp
+# End Source File
+# Begin Source File
+
SOURCE=.\RT_Invocation_Endpoint_Selectors.cpp
# End Source File
# Begin Source File
|