2 #include "tao/PortableServer/Active_Object_Map_Entry.h"
4 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
7 TAO_Active_Object_Map::is_servant_in_map (PortableServer::Servant servant,
10 return this->id_uniqueness_strategy_->is_servant_in_map (servant,
15 TAO_Active_Object_Map::bind_using_system_id_returning_system_id (
16 PortableServer::Servant servant,
17 CORBA::Short priority,
18 PortableServer::ObjectId_out system_id)
20 if (servant == 0 && !this->using_active_maps_)
22 PortableServer::ObjectId id;
24 int result = this->user_id_map_->create_key (id);
28 ACE_NEW_RETURN (system_id,
29 PortableServer::ObjectId (id),
36 TAO_Active_Object_Map_Entry *entry = 0;
39 this->id_assignment_strategy_->bind_using_system_id (servant,
45 result = this->id_hint_strategy_->system_id (system_id,
53 TAO_Active_Object_Map::bind_using_system_id_returning_user_id (
54 PortableServer::Servant servant,
55 CORBA::Short priority,
56 PortableServer::ObjectId_out user_id)
58 TAO_Active_Object_Map_Entry *entry = 0;
61 this->id_assignment_strategy_->bind_using_system_id (servant,
65 ACE_NEW_RETURN (user_id,
66 PortableServer::ObjectId (entry->user_id_),
72 TAO_Active_Object_Map::bind_using_user_id (
73 PortableServer::Servant servant,
74 const PortableServer::ObjectId &user_id,
75 CORBA::Short priority)
77 TAO_Active_Object_Map_Entry *entry = 0;
78 return this->id_uniqueness_strategy_->bind_using_user_id (servant,
85 TAO_Active_Object_Map::find_system_id_using_user_id (
86 const PortableServer::ObjectId &user_id,
87 CORBA::Short priority,
88 PortableServer::ObjectId_out system_id)
90 if (!this->using_active_maps_)
92 ACE_NEW_RETURN (system_id,
93 PortableServer::ObjectId (user_id),
99 TAO_Active_Object_Map_Entry *entry = 0;
101 this->id_uniqueness_strategy_->bind_using_user_id (0,
108 this->id_hint_strategy_->system_id (system_id, *entry);
115 TAO_Active_Object_Map::rebind_using_user_id_and_system_id (
116 PortableServer::Servant servant,
117 const PortableServer::ObjectId &user_id,
118 const PortableServer::ObjectId &,
119 TAO_Active_Object_Map_Entry *&entry)
121 return this->id_uniqueness_strategy_->bind_using_user_id (servant,
128 TAO_Active_Object_Map::unbind_using_user_id (
129 const PortableServer::ObjectId &user_id)
131 return this->id_uniqueness_strategy_->unbind_using_user_id (user_id);
135 TAO_Active_Object_Map::find_user_id_using_servant (
136 PortableServer::Servant servant,
137 PortableServer::ObjectId_out user_id)
140 this->id_uniqueness_strategy_->find_user_id_using_servant (servant,
145 TAO_Active_Object_Map::find_system_id_using_servant (
146 PortableServer::Servant servant,
147 PortableServer::ObjectId_out system_id,
148 CORBA::Short &priority)
151 this->id_uniqueness_strategy_->find_system_id_using_servant (servant,
157 TAO_Active_Object_Map::find_servant_using_user_id (
158 const PortableServer::ObjectId &user_id,
159 PortableServer::Servant &servant)
161 TAO_Active_Object_Map_Entry *entry = 0;
162 int result = this->user_id_map_->find (user_id, entry);
166 if (entry->deactivated_)
170 else if (entry->servant_ == 0)
176 servant = entry->servant_;
184 TAO_Active_Object_Map::find_servant_using_system_id_and_user_id (
185 const PortableServer::ObjectId &system_id,
186 const PortableServer::ObjectId &user_id,
187 PortableServer::Servant &servant,
188 TAO_Active_Object_Map_Entry *&entry)
191 this->lifespan_strategy_->find_servant_using_system_id_and_user_id (
199 TAO_Active_Object_Map::find_entry_using_user_id (
200 const PortableServer::ObjectId &user_id,
201 TAO_Active_Object_Map_Entry *&entry)
203 int result = this->user_id_map_->find (user_id, entry);
207 if (entry->deactivated_)
217 TAO_Active_Object_Map::find_servant_and_system_id_using_user_id (
218 const PortableServer::ObjectId &user_id,
219 PortableServer::Servant &servant,
220 PortableServer::ObjectId_out system_id,
221 CORBA::Short &priority)
223 TAO_Active_Object_Map_Entry *entry = 0;
224 int result = this->find_entry_using_user_id (user_id, entry);
228 if (entry->servant_ == 0)
234 result = this->id_hint_strategy_->system_id (system_id,
238 servant = entry->servant_;
239 priority = entry->priority_;
248 TAO_Active_Object_Map::find_user_id_using_system_id (
249 const PortableServer::ObjectId &system_id,
250 PortableServer::ObjectId_out user_id)
252 PortableServer::ObjectId id;
253 if (this->id_hint_strategy_->recover_key (system_id, id) == 0)
255 ACE_NEW_RETURN (user_id,
256 PortableServer::ObjectId (id),
264 TAO_Active_Object_Map::find_user_id_using_system_id (
265 const PortableServer::ObjectId &system_id,
266 PortableServer::ObjectId &user_id)
268 return this->id_hint_strategy_->recover_key (system_id, user_id);
271 ACE_INLINE CORBA::Boolean
272 TAO_Active_Object_Map::remaining_activations (PortableServer::Servant servant)
274 return this->id_uniqueness_strategy_->remaining_activations (servant);
278 TAO_Active_Object_Map::current_size (void)
280 return this->user_id_map_->current_size ();
285 TAO_Active_Object_Map::system_id_size (void)
287 return TAO_Active_Object_Map::system_id_size_;
290 TAO_END_VERSIONED_NAMESPACE_DECL