diff options
-rw-r--r-- | TAO/ChangeLog | 31 | ||||
-rw-r--r-- | TAO/tao/ClientRequestInfo.cpp | 5 | ||||
-rw-r--r-- | TAO/tao/ClientRequestInfo.h | 7 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.h | 6 | ||||
-rw-r--r-- | TAO/tao/ORB_Table.cpp | 68 | ||||
-rw-r--r-- | TAO/tao/ORB_Table.h | 24 | ||||
-rw-r--r-- | TAO/tao/Transport.cpp | 28 | ||||
-rw-r--r-- | TAO/tao/Transport.h | 12 |
9 files changed, 191 insertions, 4 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 6ef0ba04a99..5083c90dbeb 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,34 @@ +Thu Feb 26 10:10:40 MST 2004 Trevor Fields <fields_t@ociweb.com> + + * tao/ClientRequestInfo.cpp: + * tao/ClientRequestInfo.h: + Added accessor to the invocation object. + + * tao/ORB_Core.cpp: + * tao/ORB_Core.h: + Added set_default and not_default methods for specifying which + orb should be the default and specifying which orb should not be + the default. (Passes calls to the ORB_Table) + + * tao/ORB_Table.cpp: + * tao/ORB_Table.h: + Added set_default and not_default methods for specifying which + orb should be the default (first orb in the table) and specifying + which orb should not be the default. + Changed the bind method to set the new ORB as the default (first in + the table) if the current default ORB does not want to be default. + Added accessor methods for the TAO_ORBCore and the underlying table. + + * tao/Transport.cpp: + * tao/Transport.h: + Added variables for keeping track of the size of the current received + buffer and number of bytes sent for the send call. + Added accessors to these tracking variables. + + + These are changes for working with the OVATION distributed + debugger. + Thu Feb 26 02:48:56 2004 Jeff Parsons <j.parsons@vanderbilt.edu> * TAO_IDL/be/be_visitor_union_branch/cdr_op_ci.cpp: diff --git a/TAO/tao/ClientRequestInfo.cpp b/TAO/tao/ClientRequestInfo.cpp index cac626be970..7f836fd3000 100644 --- a/TAO/tao/ClientRequestInfo.cpp +++ b/TAO/tao/ClientRequestInfo.cpp @@ -275,6 +275,11 @@ TAO_ClientRequestInfo::get_reply_service_context ( ACE_ENV_ARG_PARAMETER); } +TAO_GIOP_Invocation * +TAO_ClientRequestInfo::invocation (void) +{ + return this->invocation_; +} // ------------------------------------------------------------------- diff --git a/TAO/tao/ClientRequestInfo.h b/TAO/tao/ClientRequestInfo.h index 52c87d92402..c50b68601d7 100644 --- a/TAO/tao/ClientRequestInfo.h +++ b/TAO/tao/ClientRequestInfo.h @@ -37,6 +37,7 @@ #include "tao/ORB_Constants.h" class TAO_ClientRequestInfo_i; +class TAO_GIOP_Invocation; /** * @class TAO_ClientRequestInfo @@ -222,6 +223,9 @@ public: /// forwards all method call to. TAO_ClientRequestInfo_i * info (void) const; + /// Accessor to underlying invocation_ + TAO_GIOP_Invocation *invocation (); + private: /// Check if this ClientRequestInfo object is called within the @@ -234,6 +238,9 @@ private: /// ClientRequestInfo functionality. TAO_ClientRequestInfo_i * info_; + /// Pointer to the GIOP invocation object. + TAO_GIOP_Invocation *invocation_; + }; diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index f6cf6875d3d..7e9da784e48 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -2935,6 +2935,20 @@ TAO_ORB_Core::init_ref_map () return &this->init_ref_map_; } +void +TAO_ORB_Core::set_default (const char *orb_id) +{ + TAO_ORB_Table *table = TAO_ORB_Table::instance (); + table->set_default (orb_id); +} + +void +TAO_ORB_Core::not_default (const char *orb_id) +{ + TAO_ORB_Table *table = TAO_ORB_Table::instance (); + table->not_default (orb_id); +} + /// Return the valuetype adapter TAO_Valuetype_Adapter *& TAO_ORB_Core::valuetype_adapter (void) diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index c9843f50fe2..2bd9828d8f6 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -992,7 +992,13 @@ public: /// Return a pointer to the -ORBInitRef map. InitRefMap * init_ref_map (void); + /// Set the ORB related to the orb_id as the default ORB and not the + /// ORB that is first binded in the ORB Table + void set_default (const char *orb_id); + /// Set to choose to be not a default ORB when there are more than + /// one ORB. + void not_default (const char *orb_id); protected: diff --git a/TAO/tao/ORB_Table.cpp b/TAO/tao/ORB_Table.cpp index e1c8d820d8b..a39e2f2bd2c 100644 --- a/TAO/tao/ORB_Table.cpp +++ b/TAO/tao/ORB_Table.cpp @@ -15,8 +15,11 @@ ACE_RCSID (tao, // **************************************************************** TAO_ORB_Table::TAO_ORB_Table (void) - : table_ (TAO_DEFAULT_ORB_TABLE_SIZE), - first_orb_ (0) + : first_orb_not_default_ (0), + table_ (TAO_DEFAULT_ORB_TABLE_SIZE), + first_orb_ (0), + orbs_( 0 ), + num_orbs_( 0 ) { } @@ -48,6 +51,13 @@ TAO_ORB_Table::end (void) return this->table_.end (); } +TAO_ORB_Core* const * +TAO_ORB_Table::get_orbs( size_t& num_orbs ) +{ + num_orbs = this->num_orbs_; + return this->orbs_; +} + int TAO_ORB_Table::bind (const char *orb_id, TAO_ORB_Core *orb_core) @@ -69,8 +79,18 @@ TAO_ORB_Table::bind (const char *orb_id, // reference count on it. (void) orb_core->_incr_refcnt (); - // Only set the "first_orb_" member if the given ORB Core was - // successfully added to the ORB table. + // This is not the first ORB .. but if the current default + // ORB decided not to be the default and there is more than + // one orb then set this orb to be the default ORB. + if ((this->first_orb_ != 0) + && (this->first_orb_not_default_)) + { + this->first_orb_ = orb_core; + this->first_orb_not_default_ = 0; + } + + // Set the "first_orb_" member for the first given ORB Core + // that was successfully added to the ORB table. if (this->first_orb_ == 0) { this->first_orb_ = orb_core; @@ -132,6 +152,46 @@ TAO_ORB_Table::unbind (const char *orb_id) return result; } +void +TAO_ORB_Table::set_default (const char *orb_id) +{ + this->table_.find (orb_id, this->first_orb_); +} + +void +TAO_ORB_Table::not_default (const char *orb_id) +{ + // @@ This method now works for restricted cases. Should work on + // generalizing it. It works if the first ORB that is registered + // decides to not want be the default ORB. Should generalize it to + // handle all cases. + + //check if there is a default ORB already and if + // it is *not* the same as the orb_id thats passed in.. we dont have + // to do anything. + if (this->first_orb_ != 0) + { + if (ACE_OS::strcmp (this->first_orb_->orbid (), orb_id) != 0) + { + // There is another default ORB. No need to change anything + return; + } + else + { + // The ORB with orbid 'orb_id' is the default now. We need + // to change it. + this->first_orb_not_default_ = 1; + } + } +} + +/// Accessor to the underlying table_ +ACE_Hash_Map_Manager_Ex<const char *,TAO_ORB_Core *,ACE_Hash<const char *>,ACE_Equal_To<const char *>,ACE_Null_Mutex> * +TAO_ORB_Table::table (void) +{ + return &this->table_; +} + TAO_ORB_Table * TAO_ORB_Table::instance (void) { diff --git a/TAO/tao/ORB_Table.h b/TAO/tao/ORB_Table.h index a36da894541..1148b06fd3b 100644 --- a/TAO/tao/ORB_Table.h +++ b/TAO/tao/ORB_Table.h @@ -22,6 +22,8 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/corbafwd.h" + #include "ace/Hash_Map_Manager_T.h" #include "tao/TAO_Export.h" @@ -73,6 +75,7 @@ public: int bind (const char *orb_id, TAO_ORB_Core *orb_core); TAO_ORB_Core* find (const char *orb_id); int unbind (const char *orb_id); + TAO_ORB_Core* const * get_orbs( size_t& num_orbs ); //@} /// Obtain the first ORB for the ORB_Core_instance() implementation @@ -81,6 +84,17 @@ public: /// Return a unique instance static TAO_ORB_Table *instance (void); + /// Set the ORB related to the orb_id as the default ORB and not the + /// ORB that is first binded. + void set_default (const char *orb_id); + + /// Method the ORB invokes to specify that it doesnt want to be the + /// default ORB if there are more than one ORB registered. + void not_default (const char *orb_id); + + /// Accessor to the underlying table_ + Table * table (void); + private: /// Prevent copying @@ -89,12 +103,22 @@ private: private: + /// Update our list of orbs + void update_orbs(); + + /// Variable to check if the first ORB decides not to be the default + CORBA::Boolean first_orb_not_default_; + /// The implementation. Table table_; /// The first ORB created by the user TAO_ORB_Core *first_orb_; + /// List of orbs for get_orbs call + TAO_ORB_Core **orbs_; + size_t num_orbs_; + }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Transport.cpp b/TAO/tao/Transport.cpp index 78d9095c07b..7b0a0ce4bc6 100644 --- a/TAO/tao/Transport.cpp +++ b/TAO/tao/Transport.cpp @@ -116,6 +116,8 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag, , handler_lock_ (orb_core->resource_factory ()->create_cached_connection_lock ()) , id_ ((size_t) this) , purging_order_ (0) + , recv_buffer_size_ (0) + , sent_byte_count_ (0) , char_translator_ (0) , wchar_translator_ (0) , tcs_set_ (0) @@ -739,6 +741,9 @@ TAO_Transport::drain_queue_helper (int &iovcnt, iovec iov[]) // no bytes are sent send() can only return 0 or -1 ACE_ASSERT (byte_count != 0); + // Total no. of bytes sent for a send call + this->sent_byte_count_ += byte_count; + if (TAO_debug_level > 4) { ACE_DEBUG ((LM_DEBUG, @@ -762,6 +767,10 @@ TAO_Transport::drain_queue_i (void) // We loop over all the elements in the queue ... TAO_Queued_Message *i = this->head_; + // reset the value so that the counting is done for each new send + // call. + this->sent_byte_count_ = 0; + while (i != 0) { // ... each element fills the iovector ... @@ -1197,6 +1206,13 @@ TAO_Transport::handle_input (TAO_Resume_Handle &rh, this->messaging_object ()->header_length (); } + // Saving the size of the received buffer in case any one needs to + // get the size of the message thats received in the + // context. Obviously the value will be changed for each recv call + // and the user is supposed to invoke the accessor only in the + // invocation context to get meaningful information. + this->recv_buffer_size_ = recv_size; + // Read the message into the message block that we have created on // the stack. ssize_t n = this->recv (message_block.rd_ptr (), @@ -1995,6 +2011,18 @@ TAO_Transport::transport_cache_manager (void) return this->orb_core_->lane_resources ().transport_cache (); } +size_t +TAO_Transport::recv_buffer_size (void) +{ + return this->recv_buffer_size_; +} + +size_t +TAO_Transport::sent_byte_count (void) +{ + return this->sent_byte_count_; +} + void TAO_Transport::assign_translators (TAO_InputCDR *inp, TAO_OutputCDR *outp) { diff --git a/TAO/tao/Transport.h b/TAO/tao/Transport.h index b6059b211fe..1542bf15a3f 100644 --- a/TAO/tao/Transport.h +++ b/TAO/tao/Transport.h @@ -669,6 +669,12 @@ public: int handle_timeout (const ACE_Time_Value ¤t_time, const void* act); + /// Accessor to recv_buffer_size_ + size_t recv_buffer_size (void); + + /// Accessor to sent_byte_count_ + size_t sent_byte_count (void); + /// CodeSet Negotiation - Get the char codeset translator factory /// TAO_Codeset_Translator_Factory *char_translator (void) const; @@ -893,6 +899,12 @@ protected: /// Used by the LRU, LFU and FIFO Connection Purging Strategies. unsigned long purging_order_; + /// Size of the buffer received. + size_t recv_buffer_size_; + + /// Number of bytes sent. + size_t sent_byte_count_; + private: /// @@Phil, I think it would be nice if we could think of a way to |