summaryrefslogtreecommitdiff
path: root/TAO/tao/PortableServer/Object_Adapter.i
blob: d1cb1630b7f2f2984767a321fc85b762e027a9bb (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
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
// $Id$


ACE_INLINE
TAO_POA_Current::TAO_POA_Current (void)
{
}

ACE_INLINE TAO_Policy_Validator &
TAO_Object_Adapter::validator (void)
{
  return this->default_validator_;
}

ACE_INLINE TAO_POA_Policy_Set &
TAO_Object_Adapter::default_poa_policies (void)
{
  return this->default_poa_policies_;
}

ACE_INLINE ACE_Lock &
TAO_Object_Adapter::lock (void)
{
  return *this->lock_;
}

ACE_INLINE TAO_SYNCH_MUTEX &
TAO_Object_Adapter::thread_lock (void)
{
  return this->thread_lock_;
}

ACE_INLINE ACE_Reverse_Lock<ACE_Lock> &
TAO_Object_Adapter::reverse_lock (void)
{
  return this->reverse_lock_;
}

/* static */
ACE_INLINE CORBA::ULong
TAO_Object_Adapter::transient_poa_name_size ()
{
  return TAO_Object_Adapter::transient_poa_name_size_;
}

ACE_INLINE int
TAO_Object_Adapter::locate_servant (const TAO::ObjectKey &key
                                    ACE_ENV_ARG_DECL)
{
  // Lock access for the duration of this transaction.
  TAO_OBJECT_ADAPTER_GUARD_RETURN (-1);

  return this->locate_servant_i (key
                                 ACE_ENV_ARG_PARAMETER);
}

ACE_INLINE TAO_SERVANT_LOCATION
TAO_Object_Adapter::find_servant (const TAO::ObjectKey &key,
                                  PortableServer::Servant &servant
                                  ACE_ENV_ARG_DECL)
{
  // Lock access for the duration of this transaction.
  TAO_OBJECT_ADAPTER_GUARD_RETURN (TAO_SERVANT_NOT_FOUND);

  return this->find_servant_i (key,
                               servant
                               ACE_ENV_ARG_PARAMETER);
}

ACE_INLINE int
TAO_Object_Adapter::find_persistent_poa (const poa_name &system_name,
                                         TAO_POA *&poa
                                         ACE_ENV_ARG_DECL)
{
  return this->hint_strategy_->find_persistent_poa (system_name,
                                                    poa
                                                    ACE_ENV_ARG_PARAMETER);
}

ACE_INLINE int
TAO_Object_Adapter::find_poa (const poa_name &system_name,
                              CORBA::Boolean activate_it,
                              CORBA::Boolean root,
                              const TAO_Temporary_Creation_Time &poa_creation_time,
                              TAO_POA *&poa
                              ACE_ENV_ARG_DECL)
{
  if (activate_it)
    {
      return this->find_persistent_poa (system_name,
                                        poa
                                        ACE_ENV_ARG_PARAMETER);
    }
  else
    {
      return this->find_transient_poa (system_name,
                                       root,
                                       poa_creation_time,
                                       poa
                                       ACE_ENV_ARG_PARAMETER);
    }
}

ACE_INLINE int
TAO_Object_Adapter::bind_transient_poa (TAO_POA *poa,
                                        poa_name_out system_name)
{
  poa_name name;
  int result = this->transient_poa_map_->bind_create_key (poa,
                                                          name);

  if (result == 0)
    {
      ACE_NEW_RETURN (system_name,
                      poa_name (name),
                      -1);
    }

  return result;
}

ACE_INLINE int
TAO_Object_Adapter::bind_persistent_poa (const poa_name &folded_name,
                                         TAO_POA *poa,
                                         poa_name_out system_name)
{
  return this->hint_strategy_->bind_persistent_poa (folded_name,
                                                    poa,
                                                    system_name);
}

ACE_INLINE int
TAO_Object_Adapter::unbind_transient_poa (const poa_name &system_name)
{
  return this->transient_poa_map_->unbind (system_name);
}

ACE_INLINE int
TAO_Object_Adapter::unbind_persistent_poa (const poa_name &folded_name,
                                           const poa_name &system_name)
{
  return this->hint_strategy_->unbind_persistent_poa (folded_name,
                                                      system_name);
}

ACE_INLINE TAO_POA *
TAO_Object_Adapter::root_poa (void) const
{
  return this->root_;
}

ACE_INLINE TAO_ORB_Core &
TAO_Object_Adapter::orb_core (void) const
{
  return this->orb_core_;
}

ACE_INLINE TAO_Object_Adapter::Non_Servant_Upcall *
TAO_Object_Adapter::non_servant_upcall_in_progress (void) const
{
  return this->non_servant_upcall_in_progress_;
}

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

ACE_INLINE TAO_POA &
TAO_Object_Adapter::Non_Servant_Upcall::poa (void) const
{
  return this->poa_;
}

ACE_INLINE TAO_POA &
TAO_Object_Adapter::Servant_Upcall::poa (void) const
{
  return *this->poa_;
}

ACE_INLINE PortableServer::Servant
TAO_Object_Adapter::Servant_Upcall::servant (void) const
{
  return this->servant_;
}

ACE_INLINE TAO_Object_Adapter &
TAO_Object_Adapter::Servant_Upcall::object_adapter (void) const
{
  return *this->object_adapter_;
}

ACE_INLINE const PortableServer::ObjectId &
TAO_Object_Adapter::Servant_Upcall::id (void) const
{
  return this->system_id_;
}

ACE_INLINE void
TAO_Object_Adapter::Servant_Upcall::user_id (
  const PortableServer::ObjectId *id)
{
  this->user_id_ = id;
}

ACE_INLINE const PortableServer::ObjectId &
TAO_Object_Adapter::Servant_Upcall::user_id (void) const
{
  return *(this->user_id_);
}

#if (TAO_HAS_MINIMUM_POA == 0)

ACE_INLINE PortableServer::ServantLocator::Cookie
TAO_Object_Adapter::Servant_Upcall::locator_cookie (void) const
{
  return this->cookie_;
}

ACE_INLINE void
TAO_Object_Adapter::Servant_Upcall::locator_cookie (PortableServer::ServantLocator::Cookie cookie)
{
  this->cookie_ = cookie;
}

ACE_INLINE const char *
TAO_Object_Adapter::Servant_Upcall::operation (void) const
{
  return this->operation_;
}

ACE_INLINE void
TAO_Object_Adapter::Servant_Upcall::operation (const char *name)
{
  this->operation_ = name;
}

#endif /* TAO_HAS_MINIMUM_POA == 0 */

ACE_INLINE void
TAO_Object_Adapter::Servant_Upcall::active_object_map_entry (TAO_Active_Object_Map::Map_Entry *entry)
{
  this->active_object_map_entry_ = entry;
}

ACE_INLINE TAO_Active_Object_Map::Map_Entry *
TAO_Object_Adapter::Servant_Upcall::active_object_map_entry (void) const
{
  return this->active_object_map_entry_;
}

ACE_INLINE void
TAO_Object_Adapter::Servant_Upcall::using_servant_locator (void)
{
  this->using_servant_locator_ = 1;
}

////////////////////////////////////////////////////////////////////////////////

ACE_INLINE void
TAO_POA_Current_Impl::poa (TAO_POA *p)
{
  this->poa_ = p;
}

ACE_INLINE TAO_POA *
TAO_POA_Current_Impl::poa (void) const
{
  return this->poa_;
}

ACE_INLINE void
TAO_POA_Current_Impl::object_id (const PortableServer::ObjectId &id)
{
  this->object_id_ = id;
}

ACE_INLINE const PortableServer::ObjectId &
TAO_POA_Current_Impl::object_id (void) const
{
  return this->object_id_;
}

ACE_INLINE void
TAO_POA_Current_Impl::object_key (const TAO::ObjectKey &key)
{
  this->object_key_ = &key;
}

ACE_INLINE const TAO::ObjectKey &
TAO_POA_Current_Impl::object_key (void) const
{
  return *this->object_key_;
}

ACE_INLINE void
TAO_POA_Current_Impl::servant (PortableServer::Servant servant)
{
  this->servant_ = servant;
}

ACE_INLINE PortableServer::Servant
TAO_POA_Current_Impl::servant (void) const
{
  return this->servant_;
}

ACE_INLINE void
TAO_POA_Current_Impl::priority (CORBA::Short priority)
{
  this->priority_ = priority;
}

ACE_INLINE CORBA::Short
TAO_POA_Current_Impl::priority (void) const
{
  return this->priority_;
}

ACE_INLINE CORBA::Short
TAO_Object_Adapter::Servant_Upcall::priority (void) const
{
  return this->current_context_.priority ();
}

ACE_INLINE TAO_Object_Adapter::Servant_Upcall::State
TAO_Object_Adapter::Servant_Upcall::state (void) const
{
  return this->state_;
}

ACE_INLINE void
TAO_Object_Adapter::Servant_Upcall::state (TAO_Object_Adapter::Servant_Upcall::State state)
{
  this->state_ = state;
}