#include <Object_Adapter.h>
Inheritance diagram for TAO_Object_Adapter::Active_Hint_Strategy:
Public Member Functions | |
Active_Hint_Strategy (CORBA::ULong map_size) | |
virtual | ~Active_Hint_Strategy (void) |
virtual int | find_persistent_poa (const poa_name &system_name, TAO_Root_POA *&poa) |
virtual int | bind_persistent_poa (const poa_name &folded_name, TAO_Root_POA *poa, poa_name_out system_name) |
virtual int | unbind_persistent_poa (const poa_name &folded_name, const poa_name &system_name) |
Protected Types | |
typedef ACE_Active_Map_Manager_Adapter< poa_name, TAO_Root_POA *, TAO_Preserve_Original_Key_Adapter > | persistent_poa_system_map |
Protected Attributes | |
persistent_poa_system_map | persistent_poa_system_map_ |
This class will append an active hint to the POA name, making the POA lookups fast and predictable.
Definition at line 252 of file Object_Adapter.h.
typedef ACE_Active_Map_Manager_Adapter< poa_name, TAO_Root_POA *, TAO_Preserve_Original_Key_Adapter> TAO_Object_Adapter::Active_Hint_Strategy::persistent_poa_system_map [protected] |
Definition at line 275 of file Object_Adapter.h.
TAO_Object_Adapter::Active_Hint_Strategy::Active_Hint_Strategy | ( | CORBA::ULong | map_size | ) |
Definition at line 963 of file Object_Adapter.cpp.
00964 : persistent_poa_system_map_ (map_size) 00965 { 00966 }
TAO_Object_Adapter::Active_Hint_Strategy::~Active_Hint_Strategy | ( | void | ) | [virtual] |
int TAO_Object_Adapter::Active_Hint_Strategy::bind_persistent_poa | ( | const poa_name & | folded_name, | |
TAO_Root_POA * | poa, | |||
poa_name_out | system_name | |||
) | [virtual] |
Implements TAO_Object_Adapter::Hint_Strategy.
Definition at line 1001 of file Object_Adapter.cpp.
References ACE_NEW_RETURN, ACE_Map< KEY, VALUE >::bind(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::bind_modify_key(), TAO_Object_Adapter::name(), TAO_Object_Adapter::Hint_Strategy::object_adapter_, TAO_Object_Adapter::persistent_poa_name_map_, persistent_poa_system_map_, and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind().
01005 { 01006 poa_name name = folded_name; 01007 int result = this->persistent_poa_system_map_.bind_modify_key (poa, 01008 name); 01009 01010 if (result == 0) 01011 { 01012 result = 01013 this->object_adapter_->persistent_poa_name_map_->bind (folded_name, 01014 poa); 01015 01016 if (result != 0) 01017 this->persistent_poa_system_map_.unbind (name); 01018 else 01019 ACE_NEW_RETURN (system_name, 01020 poa_name (name), 01021 -1); 01022 } 01023 01024 return result; 01025 }
int TAO_Object_Adapter::Active_Hint_Strategy::find_persistent_poa | ( | const poa_name & | system_name, | |
TAO_Root_POA *& | poa | |||
) | [virtual] |
Implements TAO_Object_Adapter::Hint_Strategy.
Definition at line 973 of file Object_Adapter.cpp.
References TAO_Object_Adapter::activate_poa(), ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::find(), TAO_Root_POA::folded_name(), TAO_Object_Adapter::Hint_Strategy::object_adapter_, persistent_poa_system_map_, and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::recover_key().
00976 { 00977 poa_name folded_name; 00978 int result = this->persistent_poa_system_map_.recover_key (system_name, 00979 folded_name); 00980 00981 if (result == 0) 00982 { 00983 result = this->persistent_poa_system_map_.find (system_name, poa); 00984 if (result != 0 00985 || folded_name != poa->folded_name ()) 00986 { 00987 result = 00988 this->object_adapter_->persistent_poa_name_map_->find (folded_name, 00989 poa); 00990 if (result != 0) 00991 { 00992 result = this->object_adapter_->activate_poa (folded_name, poa); 00993 } 00994 } 00995 } 00996 00997 return result; 00998 }
int TAO_Object_Adapter::Active_Hint_Strategy::unbind_persistent_poa | ( | const poa_name & | folded_name, | |
const poa_name & | system_name | |||
) | [virtual] |
Implements TAO_Object_Adapter::Hint_Strategy.
Definition at line 1028 of file Object_Adapter.cpp.
References TAO_Object_Adapter::Hint_Strategy::object_adapter_, TAO_Object_Adapter::persistent_poa_name_map_, persistent_poa_system_map_, ACE_Map< KEY, VALUE >::unbind(), and ACE_Active_Map_Manager_Adapter< KEY, VALUE, KEY_ADAPTER >::unbind().
01031 { 01032 int result = this->persistent_poa_system_map_.unbind (system_name); 01033 01034 if (result == 0) 01035 result = 01036 this->object_adapter_->persistent_poa_name_map_->unbind (folded_name); 01037 01038 return result; 01039 }
persistent_poa_system_map TAO_Object_Adapter::Active_Hint_Strategy::persistent_poa_system_map_ [protected] |
Definition at line 277 of file Object_Adapter.h.
Referenced by bind_persistent_poa(), find_persistent_poa(), and unbind_persistent_poa().