From e9f0ada57b958cd07bdbc41f4a3847875e3d71c8 Mon Sep 17 00:00:00 2001 From: bala Date: Mon, 23 Oct 2000 11:25:34 +0000 Subject: *** empty log message *** --- TAO/tao/Acceptor_Impl.cpp | 71 +-------------- TAO/tao/Base_Connection_Property.cpp | 6 +- TAO/tao/Base_Connection_Property.h | 20 +++++ TAO/tao/Base_Connection_Property.i | 13 ++- TAO/tao/Cache_Entries.h | 33 +++++-- TAO/tao/Cache_Entries.i | 78 +++++++++++++--- TAO/tao/Connection_Cache_Manager.cpp | 170 ++++++++++++++++++++++++++++------- TAO/tao/Connection_Cache_Manager.h | 69 +++++++++++--- TAO/tao/Connection_Cache_Manager.i | 105 +++++++++++++++++++++- TAO/tao/Connection_Handler.cpp | 3 +- TAO/tao/Connection_Handler.h | 37 ++++++++ TAO/tao/Connection_Handler.i | 35 +++++++- TAO/tao/Connector_Registry.cpp | 25 ++---- TAO/tao/Connector_Registry.h | 5 -- TAO/tao/Endpoint.h | 11 ++- TAO/tao/Endpoint.i | 7 +- TAO/tao/IIOP_Connector.cpp | 95 ++++++++++++-------- TAO/tao/IIOP_Connector.h | 5 +- TAO/tao/IIOP_Endpoint.cpp | 35 ++++++++ TAO/tao/IIOP_Endpoint.h | 20 +++-- TAO/tao/IIOP_Endpoint.i | 16 ---- TAO/tao/ORB_Core.cpp | 3 +- TAO/tao/ORB_Core.h | 8 +- TAO/tao/ORB_Core.i | 6 ++ TAO/tao/Pluggable.cpp | 38 +++++++- TAO/tao/Pluggable.h | 30 +++++-- TAO/tao/Pluggable.i | 12 +++ TAO/tao/SHMIOP_Connector.cpp | 6 +- TAO/tao/SHMIOP_Connector.h | 8 +- TAO/tao/SHMIOP_Endpoint.cpp | 35 ++++++++ TAO/tao/SHMIOP_Endpoint.h | 16 ++-- TAO/tao/SHMIOP_Endpoint.i | 16 ---- TAO/tao/TAO.dsp | 81 +++++++++++++++++ TAO/tao/TAO_Static.dsp | 48 ++++++++++ TAO/tao/UIOP_Connector.h | 10 +-- TAO/tao/UIOP_Endpoint.cpp | 29 ++++++ TAO/tao/UIOP_Endpoint.h | 17 ++-- TAO/tao/UIOP_Endpoint.i | 13 --- 38 files changed, 930 insertions(+), 305 deletions(-) diff --git a/TAO/tao/Acceptor_Impl.cpp b/TAO/tao/Acceptor_Impl.cpp index 9a1e6d773dd..13ad6f56780 100644 --- a/TAO/tao/Acceptor_Impl.cpp +++ b/TAO/tao/Acceptor_Impl.cpp @@ -116,81 +116,16 @@ TAO_Accept_Strategy::open (const ACE_PEER_ACCE int restart) { - int result = ACCEPT_STRATEGY_BASE::open (local_addr, - restart); - -#if !defined (TAO_USES_ROBUST_CONNECTION_MGMT) - - return result; - -#else /* ! TAO_USES_ROBUST_CONNECTION_MGMT */ - if (result == 0) - return result; - - // If the error occured due to the fact that the open handle limit - // was exhausted, then purge some "old" connections. - result = this->out_of_sockets_handler (); - if (result == -1) - return -1; - - // If we are able to purge, try again. - return ACCEPT_STRATEGY_BASE::open (local_addr, restart); -#endif /* !TAO_USES_ROBUST_CONNECTION_MGMT */ + return ACCEPT_STRATEGY_BASE::open (local_addr, + restart); } template int TAO_Accept_Strategy::accept_svc_handler (SVC_HANDLER *svc_handler) { - int result = ACCEPT_STRATEGY_BASE::accept_svc_handler (svc_handler); - -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) - if (result == 0) - return result; - - // If the error occured due to the fact that the open handle limit - // was exhausted, then purge some "old" connections. - this->out_of_sockets_handler (); -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - - return result; + return ACCEPT_STRATEGY_BASE::accept_svc_handler (svc_handler); } -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) -template int -TAO_Accept_Strategy::out_of_sockets_handler (void) -{ - if (ACE::out_of_handles (errno)) - { - // Close some cached connections by explicitly purging the - // connection cache maintained by the connectors in the - // connector registry. - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, - "Purging connections from Connectors in Connector Registry of all ORBs...\n")); - - ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, guard, - *ACE_Static_Object_Lock::instance (), 0)); - - TAO_ORB_Table *table = TAO_ORB_Table::instance (); - TAO_ORB_Table::Iterator end = table->end (); - for (TAO_ORB_Table::Iterator iterator = table->begin (); - iterator != end; - ++iterator) - { - TAO_ORB_Core *orb_core = (*iterator).int_id_; - - int result = orb_core->connector_registry ()->purge_connections (); - - if (result != 0) - return result; - } - - return 0; - } - - return -1; -} -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ ///////////////////////////////////////////////////////////////////// diff --git a/TAO/tao/Base_Connection_Property.cpp b/TAO/tao/Base_Connection_Property.cpp index 59a3417f3fb..0e2c9be4d2a 100644 --- a/TAO/tao/Base_Connection_Property.cpp +++ b/TAO/tao/Base_Connection_Property.cpp @@ -2,6 +2,7 @@ #include "tao/Base_Connection_Property.h" #include "tao/Endpoint.h" +#include "tao/IIOP_Endpoint.h" #if !defined (__ACE_INLINE__) # include "tao/Base_Connection_Property.i" @@ -18,9 +19,8 @@ TAO_Base_Connection_Property::duplicate (void) // Construct a copy of our class TAO_Base_Connection_Property *prop = 0; ACE_NEW_RETURN (prop, - TAO_Base_Connection_Property (endpoint, - 1); + TAO_Base_Connection_Property (endpt, + 1), 0); - return prop; } diff --git a/TAO/tao/Base_Connection_Property.h b/TAO/tao/Base_Connection_Property.h index 3334c5a5956..ecc1da8497d 100644 --- a/TAO/tao/Base_Connection_Property.h +++ b/TAO/tao/Base_Connection_Property.h @@ -18,6 +18,23 @@ #define TAO_BASE_CONNECTION_PROPERTY_H #include "ace/pre.h" +#include "tao/TAO_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined(_MSC_VER) +#if (_MSC_VER >= 1200) +#pragma warning(push) +#endif /* _MSC_VER >= 1200 */ +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +#include "tao/corbafwd.h" + +class TAO_Endpoint; + class TAO_Export TAO_Base_Connection_Property { // = TITLE @@ -57,6 +74,9 @@ public: // This call allocates and copies the contents of this class and // returns the pointer + TAO_Endpoint *endpoint (void); + // Return the underlying endpoint oject + void operator= (const TAO_Base_Connection_Property &rhs); // Assignment operator (does copy memory). diff --git a/TAO/tao/Base_Connection_Property.i b/TAO/tao/Base_Connection_Property.i index 10a1c8a7ebc..4256027d1ee 100644 --- a/TAO/tao/Base_Connection_Property.i +++ b/TAO/tao/Base_Connection_Property.i @@ -8,9 +8,9 @@ TAO_Base_Connection_Property::TAO_Base_Connection_Property (void) } ACE_INLINE -TAO_Base_Connection_Property::TAO_Base_Connection_Property ( - TAO_Endpoint *endpoint, - CORBA::Boolean flag) +TAO_Base_Connection_Property:: + TAO_Base_Connection_Property (TAO_Endpoint *endpoint, + CORBA::Boolean flag) : endpoint_ (endpoint), endpoint_flag_ (flag) { @@ -24,6 +24,13 @@ TAO_Base_Connection_Property::~TAO_Base_Connection_Property (void) } +ACE_INLINE TAO_Endpoint * +TAO_Base_Connection_Property::endpoint (void) +{ + return this->endpoint_; +} + + ACE_INLINE TAO_Base_Connection_Property::TAO_Base_Connection_Property ( const TAO_Base_Connection_Property &rhs) diff --git a/TAO/tao/Cache_Entries.h b/TAO/tao/Cache_Entries.h index 7d9f363850b..a018176b72b 100644 --- a/TAO/tao/Cache_Entries.h +++ b/TAO/tao/Cache_Entries.h @@ -31,6 +31,7 @@ #pragma warning(disable:4250) #endif /* _MSC_VER */ +class TAO_Connection_Handler; class TAO_Export TAO_Cache_IntId { @@ -50,25 +51,28 @@ public: TAO_Cache_IntId (void); // Constructor. - TAO_Cache_IntId (ACE_HANDLE &handle, - TAO_Connection_Handler *handler); + TAO_Cache_IntId (TAO_Connection_Handler *handler); // Constructor. - TAO_Cache_IntId (const TAO_IntId & rhs); + TAO_Cache_IntId (const TAO_Cache_IntId & rhs); // Copy constructor. ~TAO_Cache_IntId (void); // Destructor. -private: - ACE_HANDLE handle_; - // in the cache + TAO_Connection_Handler *handler (void); + // Return the underlying handler + + const TAO_Connection_Handler *handler (void) const; + // Return the underlying handler + //Do we need a = operator? Lert me decide?? +private: TAO_Connection_Handler *handler_; // The connection handler that needs to be cached. // @@ Need to add properties that need to be associated with this - // connection + // connection when I get to purging.... }; @@ -111,8 +115,16 @@ public: // function is required in order for this class to be usable by // ACE_Hash_Map_Manager. + void duplicate (void); + // Make a deep copy of the underlying pointer + + CORBA::ULong index (void); + // Return the index value + + void index (CORBA::ULong index); + // Set the index value + // = Accessors - // @@ Need to add private: // = Data members. @@ -120,6 +132,11 @@ private: TAO_Base_Connection_Property *connection_property_; // A property object that we represent. + CORBA::Boolean is_delete_; + // Do we need to delete connection_propert_? + + CORBA::ULong index_; + // This is a supplementary index }; diff --git a/TAO/tao/Cache_Entries.i b/TAO/tao/Cache_Entries.i index 877d82b8233..2e604801211 100644 --- a/TAO/tao/Cache_Entries.i +++ b/TAO/tao/Cache_Entries.i @@ -3,23 +3,20 @@ ACE_INLINE TAO_Cache_IntId::TAO_Cache_IntId (void) - :handle_ (), - handler_ (0) + : handler_ (0) { } ACE_INLINE -TAO_Cache_IntId::TAO_Cache_IntId (ACE_HANDLE &handle, - TAO_Connection_Handler *handler) - :handle_ (handle), - handler_ (handler) +TAO_Cache_IntId::TAO_Cache_IntId (TAO_Connection_Handler *handler) + : handler_ (handler) { } ACE_INLINE TAO_Cache_IntId::TAO_Cache_IntId (const TAO_Cache_IntId &rhs) { - this->handle_ = rhs.handle_; + this->handler_ = rhs.handler_; } ACE_INLINE @@ -27,6 +24,18 @@ TAO_Cache_IntId::~TAO_Cache_IntId (void) { } +ACE_INLINE TAO_Connection_Handler * +TAO_Cache_IntId::handler (void) +{ + return this->handler_; +} + +ACE_INLINE const TAO_Connection_Handler * +TAO_Cache_IntId::handler (void) const +{ + return this->handler_; +} + /*******************************************************/ ACE_INLINE TAO_Cache_ExtId::TAO_Cache_ExtId (void) @@ -36,7 +45,9 @@ TAO_Cache_ExtId::TAO_Cache_ExtId (void) ACE_INLINE TAO_Cache_ExtId::TAO_Cache_ExtId (TAO_Base_Connection_Property *prop) - : connection_property_ (prop->duplicate ()) + : connection_property_ (prop), + is_delete_ (0), + index_ (0) { } @@ -47,27 +58,68 @@ TAO_Cache_ExtId::~TAO_Cache_ExtId (void) delete this->connection_property_; } +ACE_INLINE +TAO_Cache_ExtId::TAO_Cache_ExtId (const TAO_Cache_ExtId &rhs) +{ + *this->connection_property_ = *rhs.connection_property_; + this->is_delete_ = rhs.is_delete_; + this->index_ = rhs.index_; +} ACE_INLINE void TAO_Cache_ExtId::operator= (const TAO_Cache_ExtId &rhs) { *this->connection_property_ = *rhs.connection_property_; + this->is_delete_ = rhs.is_delete_; + this->index_ = rhs.index_; } ACE_INLINE int -TAO_Cache_ExtId::operator== (const TAO_Cache_ExtId &rhs) +TAO_Cache_ExtId::operator== (const TAO_Cache_ExtId &rhs) const { - return *this->connection_property_ == *rhs.connection_property_; + return (*this->connection_property_ == *rhs.connection_property_ && + this->index_ == rhs.index_); } ACE_INLINE int -TAO_Cache_ExtId::operator!= (const TAO_Cache_ExtId &rhs) +TAO_Cache_ExtId::operator!= (const TAO_Cache_ExtId &rhs) const { - return *this->connection_property_ != *rhs.connection_property_; + return (*this->connection_property_ != *rhs.connection_property_ || + this->index_ != rhs.index_); } ACE_INLINE u_long TAO_Cache_ExtId::hash (void) const { - return this->connection_property_; + return (this->connection_property_->hash () + this->index_); +} + +ACE_INLINE void +TAO_Cache_ExtId::duplicate (void) +{ + TAO_Base_Connection_Property *prop = 0; + + // Make a deep copy + prop = this->connection_property_->duplicate (); + + + // Release memory if there was some allocated in the first place + if (this->is_delete_) + delete this->connection_property_; + + this->is_delete_ = 1; + this->connection_property_ = prop; +} + + +ACE_INLINE CORBA::ULong +TAO_Cache_ExtId::index (void) +{ + return this->index_; +} + +ACE_INLINE void +TAO_Cache_ExtId::index (CORBA::ULong index) +{ + this->index_ = index; } diff --git a/TAO/tao/Connection_Cache_Manager.cpp b/TAO/tao/Connection_Cache_Manager.cpp index 41d0914d891..cbb7f586c28 100644 --- a/TAO/tao/Connection_Cache_Manager.cpp +++ b/TAO/tao/Connection_Cache_Manager.cpp @@ -1,4 +1,5 @@ #include "tao/Connection_Cache_Manager.h" +#include "tao/Connection_Handler.h" @@ -10,78 +11,187 @@ ACE_RCSID(tao, Connection_Cache_Hash_Manager, "$Id$") -TAO_Connection_Cache_Manager::~TAO_Connection_Cache_Hash_Manager (void) +TAO_Connection_Cache_Manager:: + TAO_Connection_Cache_Manager (void) + : cache_map_ () { - // Close the HASH MAP and release resources - HASH_MAP.close (); + ACE_NEW (this->cache_lock_, + ACE_Lock_Adapter); } +TAO_Connection_Cache_Manager::~TAO_Connection_Cache_Manager (void) +{ + delete this->cache_lock_; + + // Close the HASH MAP and release resources + this->cache_map_.close (); +} int -TAO_Connection_Cache_Manager::bind (const TAO_Cache_ExtId &ext_id, - const TAO_Cache_IntId &int_id) +TAO_Connection_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id, + TAO_Cache_IntId &int_id) { - return HASH_MAP.bind (ext_id, - int_id); + // First call duplicate on the ext_id ie. make a copy of the + // contents + ext_id.duplicate (); + + // Get the entry too + HASH_MAP_ENTRY *entry = 0; + int retval = this->cache_map_.bind (ext_id, + int_id, + entry); + if (retval == 0) + { + // 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) + { + // There was an entry like this before, so let us do some + // minor adjustments + retval = get_last_index_bind (ext_id, + int_id, + entry); + int_id.handler ()->cache_map_entry (entry); + } + + return retval; } int -TAO_Connection_Cache_Manager::find (const TAO_Cache_ExtId &key, - TAO_Cache_IntId &value) +TAO_Connection_Cache_Manager::find_i (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value) { - return HASH_MAP.find (key, - value); + HASH_MAP_ENTRY *entry = 0; + // Get the entry from the Hash Map + int retval = this->cache_map_.find (key, + entry); + if (retval == 0) + { + retval = this->get_idle_handler (key, + entry); + + if (entry) + value = entry->int_id_; + } + + return retval; } int -TAO_Connection_Cache_Manager::rebind (const TAO_Cache_ExtId &key, +TAO_Connection_Cache_Manager::rebind_i (const TAO_Cache_ExtId &key, const TAO_Cache_IntId &value) { - return HASH_MAP.rebind (key, + return this->cache_map_.rebind (key, value); } int -TAO_Connection_Cache_Manager::trybind (const TAO_Cache_ExtId &key, - TAO_Cache_IntId &value) +TAO_Connection_Cache_Manager::trybind_i (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value) { - return HASH_MAP.trybind (key, value); + return this->cache_map_.trybind (key, value); } int -TAO_Connection_Cache_Manager::unbind (const TAO_Cache_ExtId &key) +TAO_Connection_Cache_Manager::unbind_i (const TAO_Cache_ExtId &key) { - return HASH_MAP.unbind (key); + return this->cache_map_.unbind (key); } int -TAO_Connection_Cache_Manager::unbind (const TAO_Cache_ExtId &key, - TAO_Cache_IntId &value) +TAO_Connection_Cache_Manager::unbind_i (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value) { - return HASH_MAP.unbind (key, + return this->cache_map_.unbind (key, value); } - int -TAO_Connection_Cache_Manager::purge (void) +TAO_Connection_Cache_Manager::make_idle_i (HASH_MAP_ENTRY *&entry) { + // First get the entry again (if at all things had changed in the + // cache map in the mean time) + HASH_MAP_ENTRY *new_entry = 0; + int retval = this->cache_map_.find (entry->ext_id_, + new_entry); + if (retval == 0) + { + new_entry->int_id_.handler ()-> + recycle_state (ACE_RECYCLABLE_IDLE_AND_PURGABLE); + + entry = new_entry; + } + + return retval; } -size_t -TAO_Connection_Cache_Manager::current_size (void) const +int +TAO_Connection_Cache_Manager:: + get_last_index_bind (TAO_Cache_ExtId &key, + TAO_Cache_IntId &val, + HASH_MAP_ENTRY *&entry) { - return HASH_MAP.current_size (); + CORBA::ULong ctr = entry->ext_id_.index (); + + // Start looking at the succesive elements + while (entry->next_->ext_id_.index () != 0) + { + ctr++; + + // Change the entry + entry = entry->next_; + } + + // Set the index + key.index (ctr + 1); + + // Now do a bind again with the new index + return this->cache_map_.bind (key, + val, + entry); } -size_t -TAO_Connection_Cache_Manager::total_size (void) const + +int +TAO_Connection_Cache_Manager:: + get_idle_handler (const TAO_Cache_ExtId &ext_id, + HASH_MAP_ENTRY *&entry) { - return HASH_MAP.total_size (); + // We are sure that we have an entry + do + { + // Found the entry, so check whether it is busy + if (entry->int_id_.handler ()->recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE || + entry->int_id_.handler ()->recycle_state () == ACE_RECYCLABLE_IDLE_AND_PURGABLE) + { + // Save that in the handler + entry->int_id_.handler ()->cache_map_entry (entry); + + // Mark the connection as busy + entry->int_id_.handler ()->recycle_state (ACE_RECYCLABLE_BUSY); + + return 0; + } + else + { + entry = entry->next_; + } + } + // This would prevent us from moving to the next ext_id.. + while (entry->next_->ext_id_.index () != 0); + + // @@ There is a subtle assumption that I have made, ie. the + // elements with higher indexes of ext_id will be placed + // continously. That could be *bad* + + // We havent got a connection, so set the pointer to null. + entry = 0; + return -1; } - #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) // Instantiations for the Hash Map diff --git a/TAO/tao/Connection_Cache_Manager.h b/TAO/tao/Connection_Cache_Manager.h index d7eaf7e32c6..517dcfd2dbe 100644 --- a/TAO/tao/Connection_Cache_Manager.h +++ b/TAO/tao/Connection_Cache_Manager.h @@ -18,14 +18,22 @@ #define TAO_CONNECTION_CACHE_MANAGER_H #include "ace/pre.h" -#include "tao/Hash_Map_Manager_T.h" - - +#include "ace/Hash_Map_Manager_T.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) #define ACE_LACKS_PRAGMA_ONCE #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/TAO_Export.h" +#include "tao/Cache_Entries.h" + +#if defined(_MSC_VER) +#if (_MSC_VER >= 1200) +#pragma warning(push) +#endif /* _MSC_VER >= 1200 */ +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + class TAO_Cache_ExtId; class TAO_Cache_IntId; @@ -49,20 +57,15 @@ public: ACE_Null_Mutex> HASH_MAP_ITER; - typedef ACE_Hash_Map_Reverse_Iterator - HASH_MAP_REV_ITER; + typedef ACE_Hash_Map_Entry + HASH_MAP_ENTRY; // == Public methods TAO_Connection_Cache_Manager (void); // Constructor - TAO_Connection_Cache_Manager ( - ACE_Caching_Strategy *strat); - // Constructor - virtual ~TAO_Connection_Cache_Manager (void); // Destructor @@ -70,8 +73,8 @@ public: ACE_Allocator *alloc = 0); // Initialize a with elements. - int bind (const TAO_Cache_ExtId &ext_id, - const TAO_Cache_IntId &int_id); + int bind (TAO_Cache_ExtId &ext_id, + TAO_Cache_IntId &int_id); // Associate with . If is already in the // map then the is not changed. Returns 0 if a new // entry is bound successfully, returns 1 if an attempt is made to @@ -111,22 +114,60 @@ public: int purge (void); // Remove entries from the cache depending upon the strategy. + int make_idle (HASH_MAP_ENTRY *&entry); + // Make the entry idle and ready for use. + size_t current_size (void) const; // Return the current size of the cache. size_t total_size (void) const; // Return the total size of the cache. -protected: +private: + int bind_i (TAO_Cache_ExtId &ext_id, + TAO_Cache_IntId &int_id); + // Non-Locking version of bind () call + + int find_i (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value); + // Non-locking version of find () call + + int rebind_i (const TAO_Cache_ExtId &key, + const TAO_Cache_IntId &value); + // Non-locking version of rebind () call + + int trybind_i (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value); + // Non-locking version of trybind () call + int unbind_i (const TAO_Cache_ExtId &key); + // Non-locking version of unbind () call + int unbind_i (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value); + // Non-locking version of unbind () call + int make_idle_i (HASH_MAP_ENTRY *&entry); + // Non-locking version of make_idle () + int get_last_index_bind (TAO_Cache_ExtId &key, + TAO_Cache_IntId &val, + HASH_MAP_ENTRY *&entry); + // Get the last index in the particular ext_id and try to bind that + // to the Cache map. + int get_idle_handler (const TAO_Cache_ExtId &ext_id, + HASH_MAP_ENTRY *&entry); + // Get an idle handler if one is available in Cache +private: + HASH_MAP cache_map_; + // The hash map that has the connections + ACE_Lock *cache_lock_; + // Lock for the map }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Connection_Cache_Manager.i b/TAO/tao/Connection_Cache_Manager.i index a61996859b0..285b5d335ef 100644 --- a/TAO/tao/Connection_Cache_Manager.i +++ b/TAO/tao/Connection_Cache_Manager.i @@ -1,10 +1,107 @@ /* -*- C++ -*- */ //$Id$ +ACE_INLINE int +TAO_Connection_Cache_Manager::bind (TAO_Cache_ExtId &ext_id, + TAO_Cache_IntId &int_id) +{ + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, + guard, + *this->cache_lock_, + -1)); + + return this->bind_i (ext_id, + int_id); +} + + +ACE_INLINE int +TAO_Connection_Cache_Manager::find (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value) +{ + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, + guard, + *this->cache_lock_, + -1)); + + return this->find_i (key, + value); +} + +ACE_INLINE int +TAO_Connection_Cache_Manager::rebind (const TAO_Cache_ExtId &key, + const TAO_Cache_IntId &value) +{ + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, + guard, + *this->cache_lock_, + -1)); + + return this->rebind_i (key, + value); +} + +ACE_INLINE int +TAO_Connection_Cache_Manager::trybind (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value) +{ + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, + guard, + *this->cache_lock_, + -1)); + + return this->trybind_i (key, value); +} + +ACE_INLINE int +TAO_Connection_Cache_Manager::unbind (const TAO_Cache_ExtId &key) +{ + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, + guard, + *this->cache_lock_, + -1)); + + return this->unbind_i (key); +} + +ACE_INLINE int +TAO_Connection_Cache_Manager::unbind (const TAO_Cache_ExtId &key, + TAO_Cache_IntId &value) +{ + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, + guard, + *this->cache_lock_, + -1)); + + return this->unbind_i (key, + value); +} + + +ACE_INLINE int +TAO_Connection_Cache_Manager::purge (void) +{ + return 0; +} + +ACE_INLINE size_t +TAO_Connection_Cache_Manager::current_size (void) const +{ + return this->cache_map_.current_size (); +} + +ACE_INLINE size_t +TAO_Connection_Cache_Manager::total_size (void) const +{ + return this->cache_map_.total_size (); +} -ACE_INLINE -TAO_Connection_Cache_Hash_Manager:: - TAO_Connection_Cache_Hash_Manager (void) - : TAO_Connection_Cache_Manager () +ACE_INLINE int +TAO_Connection_Cache_Manager::make_idle (HASH_MAP_ENTRY *&entry) { + ACE_MT (ACE_GUARD_RETURN (ACE_Lock, + guard, + *this->cache_lock_, + -1)); + return this->make_idle_i (entry); } diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index ce52fdb6da6..8935aed4ab3 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -14,7 +14,8 @@ ACE_RCSID(tao, Connection_Handler, "$Id$") TAO_Connection_Handler::TAO_Connection_Handler (TAO_ORB_Core *orb_core) :orb_core_ (orb_core), - tss_resources_ (orb_core->get_tss_resources ()) + tss_resources_ (orb_core->get_tss_resources ()), + cache_map_entry_ (0) { } diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h index 78d452a0e5e..f3c9b0aba9e 100644 --- a/TAO/tao/Connection_Handler.h +++ b/TAO/tao/Connection_Handler.h @@ -24,6 +24,8 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/Connection_Cache_Manager.h" + #if defined(_MSC_VER) #if (_MSC_VER >= 1200) #pragma warning(push) @@ -70,6 +72,34 @@ public: virtual ~TAO_Connection_Handler (void); // Destructor + int cache (void); + // Add to cache. + + void recycle_state (ACE_Recyclable_State new_state); + + ACE_Recyclable_State recycle_state (void); + // Get/Set . + + void cache_map_entry ( + TAO_Connection_Cache_Manager::HASH_MAP_ENTRY *entry); + + TAO_Connection_Cache_Manager::HASH_MAP_ENTRY *cache_map_entry (void); + // Ste/Get the Cache Map entry + + + // virtual int mark_as_closed (const void *recycling_act); + // Mark as closed. + + //virtual int mark_as_closed_i (const void *recycling_act); + // Mark as closed.(non-locking version) + + //virtual int cleanup_hint (const void *recycling_act, + // void **act_holder = 0) = 0; + // Cleanup hint and reset <*act_holder> to zero if . + + int make_idle (void); + // Make ourselves ready for use + protected: void remove_handle (ACE_HANDLE handle); @@ -107,11 +137,18 @@ protected: // Service_Handler. private: + TAO_ORB_Core *orb_core_; // Pointer to the TAO_ORB_Core TAO_ORB_Core_TSS_Resources *tss_resources_; // Cached tss resources of the ORB that activated this object. + + TAO_Connection_Cache_Manager::HASH_MAP_ENTRY *cache_map_entry_; + // The cache map entry -- where we are in the Connection Cache + + ACE_Recyclable_State recycle_state_; + // The state of the handle }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Connection_Handler.i b/TAO/tao/Connection_Handler.i index 7c3cf4ab5df..1a79e07a6e0 100644 --- a/TAO/tao/Connection_Handler.i +++ b/TAO/tao/Connection_Handler.i @@ -4,10 +4,37 @@ ACE_INLINE TAO_Connection_Handler::TAO_Connection_Handler (void) : orb_core_ (0), - tss_resources_ (0) + tss_resources_ (0), + recycle_state_ (ACE_RECYCLABLE_UNKNOWN) { } +ACE_INLINE void +TAO_Connection_Handler::recycle_state (ACE_Recyclable_State new_state) +{ + this->recycle_state_ = new_state; +} + +ACE_INLINE ACE_Recyclable_State +TAO_Connection_Handler::recycle_state (void) +{ + return this->recycle_state_; +} + +ACE_INLINE TAO_Connection_Cache_Manager::HASH_MAP_ENTRY * +TAO_Connection_Handler::cache_map_entry (void) +{ + return this->cache_map_entry_; +} + +ACE_INLINE void +TAO_Connection_Handler::cache_map_entry ( + TAO_Connection_Cache_Manager::HASH_MAP_ENTRY *entry) +{ + this->cache_map_entry_ = entry; +} + + ACE_INLINE TAO_ORB_Core * TAO_Connection_Handler::orb_core (void) { @@ -19,3 +46,9 @@ TAO_Connection_Handler::tss_resources (void) { return this->tss_resources_; } + +ACE_INLINE int +TAO_Connection_Handler::make_idle (void) +{ + return this->orb_core_->connection_cache ().make_idle (this->cache_map_entry_); +} diff --git a/TAO/tao/Connector_Registry.cpp b/TAO/tao/Connector_Registry.cpp index 0f858c40841..8c08e2c945d 100644 --- a/TAO/tao/Connector_Registry.cpp +++ b/TAO/tao/Connector_Registry.cpp @@ -7,6 +7,7 @@ #include "tao/Endpoint.h" #include "tao/Environment.h" #include "tao/debug.h" +#include "tao/Base_Connection_Property.h" #if !defined(__ACE_INLINE__) #include "tao/Connector_Registry.i" @@ -278,7 +279,10 @@ TAO_Connector_Registry::connect (TAO_Endpoint *endpoint, if (connector == 0) return -1; - return connector->connect (endpoint, + // Compose the Base connection property object + TAO_Base_Connection_Property conn_property (endpoint); + + return connector->connect (&conn_property, transport, max_wait_time, ACE_TRY_ENV); @@ -420,25 +424,6 @@ TAO_Connector_Registry::object_key_delimiter (const char *ior) return 0; } -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) -int -TAO_Connector_Registry::purge_connections (void) -{ - TAO_ConnectorSetIterator end = this->end (); - TAO_ConnectorSetIterator iterator = this->begin (); - - for (; - iterator != end ; - iterator++) - { - if ((*iterator)->purge_connections () == -1) - return -1; - } - - return 0; -} -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) diff --git a/TAO/tao/Connector_Registry.h b/TAO/tao/Connector_Registry.h index 068a484b019..d64aee47d64 100644 --- a/TAO/tao/Connector_Registry.h +++ b/TAO/tao/Connector_Registry.h @@ -97,11 +97,6 @@ public: // Obtain the object key delimiter used by the protocol specified in // the provided URL style IOR. -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) - int purge_connections (void); - // Purge "old" connections. -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - // = Iterator. TAO_ConnectorSetIterator begin (void); TAO_ConnectorSetIterator end (void); diff --git a/TAO/tao/Endpoint.h b/TAO/tao/Endpoint.h index c6c575cf4fb..6a0eb12a54c 100644 --- a/TAO/tao/Endpoint.h +++ b/TAO/tao/Endpoint.h @@ -43,7 +43,8 @@ class TAO_Export TAO_Endpoint // one or more ways to contact server(s). // public: - TAO_Endpoint (CORBA::ULong tag); + TAO_Endpoint (CORBA::ULong tag, + CORBA::Short priority = 0); // Constructor. virtual ~TAO_Endpoint (void); @@ -60,6 +61,10 @@ public: // = Abstract methods to be implemented by concrete subclasses. + virtual CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint) = 0; + // Return true if this endpoint is equivalent to . Two + // endpoints are equivalent iff their port and host are the same. + virtual TAO_Endpoint *next (void) = 0; // Endpoints can be stringed in a list. Return the next endpoint in // the list, if any. @@ -75,10 +80,12 @@ public: // This method is used when a connection has been reset, requiring // the hint to be cleaned up and reset to NULL. - //virtual TAO_Endpoint *duplicate (void) = 0; + virtual TAO_Endpoint *duplicate (void) = 0; // This method returns a copy of the corresponding endpoints by // allocation memory + virtual CORBA::ULong hash (void) = 0; + // Return a hash value for this object. private: // Endpoints should not be copied. diff --git a/TAO/tao/Endpoint.i b/TAO/tao/Endpoint.i index e21f3a31bbd..0b3804ce93f 100644 --- a/TAO/tao/Endpoint.i +++ b/TAO/tao/Endpoint.i @@ -2,9 +2,10 @@ // $Id$ ACE_INLINE -TAO_Endpoint::TAO_Endpoint (CORBA::ULong tag) +TAO_Endpoint::TAO_Endpoint (CORBA::ULong tag, + CORBA::Short priority) : tag_ (tag), - priority_ (0) + priority_ (priority) { } @@ -21,7 +22,7 @@ TAO_Endpoint::priority (void) const } ACE_INLINE void -TAO_Endpoint::priority (CORBA::Short p) +TAO_Endpoint::priority (CORBA::Short p) { this->priority_ = p; } diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 95439cb073c..161e2cd33bf 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -9,6 +9,7 @@ #include "tao/Environment.h" #include "ace/Auto_Ptr.h" #include "tao/RT_Policy_i.h" +#include "tao/Base_Connection_Property.h" ACE_RCSID(tao, IIOP_Connector, "$Id$") @@ -44,8 +45,6 @@ TAO_IIOP_Connect_Creation_Strategy::make_svc_handler TAO_IIOP_Connector::TAO_IIOP_Connector (CORBA::Boolean flag) : TAO_Connector (TAO_TAG_IIOP_PROFILE), - - orb_core_ (0), base_connector_ (), lite_flag_ (flag) { @@ -54,7 +53,7 @@ TAO_IIOP_Connector::TAO_IIOP_Connector (CORBA::Boolean flag) int TAO_IIOP_Connector::open (TAO_ORB_Core *orb_core) { - this->orb_core_ = orb_core; + this->orb_core (orb_core); if (this->init_tcp_properties () != 0) return -1; @@ -63,13 +62,13 @@ TAO_IIOP_Connector::open (TAO_ORB_Core *orb_core) ACE_NEW_RETURN (connect_creation_strategy, TAO_IIOP_Connect_Creation_Strategy - (this->orb_core_->thr_mgr (), - this->orb_core_, + (this->orb_core ()->thr_mgr (), + this->orb_core (), &(this->tcp_properties_), this->lite_flag_), -1); - return this->base_connector_.open (this->orb_core_->reactor (), + return this->base_connector_.open (this->orb_core ()->reactor (), connect_creation_strategy, &this->connect_strategy_, &this->null_activation_strategy_); @@ -80,13 +79,13 @@ TAO_IIOP_Connector::close (void) { this->base_connector_.close (); - delete this->cached_connect_strategy_->creation_strategy (); + delete this->base_connector_.creation_strategy (); return 0; } int -TAO_IIOP_Connector::connect (TAO_Endpoint *endpoint, +TAO_IIOP_Connector::connect (TAO_Base_Connection_Property *prop, TAO_Transport *&transport, ACE_Time_Value *max_wait_time, CORBA::Environment &) @@ -96,12 +95,14 @@ TAO_IIOP_Connector::connect (TAO_Endpoint *endpoint, ACE_TEXT ("TAO (%P|%t) Connector::connect - ") ACE_TEXT ("looking for IIOP connection.\n"))); - if (endpoint->tag () != TAO_TAG_IIOP_PROFILE) + if (prop->endpoint ()->tag () != TAO_TAG_IIOP_PROFILE) return -1; + const TAO_Endpoint *endpoint = prop->endpoint (); + TAO_IIOP_Endpoint *iiop_endpoint = ACE_dynamic_cast (TAO_IIOP_Endpoint *, - endpoint); + endpoint ); if (iiop_endpoint == 0) return -1; @@ -125,34 +126,48 @@ TAO_IIOP_Connector::connect (TAO_Endpoint *endpoint, return -1; } - TAO_IIOP_Client_Connection_Handler *svc_handler = 0; int result = 0; + TAO_IIOP_Client_Connection_Handler *svc_handler = 0; + TAO_Connection_Handler *conn_handler = 0; - // At this point look in to the MAP - - if (max_wait_time != 0) + // Check the Cache first for connections + if (this->find_handler (prop, conn_handler) == 0) { - ACE_Synch_Options synch_options (ACE_Synch_Options::USE_TIMEOUT, - *max_wait_time); - - // The connect call will set the hint () stored in the Endpoint - // object; but we obtain the transport in the - // variable. Other threads may modify the hint, but we are not - // affected. - result = this->base_connector_.connect (iiop_endpoint->hint (), - svc_handler, - remote_address, - synch_options); + // We have found a connection and a handler + svc_handler = + ACE_dynamic_cast (TAO_IIOP_Client_Connection_Handler *, + conn_handler); + } else { - // The connect call will set the hint () stored in the Endpoint - // object; but we obtain the transport in the - // variable. Other threads may modify the hint, but we are not - // affected. - result = this->base_connector_.connect (iiop_endpoint->hint (), - svc_handler, - remote_address); + // @@ This needs to change in the next round when we implement a + // policy that will not allow new connections when a connection + // is busy. + if (max_wait_time != 0) + { + ACE_Synch_Options synch_options (ACE_Synch_Options::USE_TIMEOUT, + *max_wait_time); + + // We obtain the transport in the variable. As + // we know now that the connection is not available in Cache + // we can make a new connection + result = this->base_connector_.connect (svc_handler, + remote_address, + synch_options); + } + else + { + // We obtain the transport in the variable. As + // we know now that the connection is not available in Cache + // we can make a new connection + result = this->base_connector_.connect (svc_handler, + remote_address); + } + + // Add the handler to Cache + int retval = this->add_handler (prop, + svc_handler); } if (result == -1) @@ -171,6 +186,8 @@ TAO_IIOP_Connector::connect (TAO_Endpoint *endpoint, } return -1; } + // Make the handler ready for use + svc_handler->make_idle (); transport = svc_handler->transport (); return 0; @@ -333,7 +350,7 @@ TAO_IIOP_Connector::create_profile (TAO_InputCDR& cdr) { TAO_Profile *pfile; ACE_NEW_RETURN (pfile, - TAO_IIOP_Profile (this->orb_core_), + TAO_IIOP_Profile (this->orb_core ()), 0); int r = pfile->decode (cdr); @@ -358,7 +375,7 @@ TAO_IIOP_Connector::make_profile (const char *endpoint, ACE_NEW_THROW_EX (profile, TAO_IIOP_Profile (endpoint, - this->orb_core_, + this->orb_core (), ACE_TRY_ENV), CORBA::NO_MEMORY ()); @@ -418,7 +435,7 @@ TAO_IIOP_Connector::init_tcp_properties (void) // Check ORB-level override for tcp properties. TAO_ClientProtocolPolicy *client_protocols = - this->orb_core_->policy_manager ()->client_protocol (); + this->orb_core ()->policy_manager ()->client_protocol (); CORBA::Object_var auto_release = client_protocols; RTCORBA::TCPProtocolProperties_var tcp_properties = RTCORBA::TCPProtocolProperties::_nil (); @@ -444,7 +461,7 @@ TAO_IIOP_Connector::init_tcp_properties (void) // No tcp properties in ORB-level override. Use ORB defaults. // Orb defaults should never be null - they were initialized by // the ORB_Core. - client_protocols = this->orb_core_->default_client_protocol (); + client_protocols = this->orb_core ()->default_client_protocol (); auto_release = client_protocols; RTCORBA::ProtocolList & protocols = client_protocols->protocols_rep (); for (CORBA::ULong j = 0; j < protocols.length (); ++j) @@ -472,11 +489,11 @@ TAO_IIOP_Connector::init_tcp_properties (void) // Without RTCORBA, protocol configuration properties come from ORB // options. this->tcp_properties_.send_buffer_size = - this->orb_core_->orb_params ()->sock_sndbuf_size (); + this->orb_core ()->orb_params ()->sock_sndbuf_size (); this->tcp_properties_.recv_buffer_size = - this->orb_core_->orb_params ()->sock_rcvbuf_size (); + this->orb_core ()->orb_params ()->sock_rcvbuf_size (); this->tcp_properties_.no_delay = - this->orb_core_->orb_params ()->nodelay (); + this->orb_core ()->orb_params ()->nodelay (); #endif /* TAO_HAS_RT_CORBA == 1 */ diff --git a/TAO/tao/IIOP_Connector.h b/TAO/tao/IIOP_Connector.h index 6103a9b7911..dbfa012a481 100644 --- a/TAO/tao/IIOP_Connector.h +++ b/TAO/tao/IIOP_Connector.h @@ -91,7 +91,7 @@ public: // Pluggable.h int open (TAO_ORB_Core *orb_core); int close (void); - int connect (TAO_Endpoint *endpoint, + int connect (TAO_Base_Connection_Property *prop, TAO_Transport *&transport, ACE_Time_Value *max_wait_time, CORBA::Environment &ACE_TRY_ENV); @@ -129,9 +129,6 @@ public: TAO_IIOP_BASE_CONNECTOR; protected: - TAO_ORB_Core *orb_core_; - // ORB Core. - TAO_IIOP_Handler_Base::TCP_Properties tcp_properties_; // TCP configuration properties to be used for all // connections established by this connector. diff --git a/TAO/tao/IIOP_Endpoint.cpp b/TAO/tao/IIOP_Endpoint.cpp index dda6ec5f4ae..21f892575fa 100644 --- a/TAO/tao/IIOP_Endpoint.cpp +++ b/TAO/tao/IIOP_Endpoint.cpp @@ -138,3 +138,38 @@ TAO_IIOP_Endpoint::next (void) { return this->next_; } + +TAO_Endpoint * +TAO_IIOP_Endpoint::duplicate (void) +{ + TAO_IIOP_Endpoint *endpoint = 0; + + ACE_NEW_RETURN (endpoint, + TAO_IIOP_Endpoint (this->host_, + this->port_, + this->object_addr_), + 0); + + return endpoint; +} + +CORBA::Boolean +TAO_IIOP_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint) +{ + TAO_IIOP_Endpoint *endpoint = ACE_dynamic_cast (TAO_IIOP_Endpoint *, + other_endpoint); + if (endpoint == 0) + return 0; + + return + this->port_ == endpoint->port_ + && ACE_OS::strcmp (this->host_.in (), endpoint->host_.in ()) == 0; +} + +CORBA::ULong +TAO_IIOP_Endpoint::hash (void) +{ + return + ACE::hash_pjw (this->host_.in ()) + + this->port_; +} diff --git a/TAO/tao/IIOP_Endpoint.h b/TAO/tao/IIOP_Endpoint.h index 014948a2542..8cb5ee5b7f2 100644 --- a/TAO/tao/IIOP_Endpoint.h +++ b/TAO/tao/IIOP_Endpoint.h @@ -78,6 +78,18 @@ public: virtual int addr_to_string (char *buffer, size_t length); virtual void reset_hint (void); + virtual TAO_Endpoint *duplicate (void); + // Makes a copy of + + CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint); + // Return true if this endpoint is equivalent to . Two + // endpoints are equivalent iff their port and host are the same. + + CORBA::ULong hash (void); + // Return a hash value for this object. + + // Allocates memory and returns a copy of + // = IIOP_Endpoint-specific methods. const ACE_INET_Addr &object_addr (void) const; @@ -100,14 +112,8 @@ public: TAO_IIOP_Client_Connection_Handler *&hint (void); // Access to our . - CORBA::Boolean is_equivalent (const TAO_IIOP_Endpoint *other_endpoint); - // Return true if this endpoint is equivalent to . Two - // endpoints are equivalent iff their port and host are the same. - - CORBA::ULong hash (void); - // Return a hash value for this object. - private: + int set (const ACE_INET_Addr &addr, int use_dotted_decimal_addresses); // Helper method for setting INET_Addr. diff --git a/TAO/tao/IIOP_Endpoint.i b/TAO/tao/IIOP_Endpoint.i index cc98532d3d3..6ea6339ff6e 100644 --- a/TAO/tao/IIOP_Endpoint.i +++ b/TAO/tao/IIOP_Endpoint.i @@ -56,19 +56,3 @@ TAO_IIOP_Endpoint::hint (void) { return this->hint_; } - -ACE_INLINE CORBA::ULong -TAO_IIOP_Endpoint::hash (void) -{ - return - ACE::hash_pjw (this->host_.in ()) - + this->port_; -} - -ACE_INLINE CORBA::Boolean -TAO_IIOP_Endpoint::is_equivalent (const TAO_IIOP_Endpoint *other_endpoint) -{ - return - this->port_ == other_endpoint->port_ - && ACE_OS::strcmp (this->host_.in (), other_endpoint->host_.in ()) == 0; -} diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index cfbf6ed5273..94c62ee3d5f 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -139,7 +139,8 @@ TAO_ORB_Core::TAO_ORB_Core (const char *orbid) svc_config_argc_ (0), svc_config_argv_ (0), refcount_ (1), - handle_set_ () + handle_set_ (), + connection_cache_ () { #if defined(ACE_MVS) ACE_NEW (this->from_iso8859_, ACE_IBM1047_ISO8859); diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index 96abdcd1b54..ead29e9449c 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -36,7 +36,7 @@ #include "tao/Parser_Registry.h" #include "tao/Fault_Tolerance_Service.h" -#include "ace/Hash_Map_Manager.h" +#include "tao/Connection_Cache_Manager.h" // Forward declarations class TAO_Acceptor; @@ -625,6 +625,9 @@ public: // delegate to the service to see what the service has to do for // this case. + TAO_Connection_Cache_Manager &connection_cache (void); + // Return the underlying connection cache + protected: ~TAO_ORB_Core (void); @@ -914,6 +917,9 @@ protected: TAO_Parser_Registry parser_registry_; // The IOR parser registry + + TAO_Connection_Cache_Manager connection_cache_; + // The connection cache for TAO }; // **************************************************************** diff --git a/TAO/tao/ORB_Core.i b/TAO/tao/ORB_Core.i index 31d87d2880f..b05465545e4 100644 --- a/TAO/tao/ORB_Core.i +++ b/TAO/tao/ORB_Core.i @@ -58,6 +58,12 @@ TAO_ORB_Core::remove_handle (ACE_HANDLE handle) } +ACE_INLINE TAO_Connection_Cache_Manager & +TAO_ORB_Core::connection_cache (void) +{ + return this->connection_cache_; +} + ACE_INLINE CORBA::Boolean TAO_ORB_Core::service_profile_selection (TAO_MProfile &mprofile, TAO_Profile *&profile) diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp index 6ecc6b07172..5cd99b64662 100644 --- a/TAO/tao/Pluggable.cpp +++ b/TAO/tao/Pluggable.cpp @@ -11,6 +11,7 @@ #include "tao/debug.h" #include "tao/target_specification.h" +#include "tao/Base_Connection_Property.h" #if !defined (__ACE_INLINE__) # include "tao/Pluggable.i" @@ -252,7 +253,8 @@ TAO_Transport::start_locate (TAO_ORB_Core *, // Connector TAO_Connector::TAO_Connector (CORBA::ULong tag) - : tag_(tag) + : orb_core_ (0), + tag_(tag) { } @@ -429,6 +431,40 @@ TAO_Connector::make_mprofile (const char *string, return 0; // Success } + +int +TAO_Connector::find_handler (TAO_Base_Connection_Property *prop, + TAO_Connection_Handler *handler) +{ + // Compose the ExternId + TAO_Cache_ExtId ext_id (prop); + TAO_Cache_IntId int_id; + + int retval = + this->orb_core ()->connection_cache ().find (ext_id, + int_id); + + if (retval == 0) + handler = int_id.handler (); + + return retval; +} + +int +TAO_Connector::add_handler (TAO_Base_Connection_Property *prop, + TAO_Connection_Handler *handler) +{ + // Compose the ExternId & Intid + TAO_Cache_ExtId ext_id (prop); + TAO_Cache_IntId int_id (handler); + + int retval = + this->orb_core ()->connection_cache ().bind (ext_id, + int_id); + + return retval; +} + // **************************************************************** // Acceptor diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h index df22b4516e6..4002e6a722f 100644 --- a/TAO/tao/Pluggable.h +++ b/TAO/tao/Pluggable.h @@ -50,6 +50,8 @@ class TAO_Wait_Strategy; class TAO_Pluggable_Messaging_Interface; class TAO_Target_Specification; class TAO_Operation_Details; +class TAO_Base_Connection_Property; +class TAO_Connection_Handler; typedef ACE_Message_Queue TAO_Transport_Buffering_Queue; @@ -363,10 +365,10 @@ public: virtual int close (void) = 0; // Shutdown Connector bridge and concreate Connector. - virtual int connect (TAO_Endpoint *endpoint, + virtual int connect (TAO_Base_Connection_Property *prop, TAO_Transport *&, ACE_Time_Value *max_wait_time, - CORBA::Environment &ACE_TRY_ENV) = 0; + CORBA::Environment &ACE_TRY_ENV) = 0; // To support pluggable we need to abstract away the connect() // method so it can be called from the GIOP code independant of the // actual transport protocol in use. @@ -385,20 +387,34 @@ public: virtual char object_key_delimiter (void) const = 0; // Return the object key delimiter to use or expect. -#if defined (TAO_USES_ROBUST_CONNECTION_MGMT) - virtual int purge_connections (void) = 0; - // Purge "old" connections. -#endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ - protected: virtual void make_profile (const char *endpoint, TAO_Profile *&, CORBA::Environment &ACE_TRY_ENV) = 0; // Create a profile with a given endpoint. + void orb_core (TAO_ORB_Core *orb_core); + // Set the ORB Core pointer + + TAO_ORB_Core *orb_core (void); + // Return the TAO_ORB_Core pointer + + int find_handler (TAO_Base_Connection_Property *prop, + TAO_Connection_Handler *handler); + // Check the Connection Cache to check whether the connection exists + // in the Cache. + + int add_handler (TAO_Base_Connection_Property *prop, + TAO_Connection_Handler *handler); + // Add the handler to cache + private: + CORBA::ULong tag_; // IOP protocol tag. + + TAO_ORB_Core *orb_core_; + // Pointer to our ORB core }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Pluggable.i b/TAO/tao/Pluggable.i index 5e24cb367e5..d25739f0fe4 100644 --- a/TAO/tao/Pluggable.i +++ b/TAO/tao/Pluggable.i @@ -93,6 +93,18 @@ TAO_Transport::dequeue_all (void) } // **************************************************************** +ACE_INLINE TAO_ORB_Core * +TAO_Connector::orb_core (void) +{ + return this->orb_core_; +} + +ACE_INLINE void +TAO_Connector::orb_core (TAO_ORB_Core *orb_core) +{ + this->orb_core_ = orb_core; +} + ACE_INLINE CORBA::ULong TAO_Connector::tag (void) const diff --git a/TAO/tao/SHMIOP_Connector.cpp b/TAO/tao/SHMIOP_Connector.cpp index a1edfd21874..816c12d7d46 100644 --- a/TAO/tao/SHMIOP_Connector.cpp +++ b/TAO/tao/SHMIOP_Connector.cpp @@ -437,7 +437,7 @@ TAO_SHMIOP_Connector::close (void) } int -TAO_SHMIOP_Connector::connect (TAO_Endpoint *endpoint, +TAO_SHMIOP_Connector::connect (TAO_Base_Connection_Property *prop, TAO_Transport *&transport, ACE_Time_Value *max_wait_time, CORBA::Environment &) @@ -447,6 +447,8 @@ TAO_SHMIOP_Connector::connect (TAO_Endpoint *endpoint, ACE_TEXT ("TAO (%P|%t) Connector::connect - ") ACE_TEXT ("looking for SHMIOP connection.\n"))); + TAO_Endpoint *endpoint = prop->endpoint (); + if (endpoint->tag () != TAO_TAG_SHMEM_PROFILE) return -1; @@ -511,7 +513,7 @@ TAO_SHMIOP_Connector::connect (TAO_Endpoint *endpoint, { char buffer [MAXNAMELEN * 2]; endpoint->addr_to_string (buffer, - (MAXNAMELEN * 2) - 1); + (MAXNAMELEN * 2) - 1); ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) %s:%u, connection to ") ACE_TEXT ("%s failed (%p)\n"), diff --git a/TAO/tao/SHMIOP_Connector.h b/TAO/tao/SHMIOP_Connector.h index 460973b99c9..706ef39e1a6 100644 --- a/TAO/tao/SHMIOP_Connector.h +++ b/TAO/tao/SHMIOP_Connector.h @@ -41,12 +41,12 @@ #endif /* __GNUC__ */ // Necessary to do this so that the set of classes used in ACE -// for TAO_HAS_MINIMUM_CONNECTION_CACHING_STRATEGY = 1 option is +// for TAO_HAS_MINIMUM_CONNECTION_CACHING_STRATEGY = 1 option is // the same as those used for ACE_HAS_BROKEN_EXTENDED_TEMPLATES #if (TAO_HAS_MINIMUM_CONNECTION_CACHING_STRATEGY == 1) #define ACE_HAS_BROKEN_EXTENDED_TEMPLATES #endif /*TAO_HAS_MINIMUM_CONNECTION_CACHING_STRATEGY == 1*/ - + #include "ace/Cached_Connect_Strategy_T.h" #endif /* TAO_USES_ROBUST_CONNECTION_MGMT */ @@ -77,7 +77,7 @@ public: private: TAO_ORB_Core* orb_core_; // The ORB - + CORBA::Boolean lite_flag_; // Are we using lite? }; @@ -103,7 +103,7 @@ public: // Pluggable.h int open (TAO_ORB_Core *orb_core); int close (void); - int connect (TAO_Endpoint *endpoint, + int connect (TAO_Base_Connection_Property *prop, TAO_Transport *&transport, ACE_Time_Value *max_wait_time, CORBA::Environment &ACE_TRY_ENV); diff --git a/TAO/tao/SHMIOP_Endpoint.cpp b/TAO/tao/SHMIOP_Endpoint.cpp index 25c40601948..a43a7c9e3c5 100644 --- a/TAO/tao/SHMIOP_Endpoint.cpp +++ b/TAO/tao/SHMIOP_Endpoint.cpp @@ -142,4 +142,39 @@ TAO_SHMIOP_Endpoint::next (void) return this->next_; } +TAO_Endpoint * +TAO_SHMIOP_Endpoint::duplicate (void) +{ + TAO_SHMIOP_Endpoint *endpoint = 0; + ACE_NEW_RETURN (endpoint, + TAO_SHMIOP_Endpoint (this->host_, + this->port_, + this->object_addr_), + 0); + + return endpoint; +} + + +CORBA::Boolean +TAO_SHMIOP_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint) +{ + TAO_SHMIOP_Endpoint *endpoint = ACE_dynamic_cast (TAO_SHMIOP_Endpoint *, + other_endpoint); + if (endpoint == 0) + return 0; + + return + this->port_ == endpoint->port_ + && ACE_OS::strcmp (this->host_.in (), endpoint->host_.in ()) == 0; +} + +CORBA::ULong +TAO_SHMIOP_Endpoint::hash (void) +{ + return + ACE::hash_pjw (this->host_.in ()) + + this->port_; +} + #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */ diff --git a/TAO/tao/SHMIOP_Endpoint.h b/TAO/tao/SHMIOP_Endpoint.h index bd5b1e7125d..9f8b6681e5c 100644 --- a/TAO/tao/SHMIOP_Endpoint.h +++ b/TAO/tao/SHMIOP_Endpoint.h @@ -78,6 +78,15 @@ public: virtual TAO_Endpoint *next (void); virtual int addr_to_string (char *buffer, size_t length); virtual void reset_hint (void); + virtual TAO_Endpoint *duplicate (void); + // Return a copy of + + CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint); + // Return true if this endpoint is equivalent to . Two + // endpoints are equivalent iff their port and host are the same. + + CORBA::ULong hash (void); + // Return a hash value for this object. // = SHMIOP_Endpoint-specific methods. @@ -101,13 +110,6 @@ public: TAO_SHMIOP_Client_Connection_Handler *&hint (void); // Access to our . - CORBA::Boolean is_equivalent (const TAO_SHMIOP_Endpoint *other_endpoint); - // Return true if this endpoint is equivalent to . Two - // endpoints are equivalent iff their port and host are the same. - - CORBA::ULong hash (void); - // Return a hash value for this object. - private: int set (const ACE_INET_Addr &addr, int use_dotted_decimal_addresses); diff --git a/TAO/tao/SHMIOP_Endpoint.i b/TAO/tao/SHMIOP_Endpoint.i index ce9dcad319a..1de11903fae 100644 --- a/TAO/tao/SHMIOP_Endpoint.i +++ b/TAO/tao/SHMIOP_Endpoint.i @@ -56,19 +56,3 @@ TAO_SHMIOP_Endpoint::hint (void) { return this->hint_; } - -ACE_INLINE CORBA::ULong -TAO_SHMIOP_Endpoint::hash (void) -{ - return - ACE::hash_pjw (this->host_.in ()) - + this->port_; -} - -ACE_INLINE CORBA::Boolean -TAO_SHMIOP_Endpoint::is_equivalent (const TAO_SHMIOP_Endpoint *other_endpoint) -{ - return - this->port_ == other_endpoint->port_ - && ACE_OS::strcmp (this->host_.in (), other_endpoint->host_.in ()) == 0; -} diff --git a/TAO/tao/TAO.dsp b/TAO/tao/TAO.dsp index 0a31c990c1c..48975592a9d 100644 --- a/TAO/tao/TAO.dsp +++ b/TAO/tao/TAO.dsp @@ -385,6 +385,25 @@ SOURCE=.\Asynch_Reply_Dispatcher.cpp # End Source File # Begin Source File +SOURCE=.\Base_Connection_Property.cpp + +!IF "$(CFG)" == "TAO DLL - Win32 Alpha Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Debug" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Debug" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Debug" + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\Bind_Dispatcher_Guard.cpp !IF "$(CFG)" == "TAO DLL - Win32 Alpha Release" @@ -442,6 +461,25 @@ SOURCE=.\Buffering_Constraint_Policy.cpp # End Source File # Begin Source File +SOURCE=.\Cache_Entries.cpp + +!IF "$(CFG)" == "TAO DLL - Win32 Alpha Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Debug" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Debug" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Debug" + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\CDR.cpp !IF "$(CFG)" == "TAO DLL - Win32 Alpha Release" @@ -499,6 +537,25 @@ SOURCE=.\Client_Strategy_Factory.cpp # End Source File # Begin Source File +SOURCE=.\Connection_Cache_Manager.cpp + +!IF "$(CFG)" == "TAO DLL - Win32 Alpha Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Alpha Debug" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 MFC Debug" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Release" + +!ELSEIF "$(CFG)" == "TAO DLL - Win32 Debug" + +!ENDIF + +# End Source File +# Begin Source File + SOURCE=.\Connection_Handler.cpp !IF "$(CFG)" == "TAO DLL - Win32 Alpha Release" @@ -3461,6 +3518,10 @@ SOURCE=.\Asynch_Reply_Dispatcher.h # End Source File # Begin Source File +SOURCE=.\Base_Connection_Property.h +# End Source File +# Begin Source File + SOURCE=.\Bind_Dispatcher_Guard.h # End Source File # Begin Source File @@ -3473,6 +3534,10 @@ SOURCE=.\Buffering_Constraint_Policy.h # End Source File # Begin Source File +SOURCE=.\Cache_Entries.h +# End Source File +# Begin Source File + SOURCE=.\cdr.h # End Source File # Begin Source File @@ -3485,6 +3550,10 @@ SOURCE=.\Client_Strategy_Factory.h # End Source File # Begin Source File +SOURCE=.\Connection_Cache_Manager.h +# End Source File +# Begin Source File + SOURCE=.\Connection_Handler.h # End Source File # Begin Source File @@ -4141,6 +4210,10 @@ SOURCE=.\Asynch_Invocation.i # End Source File # Begin Source File +SOURCE=.\Base_Connection_Property.i +# End Source File +# Begin Source File + SOURCE=.\Bind_Dispatcher_Guard.i # End Source File # Begin Source File @@ -4153,6 +4226,10 @@ SOURCE=.\Buffering_Constraint_Policy.i # End Source File # Begin Source File +SOURCE=.\Cache_Entries.i +# End Source File +# Begin Source File + SOURCE=.\cdr.i # End Source File # Begin Source File @@ -4161,6 +4238,10 @@ SOURCE=.\Client_Priority_Policy.i # End Source File # Begin Source File +SOURCE=.\Connection_Cache_Manager.i +# End Source File +# Begin Source File + SOURCE=.\Connection_Handler.i # End Source File # Begin Source File diff --git a/TAO/tao/TAO_Static.dsp b/TAO/tao/TAO_Static.dsp index e95d9492f5b..1d0211f11e8 100644 --- a/TAO/tao/TAO_Static.dsp +++ b/TAO/tao/TAO_Static.dsp @@ -123,6 +123,10 @@ SOURCE=.\Asynch_Reply_Dispatcher.h # End Source File # Begin Source File +SOURCE=.\Base_Connection_Property.h +# End Source File +# Begin Source File + SOURCE=.\Bind_Dispatcher_Guard.h # End Source File # Begin Source File @@ -135,6 +139,10 @@ SOURCE=.\Buffering_Constraint_Policy.h # End Source File # Begin Source File +SOURCE=.\Cache_Entries.h +# End Source File +# Begin Source File + SOURCE=.\cdr.h # End Source File # Begin Source File @@ -147,6 +155,14 @@ SOURCE=.\Client_Strategy_Factory.h # End Source File # Begin Source File +SOURCE=.\Connection_Cache_Manager.h +# End Source File +# Begin Source File + +SOURCE=.\Connection_Handler.h +# End Source File +# Begin Source File + SOURCE=.\Connector_Registry.h # End Source File # Begin Source File @@ -807,6 +823,10 @@ SOURCE=.\Asynch_Invocation.i # End Source File # Begin Source File +SOURCE=.\Base_Connection_Property.i +# End Source File +# Begin Source File + SOURCE=.\Bind_Dispatcher_Guard.i # End Source File # Begin Source File @@ -819,6 +839,10 @@ SOURCE=.\Buffering_Constraint_Policy.i # End Source File # Begin Source File +SOURCE=.\Cache_Entries.i +# End Source File +# Begin Source File + SOURCE=.\cdr.i # End Source File # Begin Source File @@ -827,6 +851,14 @@ SOURCE=.\Client_Priority_Policy.i # End Source File # Begin Source File +SOURCE=.\Connection_Cache_Manager.i +# End Source File +# Begin Source File + +SOURCE=.\Connection_Handler.i +# End Source File +# Begin Source File + SOURCE=.\Context.i # End Source File # Begin Source File @@ -1295,6 +1327,10 @@ SOURCE=.\Asynch_Reply_Dispatcher.cpp # End Source File # Begin Source File +SOURCE=.\Base_Connection_Property.cpp +# End Source File +# Begin Source File + SOURCE=.\Bind_Dispatcher_Guard.cpp # End Source File # Begin Source File @@ -1307,6 +1343,10 @@ SOURCE=.\Buffering_Constraint_Policy.cpp # End Source File # Begin Source File +SOURCE=.\Cache_Entries.cpp +# End Source File +# Begin Source File + SOURCE=.\CDR.cpp # End Source File # Begin Source File @@ -1319,6 +1359,14 @@ SOURCE=.\Client_Strategy_Factory.cpp # End Source File # Begin Source File +SOURCE=.\Connection_Cache_Manager.cpp +# End Source File +# Begin Source File + +SOURCE=.\Connection_Handler.cpp +# End Source File +# Begin Source File + SOURCE=.\Connector_Registry.cpp # End Source File # Begin Source File diff --git a/TAO/tao/UIOP_Connector.h b/TAO/tao/UIOP_Connector.h index 5ccc8c6ce5e..8b0b3edbde0 100644 --- a/TAO/tao/UIOP_Connector.h +++ b/TAO/tao/UIOP_Connector.h @@ -42,7 +42,7 @@ #endif /* __GNUC__ */ // Necessary to do this so that the set of classes used in ACE -// for TAO_HAS_MINIMUM_CONNECTION_CACHING_STRATEGY = 1 option is +// for TAO_HAS_MINIMUM_CONNECTION_CACHING_STRATEGY = 1 option is // the same as those used for ACE_HAS_BROKEN_EXTENDED_TEMPLATES #if (TAO_HAS_MINIMUM_CONNECTION_CACHING_STRATEGY == 1) #define ACE_HAS_BROKEN_EXTENDED_TEMPLATES @@ -82,7 +82,7 @@ public: private: TAO_ORB_Core* orb_core_; // The ORB - + void *arg_; // Some info/state to be passed to the service handler we create. @@ -110,7 +110,7 @@ public: // Pluggable.h int open (TAO_ORB_Core *orb_core); int close (void); - int connect (TAO_Endpoint *endpoint, + int connect (TAO_Base_Connection_Property *prop, TAO_Transport *&transport, ACE_Time_Value *max_wait_time, CORBA::Environment &ACE_TRY_ENV); @@ -224,7 +224,7 @@ private: CORBA::Boolean lite_flag_; // Do we need to use a GIOP_Lite for sending messages? - + #if defined (TAO_USES_ROBUST_CONNECTION_MGMT) TAO_CACHED_CONNECT_STRATEGY *cached_connect_strategy_; // Cached connect strategy. @@ -236,7 +236,7 @@ private: TAO_UIOP_Handler_Base::UIOP_Properties uiop_properties_; // UIOP configuration properties for all connections established by - // this connector. + // this connector. }; # endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/UIOP_Endpoint.cpp b/TAO/tao/UIOP_Endpoint.cpp index 860250ea4eb..0b4cde2ca67 100644 --- a/TAO/tao/UIOP_Endpoint.cpp +++ b/TAO/tao/UIOP_Endpoint.cpp @@ -59,4 +59,33 @@ TAO_UIOP_Endpoint::next (void) return this->next_; } +TAO_Endpoint * +TAO_UIOP_Endpoint::duplicate (void) +{ + TAO_UIOP_Endpoint *endpoint = 0; + ACE_NEW_RETURN (endpoint, + TAO_UIOP_Endpoint (this->object_addr_), + 0); + + return endpoint; +} + +CORBA::Boolean +TAO_UIOP_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint) +{ + TAO_UIOP_Endpoint *endpoint = ACE_dynamic_cast (TAO_UIOP_Endpoint *, + other_endpoint); + if (endpoint == 0) + return 0; + + return + ACE_OS::strcmp (this->rendezvous_point (), + endpoint->rendezvous_point ()) == 0; +} + +CORBA::ULong +TAO_UIOP_Endpoint::hash (void) +{ + return ACE::hash_pjw (this->rendezvous_point ()); +} #endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/UIOP_Endpoint.h b/TAO/tao/UIOP_Endpoint.h index 09d6025467e..f13891c3e2f 100644 --- a/TAO/tao/UIOP_Endpoint.h +++ b/TAO/tao/UIOP_Endpoint.h @@ -64,6 +64,16 @@ public: virtual int addr_to_string (char *buffer, size_t length); virtual void reset_hint (void); + virtual TAO_Endpoint *duplicate (void); + // Returns a copy of + + CORBA::Boolean is_equivalent (const TAO_Endpoint *other_endpoint); + // Return true if this endpoint is equivalent to . Two + // endpoints are equivalent iff their rendezvous points are the same. + + CORBA::ULong hash (void); + // Return a hash value for this object. + // = UIOP_Endpoint-specific methods. const ACE_UNIX_Addr &object_addr (void) const; @@ -76,13 +86,6 @@ public: TAO_UIOP_Client_Connection_Handler *&hint (void); // Access to our . - CORBA::Boolean is_equivalent (const TAO_UIOP_Endpoint *other_endpoint); - // Return true if this endpoint is equivalent to . Two - // endpoints are equivalent iff their rendezvous points are the same. - - CORBA::ULong hash (void); - // Return a hash value for this object. - private: ACE_UNIX_Addr object_addr_; diff --git a/TAO/tao/UIOP_Endpoint.i b/TAO/tao/UIOP_Endpoint.i index 180cd1bce87..440223aa06b 100644 --- a/TAO/tao/UIOP_Endpoint.i +++ b/TAO/tao/UIOP_Endpoint.i @@ -21,18 +21,5 @@ TAO_UIOP_Endpoint::rendezvous_point (void) const return this->object_addr_.get_path_name (); } -ACE_INLINE CORBA::ULong -TAO_UIOP_Endpoint::hash (void) -{ - return ACE::hash_pjw (this->rendezvous_point ()); -} - -ACE_INLINE CORBA::Boolean -TAO_UIOP_Endpoint::is_equivalent (const TAO_UIOP_Endpoint *other_endpoint) -{ - return - ACE_OS::strcmp (this->rendezvous_point (), - other_endpoint->rendezvous_point ()) == 0; -} #endif /* TAO_HAS_UIOP == 1 */ -- cgit v1.2.1