3 //=============================================================================
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)
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 // ****************************************************************
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
54 TAO_IIOP_Connector ();
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
);
63 TAO_Profile
*create_profile (TAO_InputCDR
& cdr
);
65 virtual int check_prefix (const char *endpoint
);
67 virtual char object_key_delimiter () const;
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
,
78 TAO_IIOP_CONNECT_STRATEGY
;
80 typedef ACE_Strategy_Connector
<TAO_IIOP_Connection_Handler
,
82 TAO_IIOP_BASE_CONNECTOR
;
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
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
);
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
,
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
);
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 */