00001 // This may look like C, but it's really -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file OC_Endpoint_Selector_Factory.h 00006 * 00007 * $Id: OC_Endpoint_Selector_Factory.h 84281 2009-01-30 15:01:17Z wotte $ 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_OC_ENDPOINT_SELECTOR_FACTORY_H 00018 #define TAO_OC_ENDPOINT_SELECTOR_FACTORY_H 00019 #include /**/ "ace/pre.h" 00020 00021 00022 #include "tao/Strategies/strategies_export.h" 00023 00024 #include "tao/Endpoint_Selector_Factory.h" 00025 #include "ace/Service_Config.h" 00026 00027 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00028 # pragma once 00029 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00030 00031 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00032 00033 // Forward references 00034 class TAO_Optimized_Connection_Endpoint_Selector; 00035 00036 // **************************************************************** 00037 00038 /** 00039 * @class TAO_OC_Endpoint_Selector_Factory 00040 * 00041 * @brief Factory for initializing <Endpoint_Selection_State> and 00042 * obtaining appropriate <Invocation_Endpoint_Selector>. 00043 * 00044 * Used by Invocation classes to initialize its endpoint selection 00045 * strategy and state based on the effective policies. 00046 * Endpoint selection strategies are stateless objects - all the 00047 * state they need is contained by Invocation in 00048 * <Endpoint_Selection_State>. Thus, rather than allocating an 00049 * endpoint selection strategy object for each Invocation, the 00050 * factory simply returns the appropriate one from the 00051 * set preallocated in the ORB_Core. One endpoint selection 00052 * strategy object can be used by many invocations concurrently. 00053 */ 00054 class TAO_Strategies_Export TAO_OC_Endpoint_Selector_Factory 00055 : public TAO_Endpoint_Selector_Factory 00056 { 00057 public: 00058 /// Constructor. 00059 TAO_OC_Endpoint_Selector_Factory (void); 00060 00061 /// Destructor. 00062 virtual ~TAO_OC_Endpoint_Selector_Factory (void); 00063 00064 virtual int init (int argc, ACE_TCHAR *argv[]); 00065 00066 /// Get an Invocation's endpoint selection strategy and 00067 /// initialize the endpoint selection state instance. 00068 virtual TAO_Invocation_Endpoint_Selector *get_selector (void); 00069 00070 protected: 00071 /// The possible endpoint selector strategies that can be 00072 /// returned by this factory 00073 00074 TAO_Optimized_Connection_Endpoint_Selector *oc_endpoint_selector_; 00075 00076 int register_orb_initializer (void); 00077 }; 00078 00079 00080 00081 00082 ACE_STATIC_SVC_DECLARE_EXPORT (TAO_Strategies, TAO_OC_Endpoint_Selector_Factory) 00083 ACE_FACTORY_DECLARE (TAO_Strategies, TAO_OC_Endpoint_Selector_Factory) 00084 00085 TAO_END_VERSIONED_NAMESPACE_DECL 00086 00087 #include /**/ "ace/post.h" 00088 #endif /* TAO_OC_ENDPOINT_SELECTOR_FACTORY_H */