00001 // -*- C++ -*- 00002 00003 // $Id: SCIOP_Connector.h 78931 2007-07-18 09:59:36Z johnnyw $ 00004 //============================================================================= 00005 /** 00006 * @file SCIOP_Connector.h 00007 * 00008 * SCIOP specific connector processing 00009 * 00010 * @author Jason Cohen, Lockheed Martin ATL <jcohen@atl.lmco.com> 00011 * @author Keith O'Hara, Lockheed Martin ATL 00012 */ 00013 //============================================================================= 00014 00015 #ifndef TAO_SCIOP_CONNECTOR_H 00016 #define TAO_SCIOP_CONNECTOR_H 00017 00018 #include /**/ "ace/pre.h" 00019 #include "tao/orbconf.h" 00020 00021 #if !defined (ACE_LACKS_PRAGMA_ONCE) 00022 # pragma once 00023 #endif /* ACE_LACKS_PRAGMA_ONCE */ 00024 00025 #if TAO_HAS_SCIOP == 1 00026 00027 #include "tao/Transport_Connector.h" 00028 #include "tao/Connector_Impl.h" 00029 #include "tao/Strategies/SCIOP_Connection_Handler.h" 00030 #include "ace/SOCK_SEQPACK_Connector.h" 00031 #include "ace/Connector.h" 00032 00033 TAO_BEGIN_VERSIONED_NAMESPACE_DECL 00034 00035 class TAO_SCIOP_Endpoint; 00036 00037 // **************************************************************** 00038 00039 /** 00040 * @class TAO_SCIOP_Connector 00041 * 00042 * @brief SCIOP-specific Connector bridge for pluggable protocols. 00043 * 00044 * Concrete instance of the TAO_Connector class. Responsible 00045 * for establishing a connection with a server and is called from the 00046 * Connector_Registory. 00047 */ 00048 class TAO_Strategies_Export TAO_SCIOP_Connector : public TAO_Connector 00049 { 00050 public: 00051 // = Initialization and termination methods. 00052 /// Constructor. 00053 TAO_SCIOP_Connector (void); 00054 00055 /// Destructor. 00056 ~TAO_SCIOP_Connector (void); 00057 00058 // = The TAO_Connector methods, please check the documentation on 00059 // Transport_Connector.h 00060 int open (TAO_ORB_Core *orb_core); 00061 int close (void); 00062 TAO_Profile *create_profile (TAO_InputCDR& cdr); 00063 00064 virtual int check_prefix (const char *endpoint); 00065 00066 virtual char object_key_delimiter (void) const; 00067 00068 public: 00069 00070 typedef TAO_Connect_Concurrency_Strategy<TAO_SCIOP_Connection_Handler> 00071 TAO_SCIOP_CONNECT_CONCURRENCY_STRATEGY; 00072 00073 typedef TAO_Connect_Creation_Strategy<TAO_SCIOP_Connection_Handler> 00074 TAO_SCIOP_CONNECT_CREATION_STRATEGY; 00075 00076 typedef ACE_Connect_Strategy<TAO_SCIOP_Connection_Handler, 00077 ACE_SOCK_SEQPACK_CONNECTOR> 00078 TAO_SCIOP_CONNECT_STRATEGY ; 00079 00080 typedef ACE_Strategy_Connector<TAO_SCIOP_Connection_Handler, 00081 ACE_SOCK_SEQPACK_CONNECTOR> 00082 TAO_SCIOP_BASE_CONNECTOR; 00083 00084 protected: 00085 00086 // = The TAO_Connector methods, please check the documentation on 00087 // Transport_Connector.h 00088 int set_validate_endpoint (TAO_Endpoint *ep); 00089 00090 TAO_Transport *make_connection (TAO::Profile_Transport_Resolver *r, 00091 TAO_Transport_Descriptor_Interface &desc, 00092 ACE_Time_Value *timeout = 0); 00093 00094 /// More TAO_Connector methods, please check the documentation on 00095 /// Transport_Connector.h 00096 virtual TAO_Profile *make_profile (void); 00097 00098 /// Cancel the passed cvs handler from the connector 00099 int cancel_svc_handler (TAO_Connection_Handler * svc_handler); 00100 00101 private: 00102 00103 /// Return the remote endpoint, a helper function 00104 TAO_SCIOP_Endpoint *remote_endpoint (TAO_Endpoint *ep); 00105 00106 /// Try to make a connection to the next endpoint in the list. 00107 TAO_Transport *make_connection_i (TAO::Profile_Transport_Resolver *r, 00108 TAO_Transport_Descriptor_Interface &desc, 00109 ACE_Time_Value *timeout, 00110 TAO_SCIOP_Endpoint *sciop_endpoint); 00111 00112 private: 00113 00114 /// Our connect strategy 00115 TAO_SCIOP_CONNECT_STRATEGY connect_strategy_; 00116 00117 /// The connector initiating connection requests for SCIOP. 00118 TAO_SCIOP_BASE_CONNECTOR base_connector_; 00119 }; 00120 00121 TAO_END_VERSIONED_NAMESPACE_DECL 00122 00123 #endif /* TAO_HAS_SCIOP == 1 */ 00124 00125 00126 #include /**/ "ace/post.h" 00127 00128 #endif /* TAO_SCIOP_CONNECTOR_H */