00001 // This may look like C, but it's really -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Optimized_Connection_Endpoint_Selector.h 00006 * 00007 * $Id: Optimized_Connection_Endpoint_Selector.h 79221 2007-08-06 11:01:22Z johnnyw $ 00008 * 00009 * Strategies for selecting profile/endpoint from an IOR for making an 00010 * invocation. 00011 * 00012 * @author Phil Mesnier <mesnier_p@ociweb.com> 00013 */ 00014 //============================================================================= 00015 00016 00017 #ifndef TAO_OPTIMIZED_CONNECTION_ENDPOINT_SELECTOR_H 00018 #define TAO_OPTIMIZED_ENDPOINT_SELECTOR_H 00019 00020 #include /**/ "ace/pre.h" 00021 00022 #include "tao/corbafwd.h" 00023 00024 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 #include "tao/Strategies/strategies_export.h" 00029 00030 #include "tao/Invocation_Endpoint_Selectors.h" 00031 #include "ace/Time_Value.h" 00032 00033 00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00035 00036 class TAO_GIOP_Invocation; 00037 class TAO_ORB_Core; 00038 class TAO_Stub; 00039 class TAO_Profile; 00040 00041 /** 00042 * @class TAO_Optimized_Connection_Endpoint_Selector 00043 * 00044 * @brief More efficient connection strategy for endpoint selection. 00045 * 00046 * This strategy builds on the default by first querying the connection 00047 * cache for all potential endpoints before iterating over the list to 00048 * attempt to create new connections. 00049 */ 00050 00051 class TAO_Strategies_Export TAO_Optimized_Connection_Endpoint_Selector 00052 : public TAO_Default_Endpoint_Selector 00053 { 00054 public: 00055 /// Constructor. 00056 TAO_Optimized_Connection_Endpoint_Selector (const ACE_Time_Value& tv); 00057 00058 /// Destructor. 00059 virtual ~TAO_Optimized_Connection_Endpoint_Selector (void); 00060 00061 static void hook (TAO_ORB_Core *, 00062 TAO_Stub *, 00063 bool &has_timeout, 00064 ACE_Time_Value &tv); 00065 00066 virtual void select_endpoint (TAO::Profile_Transport_Resolver *, 00067 ACE_Time_Value *max_wait_time); 00068 private: 00069 00070 int check_profile (TAO_Profile *, 00071 TAO::Profile_Transport_Resolver *); 00072 00073 static ACE_Time_Value timeout_; 00074 }; 00075 00076 TAO_END_VERSIONED_NAMESPACE_DECL 00077 00078 #include /**/ "ace/post.h" 00079 #endif /* TAO_OPTIMIZED_CONNECTION_ENDPOINT_SELECTOR_H */