00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Default_Endpoint_Selector_Factory.h 00006 * 00007 * $Id: Default_Endpoint_Selector_Factory.h 76551 2007-01-24 13:42:44Z 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 * @author Frank Hunleth <fhunleth@cs.wustl.edu> 00014 */ 00015 //============================================================================= 00016 00017 #ifndef TAO_DEFAULT_ENDPOINT_SELECTOR_FACTORY_H 00018 #define TAO_DEFAULT_ENDPOINT_SELECTOR_FACTORY_H 00019 00020 #include /**/ "ace/pre.h" 00021 #include "ace/Service_Config.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 #include "tao/Endpoint_Selector_Factory.h" 00028 00029 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00030 00031 // Forward references 00032 class TAO_Default_Endpoint_Selector; 00033 00034 // **************************************************************** 00035 00036 /** 00037 * @class TAO_Default_Endpoint_Selector_Factory 00038 * 00039 * @brief Factory for initializing <Endpoint_Selection_State> and 00040 * obtaining appropriate <Invocation_Endpoint_Selector>. 00041 * 00042 * Used by Invocation classes to intialize its endpoint selection 00043 * strategy and state based on the effective policies. 00044 * Endpoint selection strategies are stateless objects - all the 00045 * state they need is contained by Invocation in 00046 * <Endpoint_Selection_State>. Thus, rather than allocating an 00047 * endpoint selection strategy object for each Invocation, the 00048 * factory simply returns the appropriate one from the 00049 * set preallocated in the ORB_Core. One endpoint selection 00050 * strategy object can be used by many invocations concurrently. 00051 */ 00052 class TAO_Export TAO_Default_Endpoint_Selector_Factory 00053 : public TAO_Endpoint_Selector_Factory 00054 { 00055 public: 00056 /// Constructor. 00057 TAO_Default_Endpoint_Selector_Factory (void); 00058 00059 /// Destructor. 00060 virtual ~TAO_Default_Endpoint_Selector_Factory (void); 00061 00062 /// Get an Invocation's endpoint selection strategy and 00063 /// initialize the endpoint selection state instance. 00064 virtual TAO_Invocation_Endpoint_Selector *get_selector ( 00065 void); 00066 00067 private: 00068 00069 // Prevent copying/assignment. 00070 TAO_Default_Endpoint_Selector_Factory (TAO_Default_Endpoint_Selector_Factory const &); 00071 void operator= (TAO_Default_Endpoint_Selector_Factory const &); 00072 00073 protected: 00074 00075 /// The possible endpoint selector strategies that can be 00076 /// returned by this factory 00077 TAO_Default_Endpoint_Selector * const default_endpoint_selector_; 00078 00079 }; 00080 00081 TAO_END_VERSIONED_NAMESPACE_DECL 00082 00083 ACE_STATIC_SVC_DECLARE_EXPORT (TAO, TAO_Default_Endpoint_Selector_Factory) 00084 ACE_FACTORY_DECLARE (TAO, TAO_Default_Endpoint_Selector_Factory) 00085 00086 #include /**/ "ace/post.h" 00087 #endif /* TAO_DEFAULT_ENDPOINT_SELECTOR_FACTORY_H */