diff options
Diffstat (limited to 'TAO/tao/Connection_Cache_Manager.cpp')
-rw-r--r-- | TAO/tao/Connection_Cache_Manager.cpp | 49 |
1 files changed, 37 insertions, 12 deletions
diff --git a/TAO/tao/Connection_Cache_Manager.cpp b/TAO/tao/Connection_Cache_Manager.cpp index ffd45ce44d2..262110dc7f2 100644 --- a/TAO/tao/Connection_Cache_Manager.cpp +++ b/TAO/tao/Connection_Cache_Manager.cpp @@ -38,15 +38,17 @@ TAO_Connection_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id, entry); if (retval == 0) { + int_id.handler ()->test_index_ = ext_id.index (); + // The entry has been added to cache succesfully // Add the cache_map_entry to the handler int_id.handler () ->cache_map_entry (entry); } else if (retval == 1) { - if (TAO_debug_level > 0 && retval != 0) + if (TAO_debug_level > 5 && retval != 0) { - ACE_ERROR ((LM_ERROR, + ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::bind_i") ACE_TEXT (" unable to bind in the first attempt \n") ACE_TEXT (" So trying with a new index \n"))); @@ -65,7 +67,7 @@ TAO_Connection_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id, } } - if (TAO_debug_level > 0 && retval != 0) + if (TAO_debug_level > 6 && retval != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::bind_i") @@ -88,24 +90,34 @@ TAO_Connection_Cache_Manager::find_i (const TAO_Cache_ExtId &key, // Get the index of the <key> int index = key.index (); + // Make a temporary object. It does not do a copy. + TAO_Cache_ExtId tmp_key (key.property ()); + while (retval == 0) { - // Make a temporary object. It does not do a copy. - TAO_Cache_ExtId tmp_key (key.property ()); - // Look for an entry in the map - retval = this->cache_map_.find (key, + retval = this->cache_map_.find (tmp_key, entry); // We have an entry in the map, check whether it is idle. If it // is idle it would be marked as busy. if (entry) { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("Point 1 <%d> \n"), + entry->int_id_.handler ()->test_index_)); + CORBA::Boolean idle = this->is_entry_idle (entry); if (idle) { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("Point 2 <%d> \n"), + entry->int_id_.handler ()->test_index_)); + // We have a succesful entry value = entry->int_id_; return 0; @@ -117,7 +129,7 @@ TAO_Connection_Cache_Manager::find_i (const TAO_Cache_ExtId &key, } // If we are here then it is an error - if (TAO_debug_level > 0 && retval != 0) + if (TAO_debug_level > 5 && retval != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::find_i") @@ -167,12 +179,17 @@ TAO_Connection_Cache_Manager::make_idle_i (HASH_MAP_ENTRY *&entry) new_entry); if (retval == 0) { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("We are getting idle <%d> \n"), + entry->int_id_.handler ()->test_index_)); + new_entry->int_id_. recycle_state (ACE_RECYCLABLE_IDLE_AND_PURGABLE); entry = new_entry; } - else if (TAO_debug_level > 0 && retval != 0) + else if (TAO_debug_level > 5 && retval != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::make_idle_i") @@ -193,12 +210,13 @@ TAO_Connection_Cache_Manager::mark_closed_i (HASH_MAP_ENTRY *&entry) new_entry); if (retval == 0) { + new_entry->int_id_. recycle_state (ACE_RECYCLABLE_CLOSED); entry = new_entry; } - else if (TAO_debug_level > 0 && retval != 0) + else if (TAO_debug_level > 5 && retval != 0) { ACE_ERROR ((LM_ERROR, ACE_TEXT ("(%P|%t) TAO_Connection_Cache_Manager::make_idle_i") @@ -266,6 +284,8 @@ TAO_Connection_Cache_Manager:: this->cache_map_.find (key); } + val.handler ()->test_index_ = ctr; + // Now do a bind again with the new index return this->cache_map_.bind (key, val, @@ -280,16 +300,21 @@ TAO_Connection_Cache_Manager:: if (entry->int_id_.recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || entry->int_id_.recycle_state () == ACE_RECYCLABLE_IDLE_BUT_NOT_PURGABLE) { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) ") + ACE_TEXT ("I got this Handler <%d> \n"), + entry->int_id_.handler ()->test_index_)); + // Save that in the handler entry->int_id_.handler ()->cache_map_entry (entry); // Mark the connection as busy entry->int_id_.recycle_state (ACE_RECYCLABLE_BUSY); - return 0; + return 1; } - return -1; + return 0; } #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) |