00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file SHMIOP_Connector.h 00006 * 00007 * $Id: SHMIOP_Connector.h 78931 2007-07-18 09:59:36Z johnnyw $ 00008 * 00009 * SHMIOP specific connector processing 00010 * 00011 * @author Nanbor Wang <nanbor@cs.wustl.edu> 00012 */ 00013 //============================================================================= 00014 00015 00016 #ifndef TAO_SHMIOP_CONNECTOR_H 00017 #define TAO_SHMIOP_CONNECTOR_H 00018 00019 #include /**/ "ace/pre.h" 00020 00021 #include "tao/orbconf.h" 00022 00023 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00024 # pragma once 00025 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00026 00027 #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0) 00028 00029 #include "ace/MEM_Connector.h" 00030 #include "ace/Connector.h" 00031 #include "tao/Transport_Connector.h" 00032 #include "tao/Strategies/SHMIOP_Connection_Handler.h" 00033 #include "tao/Resource_Factory.h" 00034 #include "tao/Connector_Impl.h" 00035 00036 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00037 00038 class TAO_SHMIOP_Endpoint; 00039 00040 // **************************************************************** 00041 00042 /** 00043 * @class TAO_SHMIOP_Connector 00044 * 00045 * @brief SHMIOP-specific Connector bridge for pluggable protocols. 00046 * 00047 * Concrete instance of the TAO_Connector class. Responsible 00048 * for establishing a connection with a server and is called from the 00049 * Connector_Registory. 00050 */ 00051 class TAO_Strategies_Export TAO_SHMIOP_Connector : public TAO_Connector 00052 { 00053 public: 00054 /// Constructor. 00055 TAO_SHMIOP_Connector (void); 00056 00057 /// Default destructor 00058 ~TAO_SHMIOP_Connector (void); 00059 00060 /** 00061 * @name The TAO_Connector Methods 00062 * 00063 * Please check the documentation in Transport_Connector.h for details. 00064 */ 00065 //@{ 00066 int open (TAO_ORB_Core *orb_core); 00067 int close (void); 00068 00069 TAO_Profile *create_profile (TAO_InputCDR& cdr); 00070 00071 virtual int check_prefix (const char *endpoint); 00072 00073 virtual char object_key_delimiter (void) const; 00074 //@} 00075 00076 public: 00077 00078 typedef TAO_Connect_Concurrency_Strategy<TAO_SHMIOP_Connection_Handler> 00079 TAO_SHMIOP_CONNECT_CONCURRENCY_STRATEGY; 00080 00081 typedef TAO_Connect_Creation_Strategy<TAO_SHMIOP_Connection_Handler> 00082 TAO_SHMIOP_CONNECT_CREATION_STRATEGY; 00083 00084 typedef ACE_Connect_Strategy<TAO_SHMIOP_Connection_Handler, 00085 ACE_MEM_CONNECTOR> 00086 TAO_SHMIOP_CONNECT_STRATEGY ; 00087 00088 typedef ACE_Strategy_Connector<TAO_SHMIOP_Connection_Handler, 00089 ACE_MEM_CONNECTOR> 00090 TAO_SHMIOP_BASE_CONNECTOR; 00091 00092 protected: 00093 /** 00094 * @name More TAO_Connector Methods 00095 * 00096 * Please check the documentation in Transport_Connector.h for details. 00097 */ 00098 //@{ 00099 int set_validate_endpoint (TAO_Endpoint *endpoint); 00100 00101 TAO_Transport *make_connection (TAO::Profile_Transport_Resolver *r, 00102 TAO_Transport_Descriptor_Interface &desc, 00103 ACE_Time_Value *timeout = 0); 00104 00105 virtual TAO_Profile *make_profile (void); 00106 00107 /// Cancel the passed cvs handler from the connector 00108 int cancel_svc_handler (TAO_Connection_Handler * svc_handler); 00109 //@} 00110 00111 private: 00112 00113 /// Return the remote endpoint, a helper function 00114 TAO_SHMIOP_Endpoint *remote_endpoint (TAO_Endpoint *ep); 00115 00116 private: 00117 00118 /// Local address. 00119 ACE_MEM_Addr address_; 00120 00121 /// Our connect strategy. 00122 TAO_SHMIOP_CONNECT_STRATEGY connect_strategy_; 00123 00124 /// The connector initiating connection requests for SHMIOP. 00125 TAO_SHMIOP_BASE_CONNECTOR base_connector_; 00126 }; 00127 00128 TAO_END_VERSIONED_NAMESPACE_DECL 00129 00130 #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */ 00131 00132 #include /**/ "ace/post.h" 00133 00134 #endif /* TAO_SHMIOP_CONNECTOR_H */