summaryrefslogtreecommitdiff
path: root/TAO/tao/RTCORBA/RT_Invocation_Endpoint_Selectors.h
blob: 32dee2d07022b8c0e0e3ae89aa2d497206b2a695 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// This may look like C, but it's really -*- C++ -*-

//=============================================================================
/**
 *  @file   RT_Invocation_Endpoint_Selectors.h
 *
 *  $Id$
 *
 * Strategies for selecting profile/endpoint from an IOR for making an
 * invocation.
 *
 *
 *  @author Priyanka Gontla <pgontla@ece.uci.edu>
 */
//=============================================================================


#ifndef TAO_RT_INVOCATION_ENDPOINT_SELECTOR_H
#define TAO_RT_INVOCATION_ENDPOINT_SELECTOR_H
#include "ace/pre.h"

#include "tao/corbafwd.h"
#include "rtcorba_export.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "tao/MProfile.h"
#include "tao/Invocation_Endpoint_Selectors.h"

/**
 * @class TAO_RT_Default_Endpoint_Selector
 *
 * @brief TAO_RT_Default_Endpoint_Selector
 *
 * This strategy is used when the only policy that might be set is the
 * private connection policy.
 *
 **/
class TAO_RTCORBA_Export TAO_RT_Default_Endpoint_Selector :
  public TAO_Default_Endpoint_Selector
{
public:
  virtual void select_endpoint (TAO_GIOP_Invocation *invocation,
                                CORBA::Environment &ACE_TRY_ENV);
};

// ****************************************************************

/**
 * @class TAO_Priority_Endpoint_Selector
 *
 * @brief TAO_Priority_Endpoint_Selector
 *
 * This strategy is used when RTCORBA::PriorityModelPolicy is
 * set and its value is RTCORBA::CLIENT_PROPAGATED.
 *
 */
class TAO_RTCORBA_Export TAO_Priority_Endpoint_Selector :
  public TAO_Default_Endpoint_Selector
{
public:
  /// Constructor.
  TAO_Priority_Endpoint_Selector (void);

  /// Destructor.
  virtual ~TAO_Priority_Endpoint_Selector (void);

  virtual void select_endpoint (TAO_GIOP_Invocation *invocation,
                                CORBA::Environment &ACE_TRY_ENV);
private:
  /// Helper for <select_endpoint>.
  int is_multihomed (TAO_Endpoint *endpoint);
};

// ****************************************************************

/**
 * @class TAO_Bands_Endpoint_Selector
 *
 * @brief TAO_Bands_Endpoint_Selector
 *
 * This strategy is used when
 * RTCORBA::PriorityBandedConnectionPolicy is set.
 *
 */
class TAO_RTCORBA_Export TAO_Bands_Endpoint_Selector :
  public TAO_Default_Endpoint_Selector
{
public:
  /// Constructor.
  TAO_Bands_Endpoint_Selector (void);

  /// Destructor.
  virtual ~TAO_Bands_Endpoint_Selector (void);

  virtual void select_endpoint (TAO_GIOP_Invocation *invocation,
                                CORBA::Environment &ACE_TRY_ENV);
};

// ****************************************************************

/**
 * @class TAO_Protocol_Endpoint_Selector
 *
 * @brief TAO_Protocol_Endpoint_Selector
 *
 * This strategy is used when only RTCORBA::ClientProtocolPolicy is
 * set or RTCORBA::ClientProtocolPolicy plus
 * RTCORBA::SERVER_DECLARED priority model.
 *
 */
class TAO_RTCORBA_Export TAO_Protocol_Endpoint_Selector :
  public TAO_Invocation_Endpoint_Selector
{
public:
  /// Constructor.
  TAO_Protocol_Endpoint_Selector (void);

  /// Destructor.
  virtual ~TAO_Protocol_Endpoint_Selector (void);

  virtual void select_endpoint (TAO_GIOP_Invocation *invocation,
                                CORBA::Environment &ACE_TRY_ENV);
  virtual void next (TAO_GIOP_Invocation *invocation,
                     CORBA::Environment &ACE_TRY_ENV);
  virtual void forward (TAO_GIOP_Invocation *invocation,
                        const TAO_MProfile &mprofile,
                        CORBA::Environment &ACE_TRY_ENV);
  virtual void success (TAO_GIOP_Invocation *invocation);
  virtual void close_connection (TAO_GIOP_Invocation *invocation);
};

// ****************************************************************

/**
 * @class TAO_Priority_Protocol_Selector
 *
 * @brief TAO_Priority_Protocol_Selector
 *
 * This strategy is used when RTCORBA::ClientProtocolPolicy is
 * set and the priority model is RTCORBA::CLIENT_PROPAGATED.
 *
 */
class TAO_RTCORBA_Export TAO_Priority_Protocol_Selector :
  public TAO_Protocol_Endpoint_Selector
{
public:
  /// Constructor.
  TAO_Priority_Protocol_Selector (void);

  /// Destructor.
  virtual ~TAO_Priority_Protocol_Selector (void);

protected:
  /// Helper for <select_endpoint>.
  int is_multihomed (TAO_Endpoint *endpoint);
};

// ****************************************************************

/**
 * @class TAO_Bands_Protocol_Selector
 *
 * @brief TAO_Bands_Protocol_Selector
 *
 * This strategy is used when both RTCORBA::ClientProtocolPolicy
 * and RTCORBA::PriorityBandedConnectionPolicy are set.
 *
 */
class TAO_RTCORBA_Export TAO_Bands_Protocol_Selector :
  public TAO_Protocol_Endpoint_Selector
{
public:
  /// Constructor.
  TAO_Bands_Protocol_Selector (void);

  /// Destructor.
  virtual ~TAO_Bands_Protocol_Selector (void);
};

#if defined (__ACE_INLINE__)
# include "RT_Invocation_Endpoint_Selectors.i"
#endif /* __ACE_INLINE__ */

#include "ace/post.h"
#endif  /* TAO_RT_INVOCATION_ENDPOINT_SELECTOR_H */