#include <Active_Object_Map.h>
Inheritance diagram for TAO_Multiple_Id_Strategy:
Public Member Functions | |
virtual int | is_servant_in_map (PortableServer::Servant servant, bool &deactivated) |
Must be used with UNIQUE_ID policy. | |
virtual int | unbind_using_user_id (const PortableServer::ObjectId &user_id) |
virtual int | find_user_id_using_servant (PortableServer::Servant servant, PortableServer::ObjectId_out user_id) |
virtual int | find_system_id_using_servant (PortableServer::Servant servant, PortableServer::ObjectId_out system_id, CORBA::Short &priority) |
virtual int | bind_using_user_id (PortableServer::Servant servant, const PortableServer::ObjectId &user_id, CORBA::Short priority, TAO_Active_Object_Map_Entry *&entry) |
virtual CORBA::Boolean | remaining_activations (PortableServer::Servant servant) |
Strategy for the MULTIPLE_ID policy.
Definition at line 387 of file Active_Object_Map.h.
int TAO_Multiple_Id_Strategy::bind_using_user_id | ( | PortableServer::Servant | servant, | |
const PortableServer::ObjectId & | user_id, | |||
CORBA::Short | priority, | |||
TAO_Active_Object_Map_Entry *& | entry | |||
) | [virtual] |
Can be used with any policy. With the SYSTEM_ID policy, user_id is actually system_id
.
Implements TAO_Id_Uniqueness_Strategy.
Definition at line 609 of file Active_Object_Map.cpp.
References ACE_NEW_RETURN, TAO_Id_Uniqueness_Strategy::active_object_map_, TAO_Active_Object_Map::id_hint_strategy_, TAO_Active_Object_Map_Entry::priority_, TAO_Active_Object_Map_Entry::servant_, TAO_Active_Object_Map_Entry::user_id_, and TAO_Active_Object_Map::user_id_map_.
00614 { 00615 int result = 00616 this->active_object_map_->user_id_map_->find (user_id, entry); 00617 00618 if (result == 0) 00619 { 00620 if (servant != 0) 00621 { 00622 entry->servant_ = servant; 00623 } 00624 } 00625 else 00626 { 00627 ACE_NEW_RETURN (entry, 00628 TAO_Active_Object_Map_Entry, 00629 -1); 00630 entry->user_id_ = user_id; 00631 entry->servant_ = servant; 00632 entry->priority_ = priority; 00633 00634 result = 00635 this->active_object_map_->id_hint_strategy_->bind (*entry); 00636 00637 if (result == 0) 00638 { 00639 result = 00640 this->active_object_map_->user_id_map_->bind (entry->user_id_, 00641 entry); 00642 if (result != 0) 00643 { 00644 this->active_object_map_->id_hint_strategy_->unbind (*entry); 00645 delete entry; 00646 } 00647 else 00648 { 00649 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1) 00650 this->active_object_map_->monitor_->receive ( 00651 this->active_object_map_->user_id_map_->current_size ()); 00652 #endif /* TAO_HAS_MONITOR_POINTS==1 */ 00653 } 00654 } 00655 else 00656 { 00657 delete entry; 00658 } 00659 } 00660 00661 return result; 00662 }
int TAO_Multiple_Id_Strategy::find_system_id_using_servant | ( | PortableServer::Servant | servant, | |
PortableServer::ObjectId_out | system_id, | |||
CORBA::Short & | priority | |||
) | [virtual] |
Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, <user_id> is actually system_id.
Implements TAO_Id_Uniqueness_Strategy.
Definition at line 698 of file Active_Object_Map.cpp.
int TAO_Multiple_Id_Strategy::find_user_id_using_servant | ( | PortableServer::Servant | servant, | |
PortableServer::ObjectId_out | user_id | |||
) | [virtual] |
Must be used with UNIQUE_ID policy. With the SYSTEM_ID policy, user_id is actually system_id
.
Implements TAO_Id_Uniqueness_Strategy.
Definition at line 690 of file Active_Object_Map.cpp.
int TAO_Multiple_Id_Strategy::is_servant_in_map | ( | PortableServer::Servant | servant, | |
bool & | deactivated | |||
) | [virtual] |
Must be used with UNIQUE_ID policy.
Implements TAO_Id_Uniqueness_Strategy.
Definition at line 603 of file Active_Object_Map.cpp.
CORBA::Boolean TAO_Multiple_Id_Strategy::remaining_activations | ( | PortableServer::Servant | servant | ) | [virtual] |
Are there any remaining activations of servant in the active object map? Can be used with any policy.
Implements TAO_Id_Uniqueness_Strategy.
Definition at line 707 of file Active_Object_Map.cpp.
References TAO_Id_Uniqueness_Strategy::active_object_map_, TAO_Active_Object_Map_Entry::servant_, and TAO_Active_Object_Map::user_id_map_.
00709 { 00710 TAO_Active_Object_Map::user_id_map::iterator end = 00711 this->active_object_map_->user_id_map_->end (); 00712 00713 for (TAO_Active_Object_Map::user_id_map::iterator iter = 00714 this->active_object_map_->user_id_map_->begin (); 00715 iter != end; 00716 ++iter) 00717 { 00718 TAO_Active_Object_Map::user_id_map::value_type map_pair = *iter; 00719 TAO_Active_Object_Map_Entry *entry = map_pair.second (); 00720 00721 if (entry->servant_ == servant) 00722 { 00723 return 1; 00724 } 00725 } 00726 00727 return 0; 00728 }
int TAO_Multiple_Id_Strategy::unbind_using_user_id | ( | const PortableServer::ObjectId & | user_id | ) | [virtual] |
Can be used with any policy. With the SYSTEM_ID policy, user_id is actually system_id
.
Implements TAO_Id_Uniqueness_Strategy.
Definition at line 665 of file Active_Object_Map.cpp.
References TAO_Id_Uniqueness_Strategy::active_object_map_, TAO_Active_Object_Map::id_hint_strategy_, and TAO_Active_Object_Map::user_id_map_.
00667 { 00668 TAO_Active_Object_Map_Entry *entry = 0; 00669 int result = this->active_object_map_->user_id_map_->unbind (user_id, 00670 entry); 00671 if (result == 0) 00672 { 00673 result = this->active_object_map_->id_hint_strategy_->unbind (*entry); 00674 00675 if (result == 0) 00676 { 00677 delete entry; 00678 } 00679 00680 #if defined (TAO_HAS_MONITOR_POINTS) && (TAO_HAS_MONITOR_POINTS == 1) 00681 this->active_object_map_->monitor_->receive ( 00682 this->active_object_map_->user_id_map_->current_size ()); 00683 #endif /* TAO_HAS_MONITOR_POINTS==1 */ 00684 } 00685 00686 return result; 00687 }