1 #include "tao/PortableServer/Active_Object_Map.h"
2 #include "tao/PortableServer/Active_Object_Map_Entry.h"
4 #if !defined (__ACE_INLINE__)
5 # include "tao/PortableServer/Active_Object_Map.inl"
6 #endif /* __ACE_INLINE__ */
8 #include "tao/SystemException.h"
11 #include "ace/CORBA_macros.h"
12 #include "tao/debug.h"
13 #include "PortableServer_Functions.h"
15 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
18 size_t TAO_Active_Object_Map::system_id_size_
= 0;
21 hexstring (ACE_CString
& hexstr
, const char* s
, size_t l
)
25 hexstr
.fast_resize (2 + l
* 2);
26 hexstr
.append ("0x", 2);
29 ACE_OS::sprintf (buf
, "%02x", (unsigned int)(unsigned char)*s
);
30 hexstr
.append (buf
, 2);
36 TAO_Active_Object_Map::set_system_id_size (
37 const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters
&creation_parameters
)
39 if (TAO_Active_Object_Map::system_id_size_
== 0)
41 if (creation_parameters
.allow_reactivation_of_system_ids_
)
43 switch (creation_parameters
.object_lookup_strategy_for_system_id_policy_
)
45 #if (TAO_HAS_MINIMUM_POA_MAPS == 0)
47 TAO_Active_Object_Map::system_id_size_
= sizeof (CORBA::ULong
);
49 #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */
51 case TAO_DYNAMIC_HASH
:
53 TAO_Active_Object_Map::system_id_size_
= sizeof (CORBA::ULong
);
59 if (creation_parameters
.use_active_hint_in_ids_
)
60 hint_size
= ACE_Active_Map_Manager_Key::size ();
62 TAO_Active_Object_Map::system_id_size_
+= hint_size
;
66 switch (creation_parameters
.object_lookup_strategy_for_system_id_policy_
)
68 #if (TAO_HAS_MINIMUM_POA_MAPS == 0)
70 TAO_Active_Object_Map::system_id_size_
= sizeof (CORBA::ULong
);
73 case TAO_DYNAMIC_HASH
:
74 TAO_Active_Object_Map::system_id_size_
= sizeof (CORBA::ULong
);
76 #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */
78 case TAO_ACTIVE_DEMUX
:
80 TAO_Active_Object_Map::system_id_size_
=
81 ACE_Active_Map_Manager_Key::size ();
88 TAO_Active_Object_Map::TAO_Active_Object_Map (
91 int persistent_id_policy
,
92 const TAO_Server_Strategy_Factory::Active_Object_Map_Creation_Parameters
&
94 : using_active_maps_ (false)
96 TAO_Active_Object_Map::set_system_id_size (creation_parameters
);
98 TAO_Id_Uniqueness_Strategy
*id_uniqueness_strategy
= 0;
100 if (unique_id_policy
)
102 ACE_NEW_THROW_EX (id_uniqueness_strategy
,
103 TAO_Unique_Id_Strategy
,
104 CORBA::NO_MEMORY ());
108 #if !defined (CORBA_E_MICRO)
109 ACE_NEW_THROW_EX (id_uniqueness_strategy
,
110 TAO_Multiple_Id_Strategy
,
111 CORBA::NO_MEMORY ());
113 TAOLIB_ERROR ((LM_ERROR
,
114 "Multiple Id Strategy not supported with CORBA/e\n"));
118 // Give ownership to the unique pointer.
119 std::unique_ptr
<TAO_Id_Uniqueness_Strategy
> new_id_uniqueness_strategy (id_uniqueness_strategy
);
121 TAO_Lifespan_Strategy
*lifespan_strategy
= 0;
123 if (persistent_id_policy
)
125 #if !defined (CORBA_E_MICRO)
126 ACE_NEW_THROW_EX (lifespan_strategy
,
127 TAO_Persistent_Strategy
,
128 CORBA::NO_MEMORY ());
130 ACE_UNUSED_ARG (persistent_id_policy
);
131 TAOLIB_ERROR ((LM_ERROR
,
132 "Persistent Id Strategy not supported with CORBA/e\n"));
137 ACE_NEW_THROW_EX (lifespan_strategy
,
138 TAO_Transient_Strategy
,
139 CORBA::NO_MEMORY ());
142 // Give ownership to the unique pointer.
143 std::unique_ptr
<TAO_Lifespan_Strategy
> new_lifespan_strategy (lifespan_strategy
);
145 TAO_Id_Assignment_Strategy
*id_assignment_strategy
= 0;
149 #if !defined (CORBA_E_MICRO)
150 ACE_NEW_THROW_EX (id_assignment_strategy
,
151 TAO_User_Id_Strategy
,
152 CORBA::NO_MEMORY ());
154 TAOLIB_ERROR ((LM_ERROR
,
155 "User Id Assignment not supported with CORBA/e\n"));
158 else if (unique_id_policy
)
160 ACE_NEW_THROW_EX (id_assignment_strategy
,
161 TAO_System_Id_With_Unique_Id_Strategy
,
162 CORBA::NO_MEMORY ());
166 #if !defined (CORBA_E_MICRO)
167 ACE_NEW_THROW_EX (id_assignment_strategy
,
168 TAO_System_Id_With_Multiple_Id_Strategy
,
169 CORBA::NO_MEMORY ());
171 TAOLIB_ERROR ((LM_ERROR
,
172 "System Id Assignment with multiple "
173 "not supported with CORBA/e\n"));
177 // Give ownership to the unique pointer.
178 std::unique_ptr
<TAO_Id_Assignment_Strategy
> new_id_assignment_strategy (id_assignment_strategy
);
180 TAO_Id_Hint_Strategy
*id_hint_strategy
= 0;
182 || creation_parameters
.allow_reactivation_of_system_ids_
)
183 && creation_parameters
.use_active_hint_in_ids_
)
185 this->using_active_maps_
= true;
187 ACE_NEW_THROW_EX (id_hint_strategy
,
188 TAO_Active_Hint_Strategy (
189 creation_parameters
.active_object_map_size_
),
190 CORBA::NO_MEMORY ());
194 ACE_NEW_THROW_EX (id_hint_strategy
,
195 TAO_No_Hint_Strategy
,
196 CORBA::NO_MEMORY ());
199 // Give ownership to the unique pointer.
200 std::unique_ptr
<TAO_Id_Hint_Strategy
> new_id_hint_strategy (id_hint_strategy
);
203 if (unique_id_policy
)
205 switch (creation_parameters
.reverse_object_lookup_strategy_for_unique_id_policy_
)
208 #if (TAO_HAS_MINIMUM_POA_MAPS == 0)
209 ACE_NEW_THROW_EX (sm
,
211 creation_parameters
.active_object_map_size_
),
212 CORBA::NO_MEMORY ());
215 TAOLIB_ERROR ((LM_ERROR
,
217 "-ORBUniqueidPolicyReverseDemuxStrategy "
218 "not supported with minimum POA maps. "
219 "Ignoring option to use default...\n"));
221 #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */
223 case TAO_DYNAMIC_HASH
:
225 ACE_NEW_THROW_EX (sm
,
227 creation_parameters
.active_object_map_size_
),
228 CORBA::NO_MEMORY ());
233 // Give ownership to the unique pointer.
234 std::unique_ptr
<servant_map
> new_servant_map (sm
);
236 user_id_map
*uim
= 0;
238 || creation_parameters
.allow_reactivation_of_system_ids_
)
240 switch (creation_parameters
.object_lookup_strategy_for_user_id_policy_
)
243 #if (TAO_HAS_MINIMUM_POA_MAPS == 0)
244 ACE_NEW_THROW_EX (uim
,
246 creation_parameters
.active_object_map_size_
),
247 CORBA::NO_MEMORY ());
250 TAOLIB_ERROR ((LM_ERROR
,
251 "linear option for -ORBUseridPolicyDemuxStrategy "
252 "not supported with minimum POA maps. "
253 "Ignoring option to use default...\n"));
255 #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */
257 case TAO_DYNAMIC_HASH
:
259 ACE_NEW_THROW_EX (uim
,
260 user_id_hash_map (creation_parameters
.active_object_map_size_
),
261 CORBA::NO_MEMORY ());
267 switch (creation_parameters
.object_lookup_strategy_for_system_id_policy_
)
269 #if (TAO_HAS_MINIMUM_POA_MAPS == 0)
271 ACE_NEW_THROW_EX (uim
,
272 user_id_linear_map (creation_parameters
.active_object_map_size_
),
273 CORBA::NO_MEMORY ());
276 case TAO_DYNAMIC_HASH
:
277 ACE_NEW_THROW_EX (uim
,
278 user_id_hash_map (creation_parameters
.active_object_map_size_
),
279 CORBA::NO_MEMORY ());
283 case TAO_DYNAMIC_HASH
:
284 TAOLIB_ERROR ((LM_ERROR
,
285 "linear and dynamic options for -ORBSystemidPolicyDemuxStrategy "
286 "are not supported with minimum POA maps. "
287 "Ignoring option to use default...\n"));
289 #endif /* TAO_HAS_MINIMUM_POA_MAPS == 0 */
291 case TAO_ACTIVE_DEMUX
:
294 this->using_active_maps_
= true;
296 ACE_NEW_THROW_EX (uim
,
297 user_id_active_map (creation_parameters
.active_object_map_size_
),
298 CORBA::NO_MEMORY ());
303 // Give ownership to the unique pointer.
304 std::unique_ptr
<user_id_map
> new_user_id_map (uim
);
306 id_uniqueness_strategy
->set_active_object_map (this);
307 lifespan_strategy
->set_active_object_map (this);
308 id_assignment_strategy
->set_active_object_map (this);
310 // Finally everything is fine. Make sure to take ownership away
311 // from the unique pointer.
312 this->id_uniqueness_strategy_
= std::move(new_id_uniqueness_strategy
);
313 this->lifespan_strategy_
= std::move(new_lifespan_strategy
);
314 this->id_assignment_strategy_
= std::move(new_id_assignment_strategy
);
315 this->id_hint_strategy_
= std::move(new_id_hint_strategy
);
316 this->servant_map_
= std::move(new_servant_map
);
317 this->user_id_map_
= std::move(new_user_id_map
);
319 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
320 ACE_NEW (this->monitor_
,
321 ACE::Monitor_Control::Size_Monitor
);
322 #endif /* TAO_HAS_MONITOR_POINTS==1 */
325 TAO_Active_Object_Map::~TAO_Active_Object_Map ()
327 user_id_map::iterator iterator
= this->user_id_map_
->begin ();
328 user_id_map::iterator end
= this->user_id_map_
->end ();
334 user_id_map::value_type map_entry
= *iterator
;
335 delete map_entry
.second ();
338 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
339 this->monitor_
->remove_from_registry ();
340 this->monitor_
->remove_ref ();
341 #endif /* TAO_HAS_MONITOR_POINTS==1 */
345 TAO_Active_Object_Map::is_user_id_in_map (
346 const PortableServer::ObjectId
&user_id
,
347 CORBA::Short priority
,
348 bool &priorities_match
,
351 TAO_Active_Object_Map_Entry
*entry
= 0;
353 int const find_result
= this->user_id_map_
->find (user_id
, entry
);
355 if (find_result
== 0)
357 if (entry
->servant_
== 0)
359 if (entry
->priority_
!= priority
)
361 priorities_match
= false;
368 if (entry
->deactivated_
)
378 ////////////////////////////////////////////////////////////////////////////////
381 TAO_Id_Uniqueness_Strategy::set_active_object_map (
382 TAO_Active_Object_Map
*active_object_map
)
384 this->active_object_map_
= active_object_map
;
388 TAO_Unique_Id_Strategy::is_servant_in_map (PortableServer::Servant servant
,
391 TAO_Active_Object_Map_Entry
*entry
= 0;
392 int result
= this->active_object_map_
->servant_map_
->find (servant
,
398 if (entry
->deactivated_
)
412 TAO_Unique_Id_Strategy::bind_using_user_id (
413 PortableServer::Servant servant
,
414 const PortableServer::ObjectId
&user_id
,
415 CORBA::Short priority
,
416 TAO_Active_Object_Map_Entry
*&entry
)
419 this->active_object_map_
->user_id_map_
->find (user_id
, entry
);
425 entry
->servant_
= servant
;
428 this->active_object_map_
->servant_map_
->bind (entry
->servant_
,
431 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
434 this->active_object_map_
->monitor_
->receive (
435 this->active_object_map_
->servant_map_
->current_size ());
437 #endif /* TAO_HAS_MONITOR_POINTS==1 */
442 ACE_NEW_RETURN (entry
,
443 TAO_Active_Object_Map_Entry
,
445 entry
->user_id_
= user_id
;
446 entry
->servant_
= servant
;
447 entry
->priority_
= priority
;
449 result
= this->active_object_map_
->id_hint_strategy_
->bind (*entry
);
454 this->active_object_map_
->user_id_map_
->bind (entry
->user_id_
,
461 this->active_object_map_
->servant_map_
->bind (
468 this->active_object_map_
->user_id_map_
->unbind (
470 this->active_object_map_
->id_hint_strategy_
->unbind (
476 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
477 this->active_object_map_
->monitor_
->receive (
478 this->active_object_map_
->servant_map_
->current_size ());
479 #endif /* TAO_HAS_MONITOR_POINTS==1 */
484 this->active_object_map_
->id_hint_strategy_
->unbind (*entry
);
494 #if (TAO_HAS_MINIMUM_CORBA == 0)
495 if (result
== 0 && TAO_debug_level
> 7)
497 CORBA::String_var
idstr (PortableServer::ObjectId_to_string (user_id
));
498 CORBA::String_var
repository_id (
499 servant
? servant
->_repository_id () : 0);
500 ACE_CString hex_idstr
;
501 hexstring (hex_idstr
, idstr
.in (), user_id
.length ());
503 TAOLIB_DEBUG ((LM_DEBUG
,
504 "TAO (%P|%t) - TAO_Unique_Id_Strategy::"
505 "bind_using_user_id: type=%C, id=%C\n",
515 TAO_Unique_Id_Strategy::unbind_using_user_id (
516 const PortableServer::ObjectId
&user_id
)
518 TAO_Active_Object_Map_Entry
*entry
= 0;
519 int result
= this->active_object_map_
->user_id_map_
->unbind (user_id
,
523 if (TAO_debug_level
> 7)
525 CORBA::String_var
idstr (
526 PortableServer::ObjectId_to_string (entry
->user_id_
));
527 ACE_CString hex_idstr
;
528 hexstring (hex_idstr
, idstr
.in (), entry
->user_id_
.length ());
530 TAOLIB_DEBUG ((LM_DEBUG
,
531 "TAO (%P|%t) - TAO_Unique_Id_Strategy::unbind_using_user_id: id=%C\n",
535 if (entry
->servant_
!= 0)
538 this->active_object_map_
->servant_map_
->unbind (entry
->servant_
);
544 this->active_object_map_
->id_hint_strategy_
->unbind (*entry
);
546 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
547 this->active_object_map_
->monitor_
->receive (
548 this->active_object_map_
->servant_map_
->current_size ());
549 #endif /* TAO_HAS_MONITOR_POINTS==1 */
562 TAO_Unique_Id_Strategy::find_user_id_using_servant (
563 PortableServer::Servant servant
,
564 PortableServer::ObjectId_out user_id
)
566 TAO_Active_Object_Map_Entry
*entry
= 0;
567 int result
= this->active_object_map_
->servant_map_
->find (servant
, entry
);
571 if (entry
->deactivated_
)
577 ACE_NEW_RETURN (user_id
,
578 PortableServer::ObjectId (entry
->user_id_
),
587 TAO_Unique_Id_Strategy::find_system_id_using_servant (
588 PortableServer::Servant servant
,
589 PortableServer::ObjectId_out system_id
,
590 CORBA::Short
&priority
)
592 TAO_Active_Object_Map_Entry
*entry
= 0;
593 int result
= this->active_object_map_
->servant_map_
->find (servant
,
597 if (entry
->deactivated_
)
604 this->active_object_map_
->id_hint_strategy_
->system_id (
609 priority
= entry
->priority_
;
618 TAO_Unique_Id_Strategy::remaining_activations (
619 PortableServer::Servant servant
)
621 ACE_UNUSED_ARG (servant
);
623 // Since servant are always unique here, return false.
627 ////////////////////////////////////////////////////////////////////////////////
629 #if !defined (CORBA_E_MICRO)
631 TAO_Multiple_Id_Strategy::is_servant_in_map (PortableServer::Servant
, bool &)
637 TAO_Multiple_Id_Strategy::bind_using_user_id (
638 PortableServer::Servant servant
,
639 const PortableServer::ObjectId
&user_id
,
640 CORBA::Short priority
,
641 TAO_Active_Object_Map_Entry
*&entry
)
644 this->active_object_map_
->user_id_map_
->find (user_id
, entry
);
650 entry
->servant_
= servant
;
655 ACE_NEW_RETURN (entry
,
656 TAO_Active_Object_Map_Entry
,
658 entry
->user_id_
= user_id
;
659 entry
->servant_
= servant
;
660 entry
->priority_
= priority
;
663 this->active_object_map_
->id_hint_strategy_
->bind (*entry
);
668 this->active_object_map_
->user_id_map_
->bind (entry
->user_id_
,
672 this->active_object_map_
->id_hint_strategy_
->unbind (*entry
);
677 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
678 this->active_object_map_
->monitor_
->receive (
679 this->active_object_map_
->user_id_map_
->current_size ());
680 #endif /* TAO_HAS_MONITOR_POINTS==1 */
689 #if (TAO_HAS_MINIMUM_CORBA == 0)
690 if (result
== 0 && TAO_debug_level
> 7)
692 CORBA::String_var
idstr (PortableServer::ObjectId_to_string (user_id
));
693 CORBA::String_var
repository_id (
694 servant
? servant
->_repository_id () : 0);
695 ACE_CString hex_idstr
;
696 hexstring (hex_idstr
, idstr
.in (), user_id
.length ());
698 TAOLIB_DEBUG ((LM_DEBUG
,
699 "TAO (%P|%t) - TAO_Multiple_Id_Strategy::"
700 "bind_using_user_id: type=%C, id=%C\n",
711 TAO_Multiple_Id_Strategy::unbind_using_user_id (
712 const PortableServer::ObjectId
&user_id
)
714 TAO_Active_Object_Map_Entry
*entry
= 0;
715 int result
= this->active_object_map_
->user_id_map_
->unbind (user_id
,
719 if (TAO_debug_level
> 7)
721 CORBA::String_var
idstr (
722 PortableServer::ObjectId_to_string (entry
->user_id_
));
723 ACE_CString hex_idstr
;
724 hexstring (hex_idstr
, idstr
.in (), entry
->user_id_
.length ());
726 TAOLIB_DEBUG ((LM_DEBUG
,
727 "TAO (%P|%t) - TAO_Multiple_Id_Strategy::unbind_using_user_id: id=%C\n",
731 result
= this->active_object_map_
->id_hint_strategy_
->unbind (*entry
);
738 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
739 this->active_object_map_
->monitor_
->receive (
740 this->active_object_map_
->user_id_map_
->current_size ());
741 #endif /* TAO_HAS_MONITOR_POINTS==1 */
748 TAO_Multiple_Id_Strategy::find_user_id_using_servant (
749 PortableServer::Servant
,
750 PortableServer::ObjectId_out
)
756 TAO_Multiple_Id_Strategy::find_system_id_using_servant (
757 PortableServer::Servant
,
758 PortableServer::ObjectId_out
,
765 TAO_Multiple_Id_Strategy::remaining_activations (
766 PortableServer::Servant servant
)
768 TAO_Active_Object_Map::user_id_map::iterator end
=
769 this->active_object_map_
->user_id_map_
->end ();
771 for (TAO_Active_Object_Map::user_id_map::iterator iter
=
772 this->active_object_map_
->user_id_map_
->begin ();
776 TAO_Active_Object_Map::user_id_map::value_type map_pair
= *iter
;
777 TAO_Active_Object_Map_Entry
*entry
= map_pair
.second ();
779 if (entry
->servant_
== servant
)
790 TAO_Lifespan_Strategy::set_active_object_map (
791 TAO_Active_Object_Map
*active_object_map
)
793 this->active_object_map_
= active_object_map
;
797 TAO_Transient_Strategy::find_servant_using_system_id_and_user_id (
798 const PortableServer::ObjectId
&system_id
,
799 const PortableServer::ObjectId
&user_id
,
800 PortableServer::Servant
&servant
,
801 TAO_Active_Object_Map_Entry
*&entry
)
803 int result
= this->active_object_map_
->id_hint_strategy_
->find (system_id
,
807 if (entry
->deactivated_
)
811 else if (entry
->servant_
== 0)
817 servant
= entry
->servant_
;
822 result
= this->active_object_map_
->user_id_map_
->find (user_id
,
826 if (entry
->deactivated_
)
830 else if (entry
->servant_
== 0)
836 servant
= entry
->servant_
;
849 ////////////////////////////////////////////////////////////////////////////////
851 #if !defined (CORBA_E_MICRO)
853 TAO_Persistent_Strategy::find_servant_using_system_id_and_user_id (
854 const PortableServer::ObjectId
&system_id
,
855 const PortableServer::ObjectId
&user_id
,
856 PortableServer::Servant
&servant
,
857 TAO_Active_Object_Map_Entry
*&entry
)
860 this->active_object_map_
->id_hint_strategy_
->find (system_id
,
862 if (result
== 0 && user_id
== entry
->user_id_
)
864 if (entry
->deactivated_
)
868 else if (entry
->servant_
== 0)
874 servant
= entry
->servant_
;
880 this->active_object_map_
->user_id_map_
->find (user_id
, entry
);
884 if (entry
->deactivated_
)
888 else if (entry
->servant_
== 0)
894 servant
= entry
->servant_
;
909 TAO_Id_Assignment_Strategy::set_active_object_map (
910 TAO_Active_Object_Map
*active_object_map
)
912 this->active_object_map_
= active_object_map
;
915 #if !defined (CORBA_E_MICRO)
917 TAO_User_Id_Strategy::bind_using_system_id (PortableServer::Servant
,
919 TAO_Active_Object_Map_Entry
*&)
926 TAO_System_Id_With_Unique_Id_Strategy::bind_using_system_id (
927 PortableServer::Servant servant
,
928 CORBA::Short priority
,
929 TAO_Active_Object_Map_Entry
*&entry
)
931 ACE_NEW_RETURN (entry
,
932 TAO_Active_Object_Map_Entry
,
936 this->active_object_map_
->user_id_map_
->bind_create_key (entry
,
940 entry
->servant_
= servant
;
941 entry
->priority_
= priority
;
943 result
= this->active_object_map_
->id_hint_strategy_
->bind (*entry
);
950 this->active_object_map_
->servant_map_
->bind (entry
->servant_
,
956 this->active_object_map_
->user_id_map_
->unbind (entry
->user_id_
);
957 this->active_object_map_
->id_hint_strategy_
->unbind (*entry
);
962 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
963 this->active_object_map_
->monitor_
->receive (
964 this->active_object_map_
->servant_map_
->current_size ());
965 #endif /* TAO_HAS_MONITOR_POINTS==1 */
970 this->active_object_map_
->user_id_map_
->unbind (entry
->user_id_
);
979 #if (TAO_HAS_MINIMUM_CORBA == 0)
980 if (result
== 0 && TAO_debug_level
> 7)
982 CORBA::String_var
idstr (
983 PortableServer::ObjectId_to_string (entry
->user_id_
));
984 CORBA::String_var
repository_id (
985 servant
? servant
->_repository_id () : 0);
986 ACE_CString hex_idstr
;
987 hexstring (hex_idstr
, idstr
.in (), entry
->user_id_
.length ());
989 TAOLIB_DEBUG ((LM_DEBUG
,
990 "TAO (%P|%t) - TAO_System_Id_With_Unique_Id_Strategy::"
991 "bind_using_system_id: type=%C, id=%C\n",
1001 #if !defined (CORBA_E_MICRO)
1003 TAO_System_Id_With_Multiple_Id_Strategy::bind_using_system_id (
1004 PortableServer::Servant servant
,
1005 CORBA::Short priority
,
1006 TAO_Active_Object_Map_Entry
*&entry
)
1008 ACE_NEW_RETURN (entry
,
1009 TAO_Active_Object_Map_Entry
,
1012 this->active_object_map_
->user_id_map_
->bind_create_key (entry
,
1016 entry
->servant_
= servant
;
1017 entry
->priority_
= priority
;
1019 result
= this->active_object_map_
->id_hint_strategy_
->bind (*entry
);
1023 this->active_object_map_
->user_id_map_
->unbind (entry
->user_id_
);
1027 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1)
1028 this->active_object_map_
->monitor_
->receive (
1029 this->active_object_map_
->user_id_map_
->current_size ());
1030 #endif /* TAO_HAS_MONITOR_POINTS==1 */
1037 #if (TAO_HAS_MINIMUM_CORBA == 0)
1038 if (result
== 0 && TAO_debug_level
> 7)
1040 CORBA::String_var
idstr (
1041 PortableServer::ObjectId_to_string (entry
->user_id_
));
1042 CORBA::String_var
repository_id (
1043 servant
? servant
->_repository_id () : 0);
1044 ACE_CString hex_idstr
;
1045 hexstring (hex_idstr
, idstr
.in (), entry
->user_id_
.length ());
1047 TAOLIB_DEBUG ((LM_DEBUG
,
1048 "TAO (%P|%t) - TAO_System_Id_With_Multiple_Id_Strategy::"
1049 "bind_using_system_id: type=%C, id=%C\n",
1050 repository_id
.in (),
1060 ////////////////////////////////////////////////////////////////////////////////
1062 TAO_Active_Hint_Strategy::TAO_Active_Hint_Strategy (CORBA::ULong map_size
)
1063 : system_id_map_ (map_size
)
1068 TAO_Active_Hint_Strategy::recover_key (
1069 const PortableServer::ObjectId
&system_id
,
1070 PortableServer::ObjectId
&user_id
)
1072 return this->system_id_map_
.recover_key (system_id
, user_id
);
1076 TAO_Active_Hint_Strategy::bind (TAO_Active_Object_Map_Entry
&entry
)
1078 entry
.system_id_
= entry
.user_id_
;
1080 return this->system_id_map_
.bind_modify_key (&entry
,
1085 TAO_Active_Hint_Strategy::unbind (TAO_Active_Object_Map_Entry
&entry
)
1087 return this->system_id_map_
.unbind (entry
.system_id_
);
1091 TAO_Active_Hint_Strategy::find (const PortableServer::ObjectId
&system_id
,
1092 TAO_Active_Object_Map_Entry
*&entry
)
1094 return this->system_id_map_
.find (system_id
,
1099 TAO_Active_Hint_Strategy::hint_size ()
1101 return ACE_Active_Map_Manager_Key::size ();
1105 TAO_Active_Hint_Strategy::system_id (PortableServer::ObjectId_out system_id
,
1106 TAO_Active_Object_Map_Entry
&entry
)
1108 ACE_NEW_RETURN (system_id
,
1109 PortableServer::ObjectId (entry
.system_id_
),
1114 ////////////////////////////////////////////////////////////////////////////////
1117 TAO_No_Hint_Strategy::recover_key (const PortableServer::ObjectId
&system_id
,
1118 PortableServer::ObjectId
&user_id
)
1120 // Smartly copy all the data; <user_id does not own the data>.
1121 user_id
.replace (system_id
.maximum (),
1122 system_id
.length (),
1123 const_cast<CORBA::Octet
*> (system_id
.get_buffer ()),
1130 TAO_No_Hint_Strategy::bind (TAO_Active_Object_Map_Entry
&)
1136 TAO_No_Hint_Strategy::unbind (TAO_Active_Object_Map_Entry
&)
1142 TAO_No_Hint_Strategy::find (const PortableServer::ObjectId
&,
1143 TAO_Active_Object_Map_Entry
*&)
1149 TAO_No_Hint_Strategy::hint_size ()
1155 TAO_No_Hint_Strategy::system_id (PortableServer::ObjectId_out system_id
,
1156 TAO_Active_Object_Map_Entry
&entry
)
1158 ACE_NEW_RETURN (system_id
,
1159 PortableServer::ObjectId (entry
.user_id_
),
1164 TAO_END_VERSIONED_NAMESPACE_DECL