00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Client_Strategy_Factory.h 00006 * 00007 * Client_Strategy_Factory.h,v 1.34 2006/04/26 17:12:47 mesnier_p Exp 00008 * 00009 * @author Chris Cleeland <cleeland@cs.wustl.edu> 00010 */ 00011 //============================================================================= 00012 00013 00014 #ifndef TAO_CLIENT_STRATEGY_FACTORY_H 00015 #define TAO_CLIENT_STRATEGY_FACTORY_H 00016 00017 #include /**/ "ace/pre.h" 00018 00019 #include "tao/TAO_Export.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #include "tao/Versioned_Namespace.h" 00026 00027 #include "ace/Service_Object.h" 00028 00029 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00030 class ACE_Lock; 00031 ACE_END_VERSIONED_NAMESPACE_DECL 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_Transport_Mux_Strategy; 00036 class TAO_Wait_Strategy; 00037 class TAO_Transport; 00038 class TAO_ORB_Core; 00039 class TAO_Connect_Strategy; 00040 00041 /** 00042 * @class TAO_Client_Strategy_Factory 00043 * 00044 * @brief Abstract factory used by the client to manufacture various 00045 * strategies used on the client-side. 00046 */ 00047 class TAO_Export TAO_Client_Strategy_Factory : public ACE_Service_Object 00048 { 00049 public: 00050 00051 /// Destructor 00052 virtual ~TAO_Client_Strategy_Factory (void); 00053 00054 /** 00055 * Create the lock for the stub and the profile 00056 */ 00057 virtual ACE_Lock* create_profile_lock (void); 00058 00059 /// Create the correct client request muxing strategy. 00060 virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); 00061 00062 /// Create the correct lock for request muxing strategy. 00063 virtual ACE_Lock *create_transport_mux_strategy_lock (void); 00064 00065 /// Return the size of the reply dispatcher table 00066 virtual int reply_dispatcher_table_size (void) const; 00067 00068 /// Create the correct client <wait_for_reply> strategy. 00069 virtual TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); 00070 00071 /// Create the correct client <asynch_connect> strategy. 00072 virtual TAO_Connect_Strategy *create_connect_strategy (TAO_ORB_Core *); 00073 00074 enum Connect_Strategy 00075 { 00076 TAO_BLOCKED_CONNECT, 00077 TAO_REACTIVE_CONNECT, 00078 TAO_LEADER_FOLLOWER_CONNECT 00079 }; 00080 /// Return the selected connection strategy option. 00081 virtual Connect_Strategy connect_strategy (void) const; 00082 00083 /// Does the client allow any form of callback? 00084 virtual int allow_callback (void); 00085 00086 /// Create a lock to be used by the TAO_Fault_Tolerant_Service class 00087 /// to generate unique retention ids 00088 virtual ACE_Lock *create_ft_service_retention_id_lock (void); 00089 00090 /// Cleanup options for wait strategy. 00091 /** 00092 * Only applicable to RW wait strategy 00093 */ 00094 virtual bool use_cleanup_options (void) const; 00095 }; 00096 00097 TAO_END_VERSIONED_NAMESPACE_DECL 00098 00099 #include /**/ "ace/post.h" 00100 #endif /* TAO_CLIENT_STRATEGY_FACTORY_H */