00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Invocation_Endpoint_Selectors.h 00006 * 00007 * $Id: Invocation_Endpoint_Selectors.h 79829 2007-10-23 12:39:52Z johnnyw $ 00008 * 00009 * Strategies for selecting profile/endpoint from an IOR for making an 00010 * invocation. 00011 * 00012 * @author Marina Spivak <marina@cs.wustl.edu> 00013 */ 00014 //============================================================================= 00015 00016 #ifndef TAO_INVOCATION_ENDPOINT_SELECTOR_H 00017 #define TAO_INVOCATION_ENDPOINT_SELECTOR_H 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include /**/ "tao/TAO_Export.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 #include /**/ "tao/Versioned_Namespace.h" 00028 00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00030 class ACE_Time_Value; 00031 ACE_END_VERSIONED_NAMESPACE_DECL 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_MProfile; 00036 00037 namespace TAO 00038 { 00039 class Profile_Transport_Resolver; 00040 } 00041 00042 namespace CORBA 00043 { 00044 class Exception; 00045 } 00046 /** 00047 * @class TAO_Invocation_Endpoint_Selector 00048 * 00049 * @brief Defines the interface for policy-based endpoint selection 00050 * strategies. 00051 * 00052 * Selects/reselects server endpoint for an Invocation. Different 00053 * concrete strategies perform selection based on different 00054 * policies. 00055 * @par 00056 * All endpoint selection strategies are stateless objects - any 00057 * necessary state is stored in Invocation's 00058 * @c endpoint_selection_state_. 00059 */ 00060 class TAO_Export TAO_Invocation_Endpoint_Selector 00061 { 00062 public: 00063 00064 /// Destructor. 00065 virtual ~TAO_Invocation_Endpoint_Selector (void); 00066 00067 /// Select the endpoint and set @a r's @c profile_ 00068 virtual void select_endpoint (TAO::Profile_Transport_Resolver *r, 00069 ACE_Time_Value *val) = 0; 00070 00071 }; 00072 00073 // **************************************************************** 00074 00075 /** 00076 * @class TAO_Default_Endpoint_Selector 00077 * 00078 * @brief Default strategy for endpoint selection. 00079 * 00080 * This strategy is used when there are no policies set or when 00081 * the only policy set is RTCORBA::PriorityModelPolicy and its 00082 * value is RTCORBA::SERVER_DECLARED. 00083 * The strategy is to try the first endpoint from the first 00084 * profile in the IOR. If that doesn't work, try the next 00085 * profile, and so on. 00086 */ 00087 class TAO_Export TAO_Default_Endpoint_Selector 00088 : public TAO_Invocation_Endpoint_Selector 00089 { 00090 public: 00091 00092 /// Destructor. 00093 virtual ~TAO_Default_Endpoint_Selector (void); 00094 00095 virtual void select_endpoint (TAO::Profile_Transport_Resolver *r, 00096 ACE_Time_Value *val); 00097 }; 00098 00099 TAO_END_VERSIONED_NAMESPACE_DECL 00100 00101 #include /**/ "ace/post.h" 00102 00103 #endif /* TAO_INVOCATION_ENDPOINT_SELECTOR_H */