IIOP_Connector.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    IIOP_Connector.h
00006  *
00007  *  IIOP_Connector.h,v 1.68 2006/06/01 12:50:41 jwillemsen Exp
00008  *
00009  *  IIOP specific connector processing
00010  *
00011  *
00012  *  @author Fred Kuhns <fredk@cs.wustl.edu>
00013  *  @author Ossama Othman <ossama@uci.edu>
00014  *  @author Balachandran Natarajan <bala@cs.wustl.edu>
00015  */
00016 //=============================================================================
00017 
00018 #ifndef TAO_IIOP_CONNECTOR_H
00019 #define TAO_IIOP_CONNECTOR_H
00020 
00021 #include /**/ "ace/pre.h"
00022 
00023 #include "tao/orbconf.h"
00024 
00025 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00026 # pragma once
00027 #endif /* ACE_LACKS_PRAGMA_ONCE */
00028 
00029 #if defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0)
00030 
00031 #include "tao/Transport_Connector.h"
00032 #include "tao/Connector_Impl.h"
00033 #include "tao/IIOP_Connection_Handler.h"
00034 
00035 #include "ace/SOCK_Connector.h"
00036 #include "ace/Connector.h"
00037 
00038 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00039 
00040 class TAO_IIOP_Endpoint;
00041 
00042 // ****************************************************************
00043 
00044 /**
00045  * @class TAO_IIOP_Connector
00046  *
00047  * @brief IIOP-specific Connector bridge for pluggable protocols.
00048  *
00049  * Concrete instance of the TAO_Connector class.  Responsible
00050  * for establishing a connection with a server and is called from the
00051  * Connector_Registory.
00052  */
00053 class TAO_Export TAO_IIOP_Connector : public TAO_Connector
00054 {
00055 public:
00056   // = Initialization and termination methods.
00057   /// Constructor.
00058   TAO_IIOP_Connector (CORBA::Boolean flag = false);
00059 
00060   /// Destructor.
00061   ~TAO_IIOP_Connector (void);
00062 
00063   // = The TAO_Connector methods, please check the documentation on
00064   // Transport_Connector.h
00065   int open (TAO_ORB_Core *orb_core);
00066   int close (void);
00067   TAO_Profile *create_profile (TAO_InputCDR& cdr);
00068 
00069   virtual int check_prefix (const char *endpoint);
00070 
00071   virtual char object_key_delimiter (void) const;
00072 
00073 public:
00074 
00075   //@@ TAO_CONNECTOR_SPL_PUBLIC_METHODS_COPY_HOOK_START
00076 
00077   typedef TAO_Connect_Concurrency_Strategy<TAO_IIOP_Connection_Handler>
00078           TAO_IIOP_CONNECT_CONCURRENCY_STRATEGY;
00079 
00080   typedef TAO_Connect_Creation_Strategy<TAO_IIOP_Connection_Handler>
00081           TAO_IIOP_CONNECT_CREATION_STRATEGY;
00082 
00083   typedef ACE_Connect_Strategy<TAO_IIOP_Connection_Handler,
00084                                ACE_SOCK_CONNECTOR>
00085           TAO_IIOP_CONNECT_STRATEGY ;
00086 
00087   typedef ACE_Strategy_Connector<TAO_IIOP_Connection_Handler,
00088                                  ACE_SOCK_CONNECTOR>
00089           TAO_IIOP_BASE_CONNECTOR;
00090   //@@ TAO_CONNECTOR_SPL_PUBLIC_METHODS_COPY_HOOK_END
00091 
00092 protected:
00093   /// A flag indicating the actual connector supports parallel
00094   /// connection attempts. The base implementation always returns
00095   /// 0. Override to return non-zero if parallel connection attempts
00096   /// may be tried.
00097   virtual int supports_parallel_connects (void) const;
00098 
00099   // = The TAO_Connector methods, please check the documentation on
00100   // Transport_Connector.h
00101   int set_validate_endpoint (TAO_Endpoint *ep);
00102 
00103   virtual TAO_Transport *make_connection (
00104       TAO::Profile_Transport_Resolver *r,
00105       TAO_Transport_Descriptor_Interface &desc,
00106       ACE_Time_Value *timeout = 0);
00107 
00108   virtual TAO_Transport *make_parallel_connection (
00109       TAO::Profile_Transport_Resolver *r,
00110                                   TAO_Transport_Descriptor_Interface &desc,
00111                                   ACE_Time_Value *timeout = 0);
00112 
00113   /// More TAO_Connector methods, please check the documentation on
00114   /// Transport_Connector.h
00115   virtual TAO_Profile *make_profile (ACE_ENV_SINGLE_ARG_DECL);
00116 
00117   /// Cancel the passed cvs handler from the connector
00118   virtual int cancel_svc_handler (TAO_Connection_Handler * svc_handler);
00119 
00120 /*
00121  * Hook to copy over the protected and private data from this class to
00122  * base Connector class.
00123  */
00124 //@@ TAO_CONNECTOR_SPL_COPY_HOOK_START
00125 
00126 protected:
00127 
00128   /// Do we need to use a GIOP_Lite for sending messages?
00129   const bool lite_flag_;
00130 
00131 private:
00132   /// This is the first half of making a connection. Both make_connection
00133   /// and make_parallel_connection will start out using begin_connection.
00134   int begin_connection (TAO_IIOP_Connection_Handler *&svc_handler,
00135                         TAO::Profile_Transport_Resolver *r,
00136                         TAO_IIOP_Endpoint *endpoint,
00137                         ACE_Time_Value *timeout = 0);
00138 
00139   /// This is the second half of making a connection when several endpoints
00140   /// are involved. This works with modified wait strategies to wait for one
00141   /// of many transports, and when once completes it will cancel the rest.
00142   /// The winning transport is returned.
00143   TAO_Transport *complete_connection (int result,
00144                                       TAO_Transport_Descriptor_Interface &desc,
00145                                       TAO_IIOP_Connection_Handler **&sh_list,
00146                                       TAO_IIOP_Endpoint **ep_list,
00147                                       unsigned count,
00148                                       TAO::Profile_Transport_Resolver *r,
00149                                       TAO_LF_Multi_Event *mev,
00150                                       ACE_Time_Value *timeout = 0);
00151 
00152 
00153 
00154   /// Return the remote endpoint, a helper function
00155   TAO_IIOP_Endpoint *remote_endpoint (TAO_Endpoint *ep);
00156 
00157 private:
00158 
00159   /// Our connect strategy
00160   TAO_IIOP_CONNECT_STRATEGY connect_strategy_;
00161 
00162   /// The connector initiating connection requests for IIOP.
00163   TAO_IIOP_BASE_CONNECTOR base_connector_;
00164 
00165 //@@ TAO_CONNECTOR_SPL_COPY_HOOK_END
00166 
00167 };
00168 
00169 TAO_END_VERSIONED_NAMESPACE_DECL
00170 
00171 #endif /* TAO_HAS_IIOP && TAO_HAS_IIOP != 0 */
00172 
00173 #include /**/ "ace/post.h"
00174 #endif  /* TAO_IIOP_CONNECTOR_H */

Generated on Thu Nov 9 11:54:13 2006 for TAO by doxygen 1.3.6