diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-10-30 23:43:28 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-10-30 23:43:28 +0000 |
commit | fe96bc4d60ebbc0739d141b385eb22d9d3e995b5 (patch) | |
tree | 60ec932d9625a2db85a4fec9dc756220bcda91e1 | |
parent | 865584ac993a0e627ae39a0e6adcc82aadab3d22 (diff) | |
download | ATCD-fe96bc4d60ebbc0739d141b385eb22d9d3e995b5.tar.gz |
*** empty log message ***
-rw-r--r-- | TAO/tao/Connection_Cache_Manager.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Connection_Cache_Manager.h | 11 | ||||
-rw-r--r-- | TAO/tao/Connection_Cache_Manager.inl | 34 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connect.cpp | 20 | ||||
-rw-r--r-- | TAO/tao/IIOP_Connector.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/Pluggable.cpp | 33 | ||||
-rw-r--r-- | TAO/tao/Pluggable.h | 9 |
7 files changed, 74 insertions, 46 deletions
diff --git a/TAO/tao/Connection_Cache_Manager.cpp b/TAO/tao/Connection_Cache_Manager.cpp index d432ced3a56..8055a4acb2a 100644 --- a/TAO/tao/Connection_Cache_Manager.cpp +++ b/TAO/tao/Connection_Cache_Manager.cpp @@ -25,6 +25,8 @@ TAO_Connection_Cache_Manager::~TAO_Connection_Cache_Manager (void) delete this->cache_lock_; } + + int TAO_Connection_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id, TAO_Cache_IntId &int_id) diff --git a/TAO/tao/Connection_Cache_Manager.h b/TAO/tao/Connection_Cache_Manager.h index 5d2883273ff..9ea81a5c3a5 100644 --- a/TAO/tao/Connection_Cache_Manager.h +++ b/TAO/tao/Connection_Cache_Manager.h @@ -74,6 +74,17 @@ public: virtual ~TAO_Connection_Cache_Manager (void); // Destructor + int cache_handler (TAO_Base_Connection_Property *prop, + TAO_Connection_Handler *handler); + // Add the handler to the cache. The handler has the property + // definition based on which caching can be done + + + 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 and return the connection + int open (size_t size = ACE_DEFAULT_MAP_SIZE, ACE_Allocator *alloc = 0); // Initialize a <HASH_MAP> with <size> elements. diff --git a/TAO/tao/Connection_Cache_Manager.inl b/TAO/tao/Connection_Cache_Manager.inl index 3e163841d4b..657fedf85da 100644 --- a/TAO/tao/Connection_Cache_Manager.inl +++ b/TAO/tao/Connection_Cache_Manager.inl @@ -1,6 +1,40 @@ /* -*- C++ -*- */ //$Id$ + +ACE_INLINE int +TAO_Connection_Cache_Manager:: + cache_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); + + return this->bind (ext_id, + int_id); + +} + +ACE_INLINE int +TAO_Connection_Cache_Manager:: + 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->find (ext_id, + int_id); + if (retval == 0) + { + handler = int_id.handler (); + } + + return retval; +} + ACE_INLINE int TAO_Connection_Cache_Manager::bind (TAO_Cache_ExtId &ext_id, TAO_Cache_IntId &int_id) diff --git a/TAO/tao/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp index 2124a82173f..d9732139d55 100644 --- a/TAO/tao/IIOP_Connect.cpp +++ b/TAO/tao/IIOP_Connect.cpp @@ -11,6 +11,8 @@ #include "tao/GIOP_Message_Acceptors.h" #include "tao/Server_Strategy_Factory.h" #include "tao/IIOP_Transport.h" +#include "tao/IIOP_Endpoint.h" +#include "tao/Connection_Cache_Manager.h" #if !defined (__ACE_INLINE__) # include "tao/IIOP_Connect.i" @@ -142,6 +144,24 @@ TAO_IIOP_Server_Connection_Handler::open (void*) else if (addr.addr_to_string (client, sizeof (client)) == -1) return -1; + // Construct an IIOP_Endpoint object + TAO_IIOP_Endpoint endpoint (addr, + 0); + + // Construct a property object + TAO_Base_Connection_Property prop (&endpoint); + + // Add the handler to Cache + if (this->orb_core ()->connection_cache ().cache_handler (&prop, + this) == -1) + { + if (TAO_debug_level > 4) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) unable to cache the handle \n"))); + } + } + if (TAO_debug_level > 0) { ACE_DEBUG ((LM_DEBUG, diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 2b27d021a49..121b6aba25f 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -184,7 +184,8 @@ TAO_IIOP_Connector::connect (TAO_Base_Connection_Property *prop, TAO_Connection_Handler *conn_handler = 0; // Check the Cache first for connections - if (this->find_handler (prop, conn_handler) == 0) + if (this->orb_core ()->connection_cache ().find_handler (prop, + conn_handler) == 0) { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, @@ -244,14 +245,16 @@ TAO_IIOP_Connector::connect (TAO_Base_Connection_Property *prop, __LINE__, iiop_endpoint->host (), iiop_endpoint->port (), - "errno")); + "errno")); } return -1; } // Add the handler to Cache - int retval = this->add_handler (prop, - svc_handler); + int retval = + this->orb_core ()->connection_cache ().cache_handler (prop, + svc_handler); + if (retval != 0 && TAO_debug_level > 0) { diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp index b0faecace8b..ba9d530db12 100644 --- a/TAO/tao/Pluggable.cpp +++ b/TAO/tao/Pluggable.cpp @@ -433,40 +433,7 @@ TAO_Connector::make_mprofile (const char *string, } -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; -} // **************************************************************** diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h index f0a4522c0f9..12057551437 100644 --- a/TAO/tao/Pluggable.h +++ b/TAO/tao/Pluggable.h @@ -398,15 +398,6 @@ protected: 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_; |