diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-10-23 22:34:13 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-10-23 22:34:13 +0000 |
commit | cb2a9860adcca340bf7f2ce02961bef343e07bc9 (patch) | |
tree | 41fd9f621b40b57d88507e1f780187d301af9f4d | |
parent | e9f0ada57b958cd07bdbc41f4a3847875e3d71c8 (diff) | |
download | ATCD-cb2a9860adcca340bf7f2ce02961bef343e07bc9.tar.gz |
*** empty log message ***
29 files changed, 312 insertions, 220 deletions
diff --git a/TAO/tao/Base_Connection_Property.cpp b/TAO/tao/Base_Connection_Property.cpp index 0e2c9be4d2a..df3976860d6 100644 --- a/TAO/tao/Base_Connection_Property.cpp +++ b/TAO/tao/Base_Connection_Property.cpp @@ -1,15 +1,23 @@ //$Id$ #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" +# include "tao/Base_Connection_Property.inl" #endif /* __ACE_INLINE__ */ ACE_RCSID(tao, Base_Connection_Property, "$Id$") + +TAO_Base_Connection_Property::~TAO_Base_Connection_Property (void) +{ + if (endpoint_flag_) + delete this->endpoint_; +} + + TAO_Base_Connection_Property * TAO_Base_Connection_Property::duplicate (void) { diff --git a/TAO/tao/Base_Connection_Property.h b/TAO/tao/Base_Connection_Property.h index ecc1da8497d..d7c52c9ca16 100644 --- a/TAO/tao/Base_Connection_Property.h +++ b/TAO/tao/Base_Connection_Property.h @@ -18,7 +18,8 @@ #define TAO_BASE_CONNECTION_PROPERTY_H #include "ace/pre.h" -#include "tao/TAO_Export.h" +#include "tao/Endpoint.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once @@ -31,9 +32,7 @@ #pragma warning(disable:4250) #endif /* _MSC_VER */ -#include "tao/corbafwd.h" -class TAO_Endpoint; class TAO_Export TAO_Base_Connection_Property { @@ -47,8 +46,13 @@ class TAO_Export TAO_Base_Connection_Property // used to do a look up of the connection from the cache. // Note 1: Additional properties for connection like Qos, // Priority that the RT folks would need, can be added by - // inheriting from this class. - + // inheriting from this class and providing the following + // methods. + // 1. duplicate () + // 2. operator== + // 3. operator= + // 4. operator!= + // 5. hash () public: TAO_Base_Connection_Property (void); @@ -102,7 +106,7 @@ private: }; #if defined (__ACE_INLINE__) -# include "tao/Base_Connection_Property.i" +# include "tao/Base_Connection_Property.inl" #endif /* __ACE_INLINE__ */ #include "ace/post.h" diff --git a/TAO/tao/Base_Connection_Property.i b/TAO/tao/Base_Connection_Property.i index 4256027d1ee..db1a946706b 100644 --- a/TAO/tao/Base_Connection_Property.i +++ b/TAO/tao/Base_Connection_Property.i @@ -16,13 +16,6 @@ TAO_Base_Connection_Property:: { } -ACE_INLINE -TAO_Base_Connection_Property::~TAO_Base_Connection_Property (void) -{ - if (endpoint_flag_) - delete this->endpoint_; -} - ACE_INLINE TAO_Endpoint * TAO_Base_Connection_Property::endpoint (void) diff --git a/TAO/tao/Cache_Entries.cpp b/TAO/tao/Cache_Entries.cpp index 163e1f85ea4..15d020057c2 100644 --- a/TAO/tao/Cache_Entries.cpp +++ b/TAO/tao/Cache_Entries.cpp @@ -4,7 +4,26 @@ #if !defined (__ACE_INLINE__) -# include "tao/Cache_Entries.i" +# include "tao/Cache_Entries.inl" #endif /* __ACE_INLINE__ */ ACE_RCSID(tao, Cache_Entries, "$Id$") + + +void +TAO_Cache_IntId::operator= (const TAO_Cache_IntId &rhs) +{ + this->handler_ = rhs.handler_; +} + +int +TAO_Cache_IntId::operator== (const TAO_Cache_IntId &rhs) const +{ + return (this->handler_ == rhs.handler_); +} + +int +TAO_Cache_IntId::operator!= (const TAO_Cache_IntId &rhs) const +{ + return (this->handler_ != rhs.handler_); +} diff --git a/TAO/tao/Cache_Entries.h b/TAO/tao/Cache_Entries.h index a018176b72b..db423414d3c 100644 --- a/TAO/tao/Cache_Entries.h +++ b/TAO/tao/Cache_Entries.h @@ -4,7 +4,7 @@ // ============================================================================ // // = LIBRARY -// tao +// TAO // // = FILENAME // Cache_Entries.h @@ -32,21 +32,22 @@ #endif /* _MSC_VER */ class TAO_Connection_Handler; +class Tao_Base_Connection_Property; class TAO_Export TAO_Cache_IntId { // = TITLE - // Helper class for TAO_Connection_Cache_Manager: unifies - // several data items, so they can be stored together as a - // <value> for a <key> in a table holding the state of the - // Connection Cache. + // Helper class for TAO_Connection_Cache_Manager // // = DESCRIPTION // Helper class that wraps the <value> part of the Map or - // table holding the Connection state. + // table holding the Connection state.: unifies data items, so + // they can be stored together as a <value> for a <key> in a + // table holding the state of the Connection Cache. public: - // = Initialization and termination methods. + + // = Initialization and termination methods. TAO_Cache_IntId (void); // Constructor. @@ -60,19 +61,26 @@ public: ~TAO_Cache_IntId (void); // Destructor. + void operator= (const TAO_Cache_IntId &rhs); + // Assignment operator (does copy memory). + + int operator== (const TAO_Cache_IntId &rhs) const; + // Equality comparison operator (must match both id_ and kind_). + + int operator!= (const TAO_Cache_IntId &rhs) const; + // Inequality comparison operator. + 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 when I get to purging.... }; @@ -122,7 +130,8 @@ public: // Return the index value void index (CORBA::ULong index); - // Set the index value + // Set the index value. This calls should not be used by any users + // but for the TAO_Connection_Cache_Manager class. // = Accessors @@ -136,12 +145,15 @@ private: // Do we need to delete connection_propert_? CORBA::ULong index_; - // This is a supplementary index + // This is a supplementary index. Would be set to zero by + // default. Would be altered by the Connection_Cache of TAO. Please + // see the documentation of TAO_Connection_Cache_Manager for + // details. }; #if defined (__ACE_INLINE__) -# include "tao/Cache_Entries.i" +# include "tao/Cache_Entries.inl" #endif /* __ACE_INLINE__ */ #include "ace/post.h" diff --git a/TAO/tao/Connection_Cache_Manager.cpp b/TAO/tao/Connection_Cache_Manager.cpp index cbb7f586c28..13f762b738a 100644 --- a/TAO/tao/Connection_Cache_Manager.cpp +++ b/TAO/tao/Connection_Cache_Manager.cpp @@ -4,7 +4,7 @@ #if !defined (__ACE_INLINE__) -# include "tao/Connection_Cache_Manager.i" +# include "tao/Connection_Cache_Manager.inl" #endif /* __ACE_INLINE__ */ @@ -38,8 +38,8 @@ TAO_Connection_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id, // Get the entry too HASH_MAP_ENTRY *entry = 0; int retval = this->cache_map_.bind (ext_id, - int_id, - entry); + int_id, + entry); if (retval == 0) { // The entry has been added to cache succesfully @@ -50,9 +50,9 @@ TAO_Connection_Cache_Manager::bind_i (TAO_Cache_ExtId &ext_id, { // There was an entry like this before, so let us do some // minor adjustments - retval = get_last_index_bind (ext_id, - int_id, - entry); + retval = this->get_last_index_bind (ext_id, + int_id, + entry); int_id.handler ()->cache_map_entry (entry); } @@ -65,9 +65,10 @@ TAO_Connection_Cache_Manager::find_i (const TAO_Cache_ExtId &key, TAO_Cache_IntId &value) { HASH_MAP_ENTRY *entry = 0; + // Get the entry from the Hash Map int retval = this->cache_map_.find (key, - entry); + entry); if (retval == 0) { retval = this->get_idle_handler (key, @@ -85,7 +86,7 @@ TAO_Connection_Cache_Manager::rebind_i (const TAO_Cache_ExtId &key, const TAO_Cache_IntId &value) { return this->cache_map_.rebind (key, - value); + value); } int @@ -112,6 +113,7 @@ TAO_Connection_Cache_Manager::unbind_i (const TAO_Cache_ExtId &key, int 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; @@ -157,8 +159,8 @@ TAO_Connection_Cache_Manager:: int TAO_Connection_Cache_Manager:: - get_idle_handler (const TAO_Cache_ExtId &ext_id, - HASH_MAP_ENTRY *&entry) +get_idle_handler (const TAO_Cache_ExtId & /*ext_id*/, + HASH_MAP_ENTRY *&entry) { // We are sure that we have an entry do diff --git a/TAO/tao/Connection_Cache_Manager.h b/TAO/tao/Connection_Cache_Manager.h index 517dcfd2dbe..fa7a71a5e33 100644 --- a/TAO/tao/Connection_Cache_Manager.h +++ b/TAO/tao/Connection_Cache_Manager.h @@ -40,9 +40,14 @@ class TAO_Cache_IntId; class TAO_Export TAO_Connection_Cache_Manager { // = TITLE - + // The Connection Cache Manager for TAO // = DESCRIPTION + // This class provides interfaces associating a TAO_Cache_ExtId + // & TAO_Cache_IntId. This class manages a ACE_Hash_Map_Manager + // class which is used as a container to Cache the + // connections. This class protects the entries with a lock. The + // map can be updated only by holding the lock. public: @@ -75,33 +80,24 @@ public: int bind (TAO_Cache_ExtId &ext_id, TAO_Cache_IntId &int_id); - // Associate <ext_id> with <int_id>. If <ext_id> is already in the - // map then the <Map_Entry> is not changed. Returns 0 if a new - // entry is bound successfully, returns 1 if an attempt is made to - // bind an existing entry, and returns -1 if failures occur. + // Associate <ext_id> with <int_id>. Grabs the lock and calls the + // implementation function bind_i. int find (const TAO_Cache_ExtId &key, TAO_Cache_IntId &value); - // Lookup entry<key,value> in the cache. If it is not found, returns -1. - // If the <key> is located in the MAP object, the CACHING_STRATEGY is - // notified of it via notify_find (int result, ATTRIBUTES &attribute). - // If notify_find also returns 0 (success), then this function returns - // 0 (success) and sets the cached value in <value>. + // Lookup entry<key,value> in the cache. Grabs the lock and calls the + // implementation function find_i. int rebind (const TAO_Cache_ExtId &key, const TAO_Cache_IntId &value); - // Reassociate the <key> with <value>. If the <key> already exists - // in the cache then returns 1, on a new bind returns 0 and returns - // -1 in case of any failures. + // Reassociate the <key> with <value>. Grabs the lock and calls the + // implementation function find_i. int trybind (const TAO_Cache_ExtId &key, TAO_Cache_IntId &value); // Associate <key> with <value> if and only if <key> is not in the - // cache. If <key> is already in the cache, then the <value> - // parameter is overwritten with the existing value in the - // cache. Returns 0 if a new <key>/<value> association is created. - // Returns 1 if an attempt is made to bind an existing entry. This - // function fails for maps that do not allow user specified keys. + // cache. Grabs the lock and calls the implementation function + // find_i. int unbind (const TAO_Cache_ExtId &key); // Remove <key> from the cache. @@ -127,11 +123,17 @@ private: int bind_i (TAO_Cache_ExtId &ext_id, TAO_Cache_IntId &int_id); - // Non-Locking version of bind () call + // Non-Locking version of bind () call. Calls bind on the + // Hash_Map_Manager that it holds. If the bind succeeds, it adds the + // Hash_Map_Entry in to the Connection_Handler for its reference. If + // the bind fails because of an exiting entry, this method calls the + // get_last_index_bind (). int find_i (const TAO_Cache_ExtId &key, TAO_Cache_IntId &value); - // Non-locking version of find () call + // Non-locking version of find () call. This calls the find () on + // the underlying Hash_Map_Manager. If the find succeeds, it calls + // the get_idle_handler (). int rebind_i (const TAO_Cache_ExtId &key, const TAO_Cache_IntId &value); @@ -149,20 +151,30 @@ private: // Non-locking version of unbind () call int make_idle_i (HASH_MAP_ENTRY *&entry); - // Non-locking version of make_idle () + // 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. + // This is called by the bind () call when a bind fails with a + // available entry. When a new connection is created in TAO with an + // already existing endpoint, in addition to an exisitng one, we + // mark the connections with an index. This method, finds out the + // last highest index and binds the entry with an index = (last + // highest index + 1). int get_idle_handler (const TAO_Cache_ExtId &ext_id, HASH_MAP_ENTRY *&entry); - // Get an idle handler if one is available in Cache + // This is called by the find (). Get an idle handler if one is + // available in Cache. If an idle one does not exist, we look at the + // next entry to see whether we have an entry of the same ext_id + // type. If so, we check whether they are are idle for use. If we + // find one we mark it busy, and set the Hash_Map_Entry in the + // Connection_Handler object. private: + HASH_MAP cache_map_; // The hash map that has the connections @@ -171,7 +183,7 @@ private: }; #if defined (__ACE_INLINE__) -# include "tao/Connection_Cache_Manager.i" +# include "tao/Connection_Cache_Manager.inl" #endif /* __ACE_INLINE__ */ #include "ace/post.h" diff --git a/TAO/tao/Connection_Handler.cpp b/TAO/tao/Connection_Handler.cpp index 8935aed4ab3..8eef1634dbe 100644 --- a/TAO/tao/Connection_Handler.cpp +++ b/TAO/tao/Connection_Handler.cpp @@ -7,7 +7,7 @@ #include "tao/Messaging_Policy_i.h" #if !defined (__ACE_INLINE__) -#include "tao/Connection_Handler.i" +#include "tao/Connection_Handler.inl" #endif /* __ACE_INLINE__ */ ACE_RCSID(tao, Connection_Handler, "$Id$") @@ -24,6 +24,12 @@ TAO_Connection_Handler::~TAO_Connection_Handler (void) { } +int +TAO_Connection_Handler::make_idle (void) +{ + return + this->orb_core_->connection_cache ().make_idle (this->cache_map_entry_); +} void TAO_Connection_Handler::remove_handle (ACE_HANDLE handle) diff --git a/TAO/tao/Connection_Handler.h b/TAO/tao/Connection_Handler.h index f3c9b0aba9e..d1b474c2148 100644 --- a/TAO/tao/Connection_Handler.h +++ b/TAO/tao/Connection_Handler.h @@ -86,17 +86,6 @@ public: 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 <act_holder != 0>. - int make_idle (void); // Make ourselves ready for use @@ -152,7 +141,7 @@ private: }; #if defined (__ACE_INLINE__) -#include "tao/Connection_Handler.i" +#include "tao/Connection_Handler.inl" #endif /* __ACE_INLINE__ */ #endif /*TAO_CONNECTION_HANDLER_H*/ diff --git a/TAO/tao/Connection_Handler.i b/TAO/tao/Connection_Handler.i index 1a79e07a6e0..be7d1f6701c 100644 --- a/TAO/tao/Connection_Handler.i +++ b/TAO/tao/Connection_Handler.i @@ -46,9 +46,3 @@ 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/IIOP_Connect.cpp b/TAO/tao/IIOP_Connect.cpp index ec632e7e409..82d45924002 100644 --- a/TAO/tao/IIOP_Connect.cpp +++ b/TAO/tao/IIOP_Connect.cpp @@ -53,20 +53,8 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_IIOP_Connect_Timeprobe_Description, #endif /* ACE_ENABLE_TIMEPROBES */ -TAO_IIOP_Handler_Base::TAO_IIOP_Handler_Base (TAO_ORB_Core *orb_core) - : TAO_SVC_HANDLER (orb_core->thr_mgr (), 0, 0) -{ -} - -TAO_IIOP_Handler_Base::TAO_IIOP_Handler_Base (ACE_Thread_Manager *t) - : TAO_SVC_HANDLER (t, 0, 0) -{ -} - -// **************************************************************** - TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (ACE_Thread_Manager *t) - : TAO_IIOP_Handler_Base (t), + : TAO_IIOP_SVC_HANDLER (t, 0 , 0), TAO_Connection_Handler (0), transport_ (this, 0), acceptor_factory_ (0), @@ -81,10 +69,11 @@ TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (ACE_Thre ACE_ASSERT (this->orb_core () != 0); } + TAO_IIOP_Server_Connection_Handler::TAO_IIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core, CORBA::Boolean flag, void *arg) - : TAO_IIOP_Handler_Base (orb_core), + : TAO_IIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), transport_ (this, orb_core), acceptor_factory_ (0), @@ -295,7 +284,7 @@ TAO_IIOP_Server_Connection_Handler::handle_input_i (ACE_HANDLE, TAO_IIOP_Client_Connection_Handler:: TAO_IIOP_Client_Connection_Handler (ACE_Thread_Manager* t) - : TAO_IIOP_Handler_Base (t), + : TAO_IIOP_SVC_HANDLER (t, 0, 0), TAO_Connection_Handler (0), transport_ (this, 0), tcp_properties_ (0) @@ -309,7 +298,7 @@ TAO_IIOP_Client_Connection_Handler (ACE_Thread_Manager *t, TAO_ORB_Core* orb_core, CORBA::Boolean flag, void *arg) - : TAO_IIOP_Handler_Base (t), + : TAO_IIOP_SVC_HANDLER (t, 0 ,0), TAO_Connection_Handler (orb_core), transport_ (this, orb_core), tcp_properties_ (ACE_static_cast diff --git a/TAO/tao/IIOP_Connect.h b/TAO/tao/IIOP_Connect.h index 144d05cf731..9089d27a0b6 100644 --- a/TAO/tao/IIOP_Connect.h +++ b/TAO/tao/IIOP_Connect.h @@ -38,30 +38,24 @@ class Pluggable_Messaging; typedef ACE_Svc_Handler<ACE_SOCK_STREAM, ACE_NULL_SYNCH> - TAO_SVC_HANDLER; + TAO_IIOP_SVC_HANDLER; // **************************************************************** -class TAO_IIOP_Handler_Base : public TAO_SVC_HANDLER +class TAO_TCP_Properties { -public: - TAO_IIOP_Handler_Base (ACE_Thread_Manager *t); - TAO_IIOP_Handler_Base (TAO_ORB_Core *orb_core); - - struct TCP_Properties - { - // = TITLE - // TCP protocol properties specification for a set of - // connections. - // - int send_buffer_size; - int recv_buffer_size; - int no_delay; - }; + // = TITLE + // TCP protocol properties specification for a set of + // connections. + // + int send_buffer_size; + int recv_buffer_size; + int no_delay; }; -class TAO_Export TAO_IIOP_Client_Connection_Handler: public TAO_IIOP_Handler_Base, + +class TAO_Export TAO_IIOP_Client_Connection_Handler: public TAO_IIOP_SVC_HANDLER public TAO_Connection_Handler { // = TITLE @@ -115,13 +109,14 @@ public: // Return the transport objects protected: + int handle_cleanup (void); // This method deregisters the handler from the reactor and closes it. TAO_IIOP_Client_Transport transport_; // Reference to the transport object, it is owned by this class. - TCP_Properties *tcp_properties_; + TAO_TCP_Properties *tcp_properties_; // TCP configuration for this connection. private: @@ -206,7 +201,7 @@ protected: // you should not delete the svc_handler until the stack unwinds // from the nested upcalls. - TCP_Properties *tcp_properties_; + TAO_TCP_Properties *tcp_properties_; // TCP configuration for this connection. }; diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 161e2cd33bf..1b6d4e148d1 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -98,7 +98,7 @@ TAO_IIOP_Connector::connect (TAO_Base_Connection_Property *prop, if (prop->endpoint ()->tag () != TAO_TAG_IIOP_PROFILE) return -1; - const TAO_Endpoint *endpoint = prop->endpoint (); + TAO_Endpoint *endpoint = prop->endpoint (); TAO_IIOP_Endpoint *iiop_endpoint = ACE_dynamic_cast (TAO_IIOP_Endpoint *, diff --git a/TAO/tao/IIOP_Endpoint.cpp b/TAO/tao/IIOP_Endpoint.cpp index 21f892575fa..9277fc2c88f 100644 --- a/TAO/tao/IIOP_Endpoint.cpp +++ b/TAO/tao/IIOP_Endpoint.cpp @@ -145,7 +145,7 @@ TAO_IIOP_Endpoint::duplicate (void) TAO_IIOP_Endpoint *endpoint = 0; ACE_NEW_RETURN (endpoint, - TAO_IIOP_Endpoint (this->host_, + TAO_IIOP_Endpoint (this->host_.in (), this->port_, this->object_addr_), 0); @@ -156,8 +156,11 @@ TAO_IIOP_Endpoint::duplicate (void) CORBA::Boolean TAO_IIOP_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint) { + TAO_Endpoint *endpt = ACE_const_cast (TAO_Endpoint *, + other_endpoint); + TAO_IIOP_Endpoint *endpoint = ACE_dynamic_cast (TAO_IIOP_Endpoint *, - other_endpoint); + endpt); if (endpoint == 0) return 0; diff --git a/TAO/tao/IIOP_Transport.cpp b/TAO/tao/IIOP_Transport.cpp index 77cc367b823..572b37cb01d 100644 --- a/TAO/tao/IIOP_Transport.cpp +++ b/TAO/tao/IIOP_Transport.cpp @@ -86,11 +86,7 @@ TAO_IIOP_Transport::handler (void) return this->handler_; } -int -TAO_IIOP_Transport::idle (void) -{ - return this->handler_->idle (); -} + void TAO_IIOP_Transport::close_connection (void) @@ -125,6 +121,19 @@ TAO_IIOP_Server_Transport::~TAO_IIOP_Server_Transport (void) { } +int +TAO_IIOP_Server_Transport::idle (void) +{ + return this->handler_->make_idle (); +} + +TAO_IIOP_SVC_HANDLER * +TAO_IIOP_Server_Transport::service_handler (void) +{ + return this->handler_; +} + + // **************************************************************** TAO_IIOP_Client_Transport:: @@ -144,6 +153,13 @@ TAO_IIOP_Client_Transport::~TAO_IIOP_Client_Transport (void) delete this->client_mesg_factory_; } +int +TAO_IIOP_Client_Transport::idle (void) +{ + return this->handler_->make_idle (); +} + + void TAO_IIOP_Client_Transport::start_request (TAO_ORB_Core * /*orb_core*/, TAO_Target_Specification & /*spec */, @@ -327,6 +343,13 @@ TAO_IIOP_Client_Transport::register_handler (void) ACE_Event_Handler::READ_MASK); } + +TAO_IIOP_SVC_HANDLER * +TAO_IIOP_Server_Transport::service_handler (void) +{ + return this->handler_; +} + int TAO_IIOP_Client_Transport::messaging_init (CORBA::Octet major, CORBA::Octet minor) @@ -427,14 +450,14 @@ TAO_IIOP_Transport::send (TAO_Stub *stub, ssize_t TAO_IIOP_Transport::send (const ACE_Message_Block *message_block, const ACE_Time_Value *max_wait_time, - size_t *bytes_transferred) + size_t *bytes_transferred) { TAO_FUNCTION_PP_TIMEPROBE (TAO_IIOP_TRANSPORT_SEND_START); return ACE::send_n (this->handle (), message_block, max_wait_time, - bytes_transferred); + bytes_transferred); } ssize_t diff --git a/TAO/tao/IIOP_Transport.h b/TAO/tao/IIOP_Transport.h index 02a3b434904..e5634bedc9d 100644 --- a/TAO/tao/IIOP_Transport.h +++ b/TAO/tao/IIOP_Transport.h @@ -28,7 +28,6 @@ #include "tao/Pluggable_Messaging_Utils.h" - #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ @@ -40,6 +39,7 @@ class TAO_IIOP_Client_Connection_Handler; class TAO_IIOP_Server_Connection_Handler; class TAO_ORB_Core; + class TAO_Export TAO_IIOP_Transport : public TAO_Transport { // = TITLE @@ -64,16 +64,18 @@ public: // = The TAO_Transport methods, please check the documentation in // "tao/Pluggable.h" for more details. virtual void close_connection (void); - virtual int idle (void); + virtual ACE_HANDLE handle (void); + virtual ACE_Event_Handler *event_handler (void); + virtual ssize_t send (TAO_Stub *stub, int two_way, const ACE_Message_Block *mblk, const ACE_Time_Value *s = 0); virtual ssize_t send (const ACE_Message_Block *mblk, const ACE_Time_Value *s = 0, - size_t *bytes_transferred = 0); + size_t *bytes_transferred = 0); virtual ssize_t send (const u_char *buf, size_t len, const ACE_Time_Value *s = 0); @@ -88,14 +90,17 @@ public: virtual CORBA::Boolean send_request_header (TAO_Operation_Details &opdetails, - TAO_Target_Specification &spec, - TAO_OutputCDR &msg); + TAO_Target_Specification &spec, + TAO_OutputCDR &msg); + protected: - TAO_IIOP_Handler_Base *handler_; - // the connection service handler used for accessing lower layer - // communication protocols. + + virtual TAO_IIOP_SVC_HANLDER *service_handler (void) = 0; + // Return the connection service handler }; + + class TAO_Export TAO_IIOP_Client_Transport : public TAO_IIOP_Transport { // = TITLE @@ -118,6 +123,8 @@ public: // = The TAO_Transport methods, please check the documentation in // "tao/Pluggable.h" for more details. + virtual int idle (void); + virtual void start_request (TAO_ORB_Core *orb_core, TAO_Target_Specification &spec, TAO_OutputCDR &output, @@ -146,13 +153,22 @@ public: TAO_Target_Specification &spec, TAO_OutputCDR &msg); + virtual TAO_IIOP_SVC_HANLDER *service_handler (void); + int messaging_init (CORBA::Octet major, CORBA::Octet minor); // Initialising the messaging object void use_lite (CORBA::Boolean flag); // Sets the lite flag + + private: + + TAO_IIOP_Client_Connection_Hanler *handler_; + // The connection service handler used for accessing lower layer + // communication protocols. + TAO_Pluggable_Messaging *client_mesg_factory_; // The message_factor instance specific for this particular // transport protocol. @@ -188,10 +204,21 @@ public: ~TAO_IIOP_Server_Transport (void); // Default destructor + // Please see Pluggable.h for documentation + virtual int idle (void); + + virtual TAO_IIOP_SVC_HANLDER *service_handler (void); + TAO_GIOP_Message_State message_state_; // This keep the state of the current message, to enable // non-blocking reads, fragment reassembly, etc. // @@Bala. Should not be here like this + +private: + + TAO_IIOP_Server_Connection_Hanler *handler_; + // The connection service handler used for accessing lower layer + // communication protocols. }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index c8d2f27f0d0..9fe98d3757b 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -119,7 +119,8 @@ PLUGGABLE_PROTOCOLS_FILES = \ SHMIOP_Connector \ SHMIOP_Acceptor \ SHMIOP_Connect \ - SHMIOP_Endpoint + SHMIOP_Endpoint \ + Connection_Handler PLUGGABLE_MESSAGING_FILES = \ Pluggable_Messaging \ @@ -244,7 +245,10 @@ ORB_CORE_FILES = \ CORBALOC_Parser \ CORBANAME_Parser \ Bind_Dispatcher_Guard \ - Fault_Tolerance_Service + Fault_Tolerance_Service \ + Cache_Entries \ + Base_Connection_Property \ + Connection_Cache_Manager DYNAMIC_ANY_FILES = diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp index 5cd99b64662..2a62fb53be5 100644 --- a/TAO/tao/Pluggable.cpp +++ b/TAO/tao/Pluggable.cpp @@ -253,8 +253,9 @@ TAO_Transport::start_locate (TAO_ORB_Core *, // Connector TAO_Connector::TAO_Connector (CORBA::ULong tag) - : orb_core_ (0), - tag_(tag) + : tag_(tag), + orb_core_ (0) + { } diff --git a/TAO/tao/SHMIOP_Connect.cpp b/TAO/tao/SHMIOP_Connect.cpp index cfe3cad0cc9..3f9bdecbfb0 100644 --- a/TAO/tao/SHMIOP_Connect.cpp +++ b/TAO/tao/SHMIOP_Connect.cpp @@ -56,20 +56,10 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_SHMIOP_Connect_Timeprobe_Description, #endif /* ACE_ENABLE_TIMEPROBES */ -TAO_SHMIOP_Handler_Base::TAO_SHMIOP_Handler_Base (TAO_ORB_Core *orb_core) - : TAO_SHMIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0) -{ -} - -TAO_SHMIOP_Handler_Base::TAO_SHMIOP_Handler_Base (ACE_Thread_Manager *t) - : TAO_SHMIOP_SVC_HANDLER (t, 0, 0) -{ -} - // **************************************************************** TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (ACE_Thread_Manager *t) - : TAO_SHMIOP_Handler_Base (t), + : TAO_SHMIOP_SVC_HANDLEr (t, 0, 0), TAO_Connection_Handler (0), transport_ (this, 0), acceptor_factory_ (0), @@ -86,7 +76,7 @@ TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (ACE_ TAO_SHMIOP_Server_Connection_Handler::TAO_SHMIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core, CORBA::Boolean lite_flag, void *) - : TAO_SHMIOP_Handler_Base (orb_core), + : TAO_SHMIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), transport_ (this, orb_core), acceptor_factory_ (0), @@ -298,7 +288,7 @@ TAO_SHMIOP_Client_Connection_Handler:: TAO_SHMIOP_Client_Connection_Handler (ACE_Thread_Manager *t, TAO_ORB_Core* orb_core, CORBA::Boolean lite_flag) - : TAO_SHMIOP_Handler_Base (t), + : TAO_SHMIOP_SVC_HANDLER (t, 0, 0), TAO_Connection_Handler (orb_core), transport_ (this, orb_core) { diff --git a/TAO/tao/SHMIOP_Connect.h b/TAO/tao/SHMIOP_Connect.h index 77724009d89..82bcabd186e 100644 --- a/TAO/tao/SHMIOP_Connect.h +++ b/TAO/tao/SHMIOP_Connect.h @@ -39,28 +39,20 @@ - typedef ACE_Svc_Handler<ACE_MEM_STREAM, ACE_NULL_SYNCH> TAO_SHMIOP_SVC_HANDLER; -// **************************************************************** - -class TAO_SHMIOP_Handler_Base : public TAO_SHMIOP_SVC_HANDLER -{ -public: - TAO_SHMIOP_Handler_Base (ACE_Thread_Manager *t); - TAO_SHMIOP_Handler_Base (TAO_ORB_Core *orb_core); - virtual TAO_Transport *transport (void) = 0; -}; +// **************************************************************** -class TAO_Export TAO_SHMIOP_Client_Connection_Handler : public TAO_SHMIOP_Handler_Base, +class TAO_Export TAO_SHMIOP_Client_Connection_Handler : public TAO_SHMIOP_SVC_HANDLER public TAO_Connection_Handler { // = TITLE // <Svc_Handler> used on the client side and returned by the // <TAO_CONNECTOR>. public: + // = Intialization method. TAO_SHMIOP_Client_Connection_Handler (ACE_Thread_Manager *t = 0, TAO_ORB_Core* orb_core = 0, @@ -112,7 +104,7 @@ private: // **************************************************************** -class TAO_Export TAO_SHMIOP_Server_Connection_Handler : public TAO_SHMIOP_Handler_Base, +class TAO_Export TAO_SHMIOP_Server_Connection_Handler : public TAO_SHMIOP_SVC_HANDLER public TAO_Connection_Handler { // = TITLE diff --git a/TAO/tao/SHMIOP_Endpoint.cpp b/TAO/tao/SHMIOP_Endpoint.cpp index a43a7c9e3c5..29d6eeeb5d5 100644 --- a/TAO/tao/SHMIOP_Endpoint.cpp +++ b/TAO/tao/SHMIOP_Endpoint.cpp @@ -159,8 +159,12 @@ TAO_SHMIOP_Endpoint::duplicate (void) CORBA::Boolean TAO_SHMIOP_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint) { + TAO_Endpoint *endpt = ACE_const_cast (TAO_Endpoint *, + other_endpoint); + TAO_SHMIOP_Endpoint *endpoint = ACE_dynamic_cast (TAO_SHMIOP_Endpoint *, - other_endpoint); + endpt); + if (endpoint == 0) return 0; diff --git a/TAO/tao/SHMIOP_Transport.cpp b/TAO/tao/SHMIOP_Transport.cpp index 8c69a0568cb..d9fdba71122 100644 --- a/TAO/tao/SHMIOP_Transport.cpp +++ b/TAO/tao/SHMIOP_Transport.cpp @@ -85,7 +85,7 @@ TAO_SHMIOP_Transport::handler (void) int TAO_SHMIOP_Transport::idle (void) { - return this->handler_->idle(); + // return this->handler_->make_idle(); } void @@ -408,7 +408,7 @@ TAO_SHMIOP_Transport::send (TAO_Stub *stub, ssize_t TAO_SHMIOP_Transport::send (const ACE_Message_Block *message_block, const ACE_Time_Value *max_wait_time, - size_t *) + size_t *) { TAO_FUNCTION_PP_TIMEPROBE (TAO_SHMIOP_TRANSPORT_SEND_START); return this->handler_->peer ().send (message_block, diff --git a/TAO/tao/UIOP_Connect.cpp b/TAO/tao/UIOP_Connect.cpp index decb6a37bbb..f29adfeb0eb 100644 --- a/TAO/tao/UIOP_Connect.cpp +++ b/TAO/tao/UIOP_Connect.cpp @@ -60,20 +60,8 @@ ACE_TIMEPROBE_EVENT_DESCRIPTIONS (TAO_UIOP_Connect_Timeprobe_Description, #endif /* ACE_ENABLE_TIMEPROBES */ -TAO_UIOP_Handler_Base::TAO_UIOP_Handler_Base (TAO_ORB_Core *orb_core) - : TAO_UIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0) -{ -} - -TAO_UIOP_Handler_Base::TAO_UIOP_Handler_Base (ACE_Thread_Manager *t) - : TAO_UIOP_SVC_HANDLER (t, 0, 0) -{ -} - -// **************************************************************** - TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thread_Manager *t) - : TAO_UIOP_Handler_Base (t), + : TAO_UIOP_SVC_HANDLER (t, 0, 0), TAO_Connection_Handler (0), transport_ (this, 0), refcount_ (1), @@ -90,7 +78,7 @@ TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (ACE_Thre TAO_UIOP_Server_Connection_Handler::TAO_UIOP_Server_Connection_Handler (TAO_ORB_Core *orb_core, CORBA::Boolean lite_flag, void *arg) - : TAO_UIOP_Handler_Base (orb_core), + : TAO_UIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), TAO_Connection_Handler (orb_core), transport_ (this, orb_core), refcount_ (1), @@ -302,7 +290,7 @@ TAO_UIOP_Client_Connection_Handler (ACE_Thread_Manager *t, TAO_ORB_Core* orb_core, CORBA::Boolean flag, void *arg) - : TAO_UIOP_Handler_Base (t), + : TAO_UIOP_Handler_Base (t, 0, 0), TAO_Connection_Handler (orb_core), transport_ (this, orb_core), uiop_properties_ (ACE_static_cast diff --git a/TAO/tao/UIOP_Connect.h b/TAO/tao/UIOP_Connect.h index e223136d849..acd8a9a2cd5 100644 --- a/TAO/tao/UIOP_Connect.h +++ b/TAO/tao/UIOP_Connect.h @@ -44,28 +44,20 @@ class TAO_Pluggable_Messaging; typedef ACE_Svc_Handler<ACE_LSOCK_STREAM, ACE_NULL_SYNCH> TAO_UIOP_SVC_HANDLER; -class TAO_UIOP_Handler_Base : public TAO_UIOP_SVC_HANDLER +class TAO_UIOP_Properties { -public: - TAO_UIOP_Handler_Base (ACE_Thread_Manager *t); - TAO_UIOP_Handler_Base (TAO_ORB_Core *orb_core); - - virtual TAO_Transport *transport (void) = 0; - - struct UIOP_Properties - { - // = TITLE - // Unix Domain Sockets protocol properties for a set of - // connections. - // - int send_buffer_size; - int recv_buffer_size; - }; + // = TITLE + // Unix Domain Sockets protocol properties for a set of + // connections. + // + int send_buffer_size; + int recv_buffer_size; }; + // **************************************************************** -class TAO_Export TAO_UIOP_Client_Connection_Handler : public TAO_UIOP_Handler_Base, +class TAO_Export TAO_UIOP_Client_Connection_Handler : public TAO_UIOP_SVC_HANDLER, public TAO_Connection_Handler { // = TITLE @@ -123,7 +115,7 @@ protected: TAO_UIOP_Client_Transport transport_; // Reference to the transport object, it is owned by this class. - UIOP_Properties *uiop_properties_; + TAO_UIOP_Properties *uiop_properties_; // UIOP configuration properties for this connection. private: @@ -137,7 +129,7 @@ private: // **************************************************************** -class TAO_Export TAO_UIOP_Server_Connection_Handler : public TAO_UIOP_Handler_Base, +class TAO_Export TAO_UIOP_Server_Connection_Handler : public TAO_UIOP_SVC_HANDLER, public TAO_Connection_Handler { // = TITLE @@ -207,7 +199,7 @@ protected: // you should not delete the svc_handler until the stack unwinds // from the nested upcalls. - UIOP_Properties *uiop_properties_; + TAO_UIOP_Properties *uiop_properties_; // UIOP configuration properties for this connection. }; diff --git a/TAO/tao/UIOP_Connector.cpp b/TAO/tao/UIOP_Connector.cpp index 20920ab86b0..30cc19690f8 100644 --- a/TAO/tao/UIOP_Connector.cpp +++ b/TAO/tao/UIOP_Connector.cpp @@ -464,7 +464,7 @@ TAO_UIOP_Connector::close (void) } int -TAO_UIOP_Connector::connect (TAO_Endpoint *endpoint, +TAO_UIOP_Connector::connect (TAO_Base_Connection_Property *prop, TAO_Transport *& transport, ACE_Time_Value *max_wait_time, CORBA::Environment &) @@ -474,9 +474,12 @@ TAO_UIOP_Connector::connect (TAO_Endpoint *endpoint, ACE_TEXT ("TAO (%P|%t) Connector::connect - ") ACE_TEXT ("looking for UIOP connection.\n"))); + TAO_Endpoint *endpoint = prop->endpoint (); + if (endpoint->tag () != TAO_TAG_UIOP_PROFILE) return -1; + TAO_UIOP_Endpoint *uiop_endpoint = ACE_dynamic_cast (TAO_UIOP_Endpoint *, endpoint); diff --git a/TAO/tao/UIOP_Endpoint.cpp b/TAO/tao/UIOP_Endpoint.cpp index 0b4cde2ca67..eba023473cd 100644 --- a/TAO/tao/UIOP_Endpoint.cpp +++ b/TAO/tao/UIOP_Endpoint.cpp @@ -73,8 +73,11 @@ TAO_UIOP_Endpoint::duplicate (void) CORBA::Boolean TAO_UIOP_Endpoint::is_equivalent (const TAO_Endpoint *other_endpoint) { + TAO_Endpoint *endpt = ACE_const_cast (TAO_Endpoint *, + other_endpoint); + TAO_UIOP_Endpoint *endpoint = ACE_dynamic_cast (TAO_UIOP_Endpoint *, - other_endpoint); + endpt); if (endpoint == 0) return 0; diff --git a/TAO/tao/UIOP_Transport.cpp b/TAO/tao/UIOP_Transport.cpp index ef0f7c2a558..1e9bde7c9a6 100644 --- a/TAO/tao/UIOP_Transport.cpp +++ b/TAO/tao/UIOP_Transport.cpp @@ -87,11 +87,6 @@ TAO_UIOP_Transport::handler (void) return this->handler_; } -int -TAO_UIOP_Transport::idle (void) -{ - return this->handler_->idle (); -} void TAO_UIOP_Transport::close_connection (void) @@ -126,6 +121,18 @@ TAO_UIOP_Server_Transport::~TAO_UIOP_Server_Transport (void) { } +int +TAO_UIOP_Server_Transport::idle (void) +{ + return this->handler_->make_idle (); +} + +TAO_IIOP_SVC_HANLDER * +TAO_UIOP_Server_Transport::service_handler (void) +{ + return this->handler_; +} + // **************************************************************** TAO_UIOP_Client_Transport:: @@ -144,6 +151,11 @@ TAO_UIOP_Client_Transport::~TAO_UIOP_Client_Transport (void) delete this->client_mesg_factory_; } +int +TAO_UIOP_Client_Transport::idle (void) +{ + return this->handler_->make_idle (); +} void TAO_UIOP_Client_Transport::start_request (TAO_ORB_Core * /*orb_core*/, @@ -318,6 +330,11 @@ TAO_UIOP_Client_Transport::register_handler (void) ACE_Event_Handler::READ_MASK); } +TAO_IIOP_SVC_HANLDER * +TAO_UIOP_Client_Transport::service_handler (void) +{ + return this->handler_; +} int TAO_UIOP_Client_Transport:: @@ -419,14 +436,14 @@ TAO_UIOP_Transport::send (TAO_Stub *stub, ssize_t TAO_UIOP_Transport::send (const ACE_Message_Block *message_block, const ACE_Time_Value *max_wait_time, - size_t *bytes_transferred) + size_t *bytes_transferred) { TAO_FUNCTION_PP_TIMEPROBE (TAO_UIOP_TRANSPORT_SEND_START); return ACE::send_n (this->handle (), message_block, max_wait_time, - bytes_transferred); + bytes_transferred); } ssize_t diff --git a/TAO/tao/UIOP_Transport.h b/TAO/tao/UIOP_Transport.h index 0a55c289366..fdd7767dcce 100644 --- a/TAO/tao/UIOP_Transport.h +++ b/TAO/tao/UIOP_Transport.h @@ -65,7 +65,7 @@ public: // = The TAO_Transport methods, please check the documentation in // "tao/Pluggable.h" for more details. virtual void close_connection (void); - virtual int idle (void); + virtual ACE_HANDLE handle (void); virtual ACE_Event_Handler *event_handler (void); virtual ssize_t send (TAO_Stub *stub, @@ -74,7 +74,7 @@ public: const ACE_Time_Value *s = 0); virtual ssize_t send (const ACE_Message_Block *mblk, const ACE_Time_Value *s = 0, - size_t *bytes_transferred = 0); + size_t *bytes_transferred = 0); virtual ssize_t send (const u_char *buf, size_t len, const ACE_Time_Value *s = 0); @@ -94,10 +94,9 @@ public: TAO_OutputCDR &msg); protected: - TAO_UIOP_Handler_Base *handler_; - // the connection service handler used for accessing lower layer - // communication protocols. + TAO_UIOP_SVC_HANDLER *service_handler (void) = 0; + // Acces the underlying connection handler }; class TAO_Export TAO_UIOP_Client_Transport : public TAO_UIOP_Transport @@ -122,6 +121,8 @@ public: // = The TAO_Transport methods, please check the documentation in // "tao/Pluggable.h" for more details. + virtual int idle (void); + virtual void start_request (TAO_ORB_Core *orb_core, TAO_Target_Specification &spec, TAO_OutputCDR &output, @@ -146,6 +147,9 @@ public: // Register the handler with the reactor. This will be called by the // Wait Strategy if Reactor is used for that strategy. + TAO_UIOP_SVC_HANDLER *service_handler (void); + // Access the underlying connection handler + virtual CORBA::Boolean send_request_header (TAO_Operation_Details &opdetail, TAO_Target_Specification &spec, @@ -159,6 +163,11 @@ public: // Set the lite flag private: + + TAO_UIOP_Server_Connection_Handler *handler_; + // The connection service handler used for accessing lower layer + // communication protocols. + TAO_Pluggable_Messaging *client_mesg_factory_; // The message_factor instance specific for this particular // transport protocol. @@ -194,9 +203,22 @@ public: ~TAO_UIOP_Server_Transport (void); // Default destructor + // See Pluggable.h for documentation + virtual int idle (void); + + TAO_UIOP_SVC_HANDLER *service_handler (void); + // Access the underlying connection handler + TAO_GIOP_Message_State message_state_; // This keep the state of the current message, to enable // non-blocking reads, fragment reassembly, etc. + +private: + + TAO_UIOP_Server_Connection_Handler *handler_; + // the connection service handler used for accessing lower layer + // communication protocols. + }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index b91392abe12..88c4d7af062 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -809,7 +809,7 @@ enum MCAST_SERVICEID # if (TAO_HAS_MINIMUM_CORBA == 1) # define TAO_HAS_INTERCEPTORS 0 # else -# define TAO_HAS_INTERCEPTORS 1 +# define TAO_HAS_INTERCEPTORS 0 # endif /* TAO_HAS_MINIMUM_CORBA */ #endif |