00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file Client_Strategy_Factory.h 00006 * 00007 * $Id: Client_Strategy_Factory.h 74168 2006-08-22 09:51:53Z smcqueen $ 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 #include "tao/Configurable_Refcount.h" 00027 00028 #include "ace/Service_Object.h" 00029 00030 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00031 class ACE_Lock; 00032 ACE_END_VERSIONED_NAMESPACE_DECL 00033 00034 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00035 00036 class TAO_Transport_Mux_Strategy; 00037 class TAO_Wait_Strategy; 00038 class TAO_Transport; 00039 class TAO_ORB_Core; 00040 class TAO_Connect_Strategy; 00041 00042 /** 00043 * @class TAO_Client_Strategy_Factory 00044 * 00045 * @brief Abstract factory used by the client to manufacture various 00046 * strategies used on the client-side. 00047 */ 00048 class TAO_Export TAO_Client_Strategy_Factory : public ACE_Service_Object 00049 { 00050 public: 00051 00052 /// Destructor 00053 virtual ~TAO_Client_Strategy_Factory (void); 00054 00055 /** 00056 * Create the lock for the stub and the profile 00057 */ 00058 virtual ACE_Lock* create_profile_lock (void); 00059 00060 /// Create the refcount for the profile 00061 virtual TAO_Configurable_Refcount create_profile_refcount (void); 00062 00063 /// Create the correct client request muxing strategy. 00064 virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); 00065 00066 /// Create the correct lock for request muxing strategy. 00067 virtual ACE_Lock *create_transport_mux_strategy_lock (void); 00068 00069 /// Return the size of the reply dispatcher table 00070 virtual int reply_dispatcher_table_size (void) const; 00071 00072 /// Create the correct client <wait_for_reply> strategy. 00073 virtual TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); 00074 00075 /// Create the correct client <asynch_connect> strategy. 00076 virtual TAO_Connect_Strategy *create_connect_strategy (TAO_ORB_Core *); 00077 00078 enum Connect_Strategy 00079 { 00080 TAO_BLOCKED_CONNECT, 00081 TAO_REACTIVE_CONNECT, 00082 TAO_LEADER_FOLLOWER_CONNECT 00083 }; 00084 /// Return the selected connection strategy option. 00085 virtual Connect_Strategy connect_strategy (void) const; 00086 00087 /// Does the client allow any form of callback? 00088 virtual int allow_callback (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 */