Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / IIOP_Connector.h
blob6ea3956f64e1762c3f9167f2bd904a7a5f1766f7
1 // -*- C++ -*-
3 //=============================================================================
4 /**
5 * @file IIOP_Connector.h
7 * IIOP specific connector processing
9 * @author Fred Kuhns <fredk@cs.wustl.edu>
10 * @author Ossama Othman <ossama@uci.edu>
11 * @author Balachandran Natarajan <bala@cs.wustl.edu>
13 //=============================================================================
15 #ifndef TAO_IIOP_CONNECTOR_H
16 #define TAO_IIOP_CONNECTOR_H
18 #include /**/ "ace/pre.h"
20 #include "tao/orbconf.h"
22 #if !defined (ACE_LACKS_PRAGMA_ONCE)
23 # pragma once
24 #endif /* ACE_LACKS_PRAGMA_ONCE */
26 #if defined (TAO_HAS_IIOP) && (TAO_HAS_IIOP != 0)
28 #include "tao/Transport_Connector.h"
29 #include "tao/Connector_Impl.h"
30 #include "tao/IIOP_Connection_Handler.h"
32 #include "ace/SOCK_Connector.h"
33 #include "ace/Connector.h"
35 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
37 class TAO_IIOP_Endpoint;
39 // ****************************************************************
41 /**
42 * @class TAO_IIOP_Connector
44 * @brief IIOP-specific Connector bridge for pluggable protocols.
46 * Concrete instance of the TAO_Connector class. Responsible
47 * for establishing a connection with a server and is called from the
48 * Connector_Registory.
50 class TAO_Export TAO_IIOP_Connector : public TAO_Connector
52 public:
53 /// Constructor.
54 TAO_IIOP_Connector ();
56 /// Destructor.
57 ~TAO_IIOP_Connector ();
59 // = The TAO_Connector methods, please check the documentation on
60 // Transport_Connector.h
61 int open (TAO_ORB_Core *orb_core);
62 int close ();
63 TAO_Profile *create_profile (TAO_InputCDR& cdr);
65 virtual int check_prefix (const char *endpoint);
67 virtual char object_key_delimiter () const;
69 public:
70 typedef TAO_Connect_Concurrency_Strategy<TAO_IIOP_Connection_Handler>
71 TAO_IIOP_CONNECT_CONCURRENCY_STRATEGY;
73 typedef TAO_Connect_Creation_Strategy<TAO_IIOP_Connection_Handler>
74 TAO_IIOP_CONNECT_CREATION_STRATEGY;
76 typedef ACE_Connect_Strategy<TAO_IIOP_Connection_Handler,
77 ACE_SOCK_CONNECTOR>
78 TAO_IIOP_CONNECT_STRATEGY;
80 typedef ACE_Strategy_Connector<TAO_IIOP_Connection_Handler,
81 ACE_SOCK_CONNECTOR>
82 TAO_IIOP_BASE_CONNECTOR;
84 protected:
85 /// A flag indicating the actual connector supports parallel
86 /// connection attempts. The base implementation always returns
87 /// 0. Override to return non-zero if parallel connection attempts
88 /// may be tried.
89 virtual int supports_parallel_connects () const;
91 // = The TAO_Connector methods, please check the documentation on
92 // Transport_Connector.h
93 int set_validate_endpoint (TAO_Endpoint *ep);
95 virtual TAO_Transport *make_connection (
96 TAO::Profile_Transport_Resolver *r,
97 TAO_Transport_Descriptor_Interface &desc,
98 ACE_Time_Value *timeout = 0);
100 virtual TAO_Transport *make_parallel_connection (
101 TAO::Profile_Transport_Resolver *r,
102 TAO_Transport_Descriptor_Interface &desc,
103 ACE_Time_Value *timeout = 0);
105 /// More TAO_Connector methods, please check the documentation on
106 /// Transport_Connector.h
107 virtual TAO_Profile *make_profile ();
109 /// Cancel the passed cvs handler from the connector
110 virtual int cancel_svc_handler (TAO_Connection_Handler * svc_handler);
112 private:
113 /// This is the first half of making a connection. Both make_connection
114 /// and make_parallel_connection will start out using begin_connection.
115 int begin_connection (TAO_IIOP_Connection_Handler *&svc_handler,
116 TAO::Profile_Transport_Resolver *r,
117 TAO_IIOP_Endpoint *endpoint,
118 ACE_Time_Value *timeout = 0);
120 /// This is the second half of making a connection when several endpoints
121 /// are involved. This works with modified wait strategies to wait for one
122 /// of many transports, and when once completes it will cancel the rest.
123 /// The winning transport is returned.
124 TAO_Transport *complete_connection (int result,
125 TAO_Transport_Descriptor_Interface &desc,
126 TAO_IIOP_Connection_Handler **&sh_list,
127 TAO_IIOP_Endpoint **ep_list,
128 unsigned count,
129 TAO::Profile_Transport_Resolver *r,
130 TAO_LF_Multi_Event *mev,
131 ACE_Time_Value *timeout = 0);
134 /// Return the remote endpoint, a helper function
135 TAO_IIOP_Endpoint *remote_endpoint (TAO_Endpoint *ep);
137 private:
138 /// Our connect strategy
139 TAO_IIOP_CONNECT_STRATEGY connect_strategy_;
141 /// The connector initiating connection requests for IIOP.
142 TAO_IIOP_BASE_CONNECTOR base_connector_;
145 TAO_END_VERSIONED_NAMESPACE_DECL
147 #endif /* TAO_HAS_IIOP && TAO_HAS_IIOP != 0 */
149 #include /**/ "ace/post.h"
150 #endif /* TAO_IIOP_CONNECTOR_H */