diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-02-23 03:22:02 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-02-23 03:22:02 +0000 |
commit | 85332704ca1027eec4889c0ef45e76074932a85a (patch) | |
tree | 3157a199b7c15204a350974091bcf6ff4bb55c5d | |
parent | e563be18a0bcfe1304f74f94d30c14f68a6174cc (diff) | |
download | ATCD-85332704ca1027eec4889c0ef45e76074932a85a.tar.gz |
ChangeLogTag: Sat Feb 22 22:30:25 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu>
-rw-r--r-- | TAO/tao/ChangeLog | 161 | ||||
-rw-r--r-- | TAO/tao/ClientRequestInfo_i.cpp | 14 | ||||
-rw-r--r-- | TAO/tao/Client_Strategy_Factory.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Client_Strategy_Factory.h | 3 | ||||
-rw-r--r-- | TAO/tao/IIOP_Endpoint.h | 4 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.cpp | 94 | ||||
-rw-r--r-- | TAO/tao/IIOP_Profile.h | 18 | ||||
-rw-r--r-- | TAO/tao/Invocation.cpp | 16 | ||||
-rw-r--r-- | TAO/tao/Profile.cpp | 158 | ||||
-rw-r--r-- | TAO/tao/Profile.h | 41 | ||||
-rw-r--r-- | TAO/tao/Profile.i | 40 | ||||
-rw-r--r-- | TAO/tao/Strategies/DIOP_Endpoint.h | 7 | ||||
-rw-r--r-- | TAO/tao/Strategies/DIOP_Profile.cpp | 72 | ||||
-rw-r--r-- | TAO/tao/Strategies/DIOP_Profile.h | 14 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Connector.cpp | 9 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Endpoint.h | 4 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Profile.cpp | 72 | ||||
-rw-r--r-- | TAO/tao/Strategies/SHMIOP_Profile.h | 10 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Profile.cpp | 96 | ||||
-rw-r--r-- | TAO/tao/Strategies/UIOP_Profile.h | 10 | ||||
-rw-r--r-- | TAO/tao/Stub.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/Tagged_Components.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/default_client.cpp | 19 | ||||
-rw-r--r-- | TAO/tao/default_client.h | 4 |
24 files changed, 449 insertions, 432 deletions
diff --git a/TAO/tao/ChangeLog b/TAO/tao/ChangeLog new file mode 100644 index 00000000000..f768ffee42b --- /dev/null +++ b/TAO/tao/ChangeLog @@ -0,0 +1,161 @@ +Sat Feb 22 22:30:25 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * Merged with the main trunk. + +Thu Feb 20 12:48:16 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * ace/Connector.cpp: Added a const to regulate the size of the map + that is being used inside this class. A size of 1024 seems too + excessive for runtime memory. + +Thu Feb 20 12:29:17 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * tao/Profile.h: + * tao/Profile.cpp: + * tao/Profile.i: Moved the ObjectKey from the inherited classes + to the base class. Added a new protected constructor which can + be used by the inherited classes to initialize the ObjectKey + properly. Also added a new method set_tagged_components () which + is a helper method useful for creating Tagged_Components of an + IOR from a CDR stream. Uninlined the constructor, destructor and + the methods for refcounted memory management. + + * tao/IIOP_Profile.h: + * tao/IIOP_Profile.cpp: + * tao/Strategies/DIOP_Profile.h: + * tao/Strategies/DIOP_Profile.cpp: + * tao/Strategies/UIOP_Profile.h: + * tao/Strategies/UIOP_Profile.cpp: + * tao/Strategies/SHMIOP_Profile.h: + * tao/Strategies/SHMIOP_Profile.cpp: Removed the ObjectKey from + the following classes since it has now been moved to the base + class. + + Used the protected constructor in the base class while base + member initializations. + + Call the set_tagged_componets () to place a list of + IIOPEndpoints in the Tagged_Components contained in the profile. + +Thu Feb 20 12:10:13 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * tao/Tagged_Components.h: + * tao/Tagged_Components.cpp: + * tao/Tagged_Components.i (TAO_Tagged_Components): Reverted the + change "Wed Feb 12 15:40:46 2003 Balachandran Natarajan + <bala@isis-server.isis.vanderbilt.edu>" since it was counter + productive. + + * tao/ClientRequestInfo_i.cpp: Reverted the changes made to + accomodatethe above change. + +Thu Feb 13 17:53:44 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * tao/IIOP_Endpoint.h (TAO_IIOP_Endpoint): + * tao/IIOP_Profile.h: + * tao/Strategies/DIOP_Endpoint.h: + * tao/Strategies/SHMIOP_Endpoint.h: Cosmetic changes like removing + ORB.h inclusion etc. + +Wed Feb 12 18:15:24 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * Merged in changes from the main trunk. + +Wed Feb 12 15:40:46 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * tao/Tagged_Components.h: + * tao/Tagged_Components.cpp: + * tao/Tagged_Components.i (TAO_Tagged_Components): Create + IOP::MultipleComponentProfile lazily, instead of creating + actively on the stack and increase the runtime footprint. If we + do this we only pay when TAO gets something that TAO doesnt + understand. This changed forced us to change the signature of + the components (). Instead of returning a reference we now + return a pointer to the underlying + IOP::MultipleComponentProfile. + +Thu Feb 6 17:51:06 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * tao/Tagged_Components.cpp: Removed some vague print statements. + * tao/Strategies/SHMIOP_Connector.cpp: Fixed some debug + statements. + +Thu Feb 6 16:37:32 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * tao/Stub.cpp (ior_info_): + * tao/Invocation.cpp: + * tao/ClientRequestInfo_i.cpp: Added error checks to the last + checkins. + +Sun Jan 26 23:50:17 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * tao/Profile.cpp: + * tao/Profile.h: + * tao/Profile.i: Added a new method create_tagged_profile + (). Infact, this method existed in the derived classes returning + a reference to the underlying IOP::TaggedProfile. Since the + method existed in all the derived classes and was doing similar + things it has now been moved to the base class with a slight + signature change. This now returns a pointer to the underlying + IOP:TaggedProfile. The signatuer change has been needed because + of the change mentioned below. + + We will henceforth hold a pointer to the IOP::TaggedProfile + instead of an instance in the Profile classes. We will create an + instance when needed, (heard of lazy evaluation?). This change + is forced on us due to the runtime memory consumed by + IOR's. Holding a pointer instead of the actual object instance + gets us approximately 24 bytes per IOR on Linux on a 32 bit + processor. + + * tao/IIOP_Profile.h: + * tao/IIOP_Profile.cpp: + * tao/Strategies/UIOP_Profile.cpp: + * tao/Strategies/UIOP_Profile.h: + * tao/Strategies/SHMIOP_Profile.cpp: + * tao/Strategies/SHMIOP_Profile.h: + * tao/Strategies/DIOP_Profile.cpp: + * tao/Strategies/DIOP_Profile.h: Removed create_tagged_profile () + and the instance of IOP::TaggedProfile. + + * tao/Invocation.cpp: + * tao/Stub.cpp: + * tao/ClientRequestInfo_i.cpp: Changes forced on us due to the + signature change above. + +Sun Jan 26 21:41:26 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * Mering with the main trunk and moving to a new branch. + +Sun Jan 26 21:16:14 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + * docs/Options.html: documented the new option. + +Mon Jan 20 09:00:55 2003 Balachandran Natarajan <bala@isis-server.isis.vanderbilt.edu> + + The aim of this checkin is to provide an option to configure the + size of the dispatcher table in the Muxed_Transport_Strategy. + + * tao/Client_Strategy_Factory.cpp: + * tao/Client_Strategy_Factory.h: Added a new virtual method to + fetch the dispatcher table size + + * tao/default_client.cpp: + * tao/default_client.h: Concrete implementation for the new + virtual method. The default value for the dispatcher table size + is set to TAO_RD_TABLE_SIZE which is defined in orbconf.h. The + table size can also be changed at runtime using a -ORB option + which is explained below. + + We now have an option called -ORBReplyDispatcherTableSize which + will parse and set a user provided value as the dispatcher table + size. This gives extra flexibility to the user. + + * tao/orbconf.h: Added TAO_RD_TABLE_SIZE and set the value to be + 16. + + * tao/Muxed_TMS.cpp: + * tao/Muxed_TMS.h: All the above changes were motivated to reduce + the size of the hash table that this class creates increasing + the run-time footprint. The default value of 1024 was probably + an over kill for this class. diff --git a/TAO/tao/ClientRequestInfo_i.cpp b/TAO/tao/ClientRequestInfo_i.cpp index e1e2e2d6084..339eab82b79 100644 --- a/TAO/tao/ClientRequestInfo_i.cpp +++ b/TAO/tao/ClientRequestInfo_i.cpp @@ -129,11 +129,19 @@ TAO_ClientRequestInfo_i::effective_profile (ACE_ENV_SINGLE_ARG_DECL) IOP::TaggedProfile_var safe_tagged_profile = tagged_profile; - IOP::TaggedProfile &ep = + IOP::TaggedProfile *ep = this->target_->_stubobj ()->profile_in_use ()->create_tagged_profile (); - tagged_profile->tag = ep.tag; - tagged_profile->profile_data = ep.profile_data; // Deep copy + if (ep == 0) + { + ACE_THROW_RETURN (CORBA::BAD_PARAM (CORBA::OMGVMCID | 28, + CORBA::COMPLETED_NO), + 0); + } + + // @@BAD_PARAM exception + tagged_profile->tag = ep->tag; + tagged_profile->profile_data = ep->profile_data; // Deep copy return safe_tagged_profile._retn (); } diff --git a/TAO/tao/Client_Strategy_Factory.cpp b/TAO/tao/Client_Strategy_Factory.cpp index ce49a810f50..9aa411b72a8 100644 --- a/TAO/tao/Client_Strategy_Factory.cpp +++ b/TAO/tao/Client_Strategy_Factory.cpp @@ -24,6 +24,12 @@ TAO_Client_Strategy_Factory::create_transport_mux_strategy (TAO_Transport *) return 0; } +int +TAO_Client_Strategy_Factory::reply_dispatcher_table_size (void) const +{ + return 0; +} + TAO_Wait_Strategy * TAO_Client_Strategy_Factory::create_wait_strategy (TAO_Transport *) { diff --git a/TAO/tao/Client_Strategy_Factory.h b/TAO/tao/Client_Strategy_Factory.h index 98d0aac6dac..cf1da78ab6d 100644 --- a/TAO/tao/Client_Strategy_Factory.h +++ b/TAO/tao/Client_Strategy_Factory.h @@ -56,6 +56,9 @@ public: /// Create the correct client request muxing strategy. virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); + /// Return the size of the reply dispatcher table + virtual int reply_dispatcher_table_size (void) const; + /// Create the correct client <wait_for_reply> strategy. virtual TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); diff --git a/TAO/tao/IIOP_Endpoint.h b/TAO/tao/IIOP_Endpoint.h index 7cebcd2cde7..84120ce23f2 100644 --- a/TAO/tao/IIOP_Endpoint.h +++ b/TAO/tao/IIOP_Endpoint.h @@ -25,7 +25,6 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/CORBA_String.h" - #include "ace/INET_Addr.h" @@ -105,9 +104,6 @@ public: /// Set the port number. CORBA::UShort port (CORBA::UShort p); - /// - //TAO_IIOP_Connection_Handler *&hint (void); - private: /// Helper method for setting INET_Addr. diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 9f2385ee76c..4b05a02f9d3 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - #include "IIOP_Profile.h" #include "CDR.h" #include "Environment.h" @@ -34,12 +33,13 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const ACE_INET_Addr &addr, const TAO_ObjectKey &object_key, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (IOP::TAG_INTERNET_IOP, orb_core, version), + : TAO_Profile (IOP::TAG_INTERNET_IOP, + orb_core, + object_key, + version), endpoint_ (addr, orb_core->orb_params ()->use_dotted_decimal_addresses ()), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -49,11 +49,12 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const char* host, const ACE_INET_Addr &addr, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (IOP::TAG_INTERNET_IOP, orb_core, version), + : TAO_Profile (IOP::TAG_INTERNET_IOP, + orb_core, + object_key, + version), endpoint_ (host, port, addr), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -62,9 +63,7 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (TAO_ORB_Core *orb_core) orb_core, TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)), endpoint_ (), - count_ (1), - object_key_ (), - tagged_profile_ () + count_ (1) { } @@ -449,56 +448,6 @@ TAO_IIOP_Profile::encode (TAO_OutputCDR &stream) const return 1; } - -IOP::TaggedProfile & -TAO_IIOP_Profile::create_tagged_profile (void) -{ - // Check whether we have already created the TaggedProfile - if (this->tagged_profile_.profile_data.get_buffer () == 0) - { - // As we have not created we will now create the TaggedProfile - this->tagged_profile_.tag = IOP::TAG_INTERNET_IOP; - - // Create the encapsulation.... - TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE, - TAO_ENCAP_BYTE_ORDER, - this->orb_core ()->output_cdr_buffer_allocator (), - this->orb_core ()->output_cdr_dblock_allocator (), - this->orb_core ()->output_cdr_msgblock_allocator (), - this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (), - TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR, - this->orb_core ()->to_iso8859 (), - this->orb_core ()->to_unicode ()); - - // Create the profile body - this->create_profile_body (encap); - - CORBA::ULong length = - ACE_static_cast(CORBA::ULong,encap.total_length ()); - -#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) - // Place the message block in to the Sequence of Octets that we - // have - this->tagged_profile_.profile_data.replace (length, - encap.begin ()); -#else - this->tagged_profile_.profile_data.length (length); - CORBA::Octet *buffer = - this->tagged_profile_.profile_data.get_buffer (); - for (const ACE_Message_Block *i = encap.begin (); - i != encap.end (); - i = i->next ()) - { - ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ()); - buffer += i->length (); - } -#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ - } - - return this->tagged_profile_; -} - void TAO_IIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const { @@ -553,27 +502,8 @@ TAO_IIOP_Profile::encode_endpoints (void) == 0) || (out_cdr << endpoints) == 0) return -1; - CORBA::ULong length = out_cdr.total_length (); - - IOP::TaggedComponent tagged_component; - tagged_component.tag = TAO_TAG_ENDPOINTS; - tagged_component.component_data.length (length); - CORBA::Octet *buf = - tagged_component.component_data.get_buffer (); - - for (const ACE_Message_Block *iterator = out_cdr.begin (); - iterator != 0; - iterator = iterator->cont ()) - { - CORBA::ULong i_length = iterator->length (); - ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length); - - buf += i_length; - } - // Add component with encoded endpoint data to this profile's - // TaggedComponents. - tagged_components_.set_component (tagged_component); + this->set_tagged_components (out_cdr); return 0; } diff --git a/TAO/tao/IIOP_Profile.h b/TAO/tao/IIOP_Profile.h index 8b55bead27f..1612397d97b 100644 --- a/TAO/tao/IIOP_Profile.h +++ b/TAO/tao/IIOP_Profile.h @@ -23,12 +23,8 @@ #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Object_KeyC.h" #include "tao/IIOP_Endpoint.h" -#include "ace/Synch.h" - // TAO IIOP_Profile concrete Profile definitions /** @@ -142,14 +138,10 @@ public: virtual CORBA::ULong hash (CORBA::ULong max ACE_ENV_ARG_DECL); - /// Please refer to Profile.h for the documentation of this - /// function. - virtual IOP::TaggedProfile &create_tagged_profile (void); - private: /// Creates an encapsulation of the ProfileBody struct in the <cdr> - void create_profile_body (TAO_OutputCDR &cdr) const; + virtual void create_profile_body (TAO_OutputCDR &cdr) const; /** * Helper for <decode>. Decodes endpoints from a tagged component. @@ -181,14 +173,6 @@ protected: /// Number of endpoints in the list headed by <endpoint_>. size_t count_; - -private: - - /// object_key associated with this profile. - TAO_ObjectKey object_key_; - - /// Our tagged profile - IOP::TaggedProfile tagged_profile_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index f1c3531f4c2..ef33b984083 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -1,6 +1,5 @@ // $Id$ - - +` #include "Invocation.h" #include "Stub.h" #include "Profile.h" @@ -345,6 +344,7 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags ACE_ENV_ARG_PARAMETER); ACE_CHECK; + // Set the target specification mode switch (this->profile_->addressing_mode ()) { @@ -354,10 +354,14 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags break; case TAO_Target_Specification::Profile_Addr: - this->target_spec_.target_specifier ( - this->profile_->create_tagged_profile () - ); - break; + { + IOP::TaggedProfile *tp = + this->profile_->create_tagged_profile (); + + if (tp) + this->target_spec_.target_specifier (*tp); + } + break; case TAO_Target_Specification::Reference_Addr: // We need to call the method seperately. If there is no diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp index 2860a202041..69fca105a7a 100644 --- a/TAO/tao/Profile.cpp +++ b/TAO/tao/Profile.cpp @@ -1,28 +1,84 @@ // $Id$ - #include "Profile.h" #include "Object_KeyC.h" - #include "Messaging_PolicyValueC.h" #include "Stub.h" #include "debug.h" -#include "tao/target_specification.h" +#include "target_specification.h" #if !defined (__ACE_INLINE__) #include "Profile.i" #endif /* __ACE_INLINE__ */ - ACE_RCSID (tao, Profile, "$Id$") - // **************************************************************** +TAO_Profile::TAO_Profile (CORBA::ULong tag, + TAO_ORB_Core *orb_core, + const TAO_ObjectKey &obj_key, + const TAO_GIOP_Message_Version &version) + : version_ (version) + , are_policies_parsed_ (0) + , stub_ (0) + , policy_list_ (0) + , addressing_mode_ (0) + , tagged_profile_ (0) + , object_key_ (obj_key) + , tag_ (tag) + , orb_core_ (orb_core) + , forward_to_ (0) + , refcount_ (1) +{ +} + +TAO_Profile::TAO_Profile (CORBA::ULong tag, + TAO_ORB_Core *orb_core, + const TAO_GIOP_Message_Version &version) + : version_ (version) + , are_policies_parsed_ (0) + , stub_ (0) + , policy_list_ (0) + , addressing_mode_ (0) + , tagged_profile_ (0) + , object_key_ () + , tag_ (tag) + , orb_core_ (orb_core) + , forward_to_ (0) + , refcount_ (1) +{ +} TAO_Profile::~TAO_Profile (void) { + if (this->tagged_profile_) + delete this->tagged_profile_; +} + +CORBA::ULong +TAO_Profile::_incr_refcnt (void) +{ + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->refcount_lock_, 0); + + return this->refcount_++; +} + +CORBA::ULong +TAO_Profile::_decr_refcnt (void) +{ + { + ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->refcount_lock_, 0); + this->refcount_--; + if (this->refcount_ != 0) + return this->refcount_; + } + + // refcount is 0, so delete us! + // delete will call our ~ destructor which in turn deletes stuff. + delete this; + return 0; } void @@ -45,6 +101,84 @@ TAO_Profile::add_tagged_component (const IOP::TaggedComponent &component this->tagged_components_.set_component (component); } +IOP::TaggedProfile * +TAO_Profile::create_tagged_profile (void) +{ + if (this->tagged_profile_ == 0) + { + ACE_NEW_RETURN (this->tagged_profile_, + IOP::TaggedProfile, + 0); + + // As we have not created we will now create the TaggedProfile + this->tagged_profile_->tag = this->tag_; + + // Create the encapsulation.... + TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE, + TAO_ENCAP_BYTE_ORDER, + this->orb_core ()->output_cdr_buffer_allocator (), + this->orb_core ()->output_cdr_dblock_allocator (), + this->orb_core ()->output_cdr_msgblock_allocator (), + this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (), + TAO_DEF_GIOP_MAJOR, + TAO_DEF_GIOP_MINOR, + this->orb_core ()->to_iso8859 (), + this->orb_core ()->to_unicode ()); + + // Create the profile body + this->create_profile_body (encap); + + CORBA::ULong length = + ACE_static_cast(CORBA::ULong,encap.total_length ()); + +#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) + // Place the message block in to the Sequence of Octets that we + // have + this->tagged_profile_->profile_data.replace (length, + encap.begin ()); +#else + this->tagged_profile_->profile_data.length (length); + CORBA::Octet *buffer = + this->tagged_profile_.profile_data.get_buffer (); + for (const ACE_Message_Block *i = encap.begin (); + i != encap.end (); + i = i->next ()) + { + ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ()); + buffer += i->length (); + } +#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ + } + + return this->tagged_profile_; +} + +void +TAO_Profile::set_tagged_components (TAO_OutputCDR &out_cdr) +{ + CORBA::ULong length = out_cdr.total_length (); + + IOP::TaggedComponent tagged_component; + tagged_component.tag = TAO_TAG_ENDPOINTS; + tagged_component.component_data.length (length); + CORBA::Octet *buf = + tagged_component.component_data.get_buffer (); + + for (const ACE_Message_Block *iterator = out_cdr.begin (); + iterator != 0; + iterator = iterator->cont ()) + { + CORBA::ULong i_length = iterator->length (); + ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length); + + buf += i_length; + } + + // Add component with encoded endpoint data to this profile's + // TaggedComponents. + tagged_components_.set_component (tagged_component); +} + void TAO_Profile::policies (CORBA::PolicyList *policy_list ACE_ENV_ARG_DECL) @@ -358,8 +492,7 @@ TAO_Unknown_Profile::TAO_Unknown_Profile (CORBA::ULong tag, : TAO_Profile (tag, orb_core, TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR)), - tagged_profile_ () + TAO_DEF_GIOP_MINOR)) { } @@ -451,12 +584,9 @@ TAO_Unknown_Profile::hash (CORBA::ULong max this->body_.length ()) % max); } -IOP::TaggedProfile& -TAO_Unknown_Profile::create_tagged_profile (void) +void +TAO_Unknown_Profile::create_profile_body (TAO_OutputCDR &) const { - this->tagged_profile_.tag = this->tag (); - - // I dont know about the rest, so we return our copy - return this->tagged_profile_; - + // No idea about the profile body! Just return + return; } diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h index a1fb45772ba..8fdab0af3bd 100644 --- a/TAO/tao/Profile.h +++ b/TAO/tao/Profile.h @@ -13,16 +13,16 @@ #ifndef TAO_PROFILE_H #define TAO_PROFILE_H #include "ace/pre.h" - -#include "corbafwd.h" +#include "tao/Tagged_Components.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "Tagged_Components.h" -#include "PolicyC.h" -#include "GIOP_Message_Version.h" +// @@ This include needs to go after Ossama's checkin +#include "tao/PolicyC.h" +#include "tao/GIOP_Message_Version.h" +#include "tao/Object_KeyC.h" class TAO_MProfile; class TAO_Stub; @@ -142,7 +142,7 @@ public: * return the reference to that. This method is necessary for GIOP * 1.2. */ - virtual IOP::TaggedProfile &create_tagged_profile (void) = 0; + IOP::TaggedProfile *create_tagged_profile (void); /// This method sets the client exposed policies, i.e., the ones /// propagated in the IOR, for this profile. @@ -197,6 +197,21 @@ public: */ CORBA::Short addressing_mode (void) const; +protected: + + /// To be used by inherited classes + TAO_Profile (CORBA::ULong tag, + TAO_ORB_Core *orb_core, + const TAO_ObjectKey &key, + const TAO_GIOP_Message_Version &version); + + /// Creates an encapsulation of the ProfileBody struct in the <cdr> + virtual void create_profile_body (TAO_OutputCDR &cdr) const = 0; + + /// Helper method that encodes the endpoints for RTCORBA as + /// tagged_components. + void set_tagged_components (TAO_OutputCDR &cdr); + private: /// this object keeps ownership of this object @@ -214,6 +229,7 @@ private: ACE_UNIMPLEMENTED_FUNC (TAO_Profile (const TAO_Profile&)) ACE_UNIMPLEMENTED_FUNC (void operator= (const TAO_Profile&)) + protected: /// IIOP version number. @@ -243,8 +259,13 @@ protected: /// exception. CORBA::Short addressing_mode_; -private: + /// Our tagged profile + IOP::TaggedProfile *tagged_profile_; + + /// object_key associated with this profile. + TAO_ObjectKey object_key_; +private: /// IOP protocol tag. CORBA::ULong tag_; @@ -260,7 +281,6 @@ private: /// Number of outstanding references to this object. CORBA::ULong refcount_; - }; /** @@ -298,11 +318,12 @@ public: virtual CORBA::Boolean is_equivalent (const TAO_Profile* other_profile); virtual CORBA::ULong hash (CORBA::ULong max ACE_ENV_ARG_DECL); - virtual IOP::TaggedProfile &create_tagged_profile (void); +private: + + virtual void create_profile_body (TAO_OutputCDR &encap) const; private: TAO_opaque body_; - IOP::TaggedProfile tagged_profile_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Profile.i b/TAO/tao/Profile.i index 0faa4decde2..e1ede5cbfaa 100644 --- a/TAO/tao/Profile.i +++ b/TAO/tao/Profile.i @@ -1,22 +1,6 @@ // -*- C++ -*- // $Id$ -ACE_INLINE -TAO_Profile::TAO_Profile (CORBA::ULong tag, - TAO_ORB_Core *orb_core, - const TAO_GIOP_Message_Version &version) - : version_ (version), - are_policies_parsed_ (0), - stub_ (0), - policy_list_ (0), - addressing_mode_ (0), - tag_ (tag), - orb_core_ (orb_core), - forward_to_ (0), - refcount_ (1) -{ -} - ACE_INLINE CORBA::ULong TAO_Profile::tag (void) const { @@ -35,30 +19,6 @@ TAO_Profile::orb_core (void) const return this->orb_core_; } -ACE_INLINE CORBA::ULong -TAO_Profile::_incr_refcnt (void) -{ - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, guard, this->refcount_lock_, 0); - - return this->refcount_++; -} - -ACE_INLINE CORBA::ULong -TAO_Profile::_decr_refcnt (void) -{ - { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->refcount_lock_, 0); - this->refcount_--; - if (this->refcount_ != 0) - return this->refcount_; - } - - // refcount is 0, so delete us! - // delete() will call our destructor which in turn deletes stuff. - delete this; - return 0; -} - ACE_INLINE void TAO_Profile::forward_to (TAO_MProfile *mprofiles) { diff --git a/TAO/tao/Strategies/DIOP_Endpoint.h b/TAO/tao/Strategies/DIOP_Endpoint.h index c9f95f0eedb..123ff403378 100644 --- a/TAO/tao/Strategies/DIOP_Endpoint.h +++ b/TAO/tao/Strategies/DIOP_Endpoint.h @@ -17,18 +17,17 @@ #ifndef TAO_DIOP_ENDPOINT_H #define TAO_DIOP_ENDPOINT_H #include "ace/pre.h" +#include "tao/Endpoint.h" -#include "tao/corbafwd.h" #if defined (TAO_HAS_DIOP) && (TAO_HAS_DIOP != 0) -#include "tao/Endpoint.h" + #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/ORB.h" +#include "tao/CORBA_String.h" #include "ace/INET_Addr.h" #include "strategies_export.h" diff --git a/TAO/tao/Strategies/DIOP_Profile.cpp b/TAO/tao/Strategies/DIOP_Profile.cpp index 27c3457526f..8e1cdfdefb3 100644 --- a/TAO/tao/Strategies/DIOP_Profile.cpp +++ b/TAO/tao/Strategies/DIOP_Profile.cpp @@ -36,12 +36,13 @@ TAO_DIOP_Profile::TAO_DIOP_Profile (const ACE_INET_Addr &addr, const TAO_ObjectKey &object_key, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (TAO_TAG_UDP_PROFILE, orb_core, version), + : TAO_Profile (TAO_TAG_UDP_PROFILE, + orb_core, + object_key, + version), endpoint_ (addr, orb_core->orb_params ()->use_dotted_decimal_addresses ()), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -51,11 +52,12 @@ TAO_DIOP_Profile::TAO_DIOP_Profile (const char* host, const ACE_INET_Addr &addr, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (TAO_TAG_UDP_PROFILE, orb_core, version), + : TAO_Profile (TAO_TAG_UDP_PROFILE, + orb_core, + object_key, + version), endpoint_ (host, port, addr), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -64,9 +66,7 @@ TAO_DIOP_Profile::TAO_DIOP_Profile (TAO_ORB_Core *orb_core) orb_core, TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)), endpoint_ (), - count_ (1), - object_key_ (), - tagged_profile_ () + count_ (1) { } @@ -447,56 +447,6 @@ TAO_DIOP_Profile::encode (TAO_OutputCDR &stream) const return 1; } - -IOP::TaggedProfile & -TAO_DIOP_Profile::create_tagged_profile (void) -{ - // Check whether we have already created the TaggedProfile - if (this->tagged_profile_.profile_data.get_buffer () == 0) - { - // As we have not created we will now create the TaggedProfile - this->tagged_profile_.tag = TAO_TAG_UDP_PROFILE; - - // Create the encapsulation.... - TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE, - TAO_ENCAP_BYTE_ORDER, - this->orb_core ()->output_cdr_buffer_allocator (), - this->orb_core ()->output_cdr_dblock_allocator (), - this->orb_core ()->output_cdr_msgblock_allocator (), - this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (), - TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR, - this->orb_core ()->to_iso8859 (), - this->orb_core ()->to_unicode ()); - - // Create the profile body - this->create_profile_body (encap); - - CORBA::ULong length = - ACE_static_cast(CORBA::ULong,encap.total_length ()); - -#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) - // Place the message block in to the Sequence of Octets that we - // have - this->tagged_profile_.profile_data.replace (length, - encap.begin ()); -#else - this->tagged_profile_.profile_data.length (length); - CORBA::Octet *buffer = - this->tagged_profile_.profile_data.get_buffer (); - for (const ACE_Message_Block *i = encap.begin (); - i != encap.end (); - i = i->next ()) - { - ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ()); - buffer += i->length (); - } -#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1 */ - } - - return this->tagged_profile_; -} - void TAO_DIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const { diff --git a/TAO/tao/Strategies/DIOP_Profile.h b/TAO/tao/Strategies/DIOP_Profile.h index 0a1263c8d51..e65c3728be7 100644 --- a/TAO/tao/Strategies/DIOP_Profile.h +++ b/TAO/tao/Strategies/DIOP_Profile.h @@ -27,8 +27,6 @@ #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/Object_KeyC.h" #include "DIOP_Endpoint.h" #include "ace/Synch.h" @@ -147,10 +145,6 @@ public: virtual CORBA::ULong hash (CORBA::ULong max ACE_ENV_ARG_DECL); - /// Please refer to Profile.h for the documentation of this - /// function. - virtual IOP::TaggedProfile &create_tagged_profile (void); - private: /// Creates an encapsulation of the ProfileBody struct in the <cdr> @@ -186,14 +180,6 @@ protected: /// Number of endpoints in the list headed by <endpoint_>. size_t count_; - -private: - - /// Object_key associated with this profile. - TAO_ObjectKey object_key_; - - /// Our tagged profile - IOP::TaggedProfile tagged_profile_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Strategies/SHMIOP_Connector.cpp b/TAO/tao/Strategies/SHMIOP_Connector.cpp index e600a1b1636..4a4d28a04c4 100644 --- a/TAO/tao/Strategies/SHMIOP_Connector.cpp +++ b/TAO/tao/Strategies/SHMIOP_Connector.cpp @@ -214,19 +214,16 @@ TAO_SHMIOP_Connector::make_connection (TAO_GIOP_Invocation *invocation, if (result == -1) { - char buffer [MAXNAMELEN * 2]; - desc->endpoint ()->addr_to_string (buffer, - (MAXNAMELEN * 2) - 1); - // Give users a clue to the problem. if (TAO_debug_level > 0) { ACE_DEBUG ((LM_ERROR, ACE_TEXT ("(%P|%t) %s:%u, connection to ") - ACE_TEXT ("%s failed (%p)\n"), + ACE_TEXT ("<%s:%p> failed (%p)\n"), __FILE__, __LINE__, - buffer, + shmiop_endpoint->host (), + shmiop_endpoint->port (), ACE_TEXT ("errno"))); } diff --git a/TAO/tao/Strategies/SHMIOP_Endpoint.h b/TAO/tao/Strategies/SHMIOP_Endpoint.h index efdf29708d6..9c6035d1242 100644 --- a/TAO/tao/Strategies/SHMIOP_Endpoint.h +++ b/TAO/tao/Strategies/SHMIOP_Endpoint.h @@ -24,11 +24,9 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #if defined (TAO_HAS_SHMIOP) && (TAO_HAS_SHMIOP != 0) - +#include "tao/CORBA_String.h" #include "strategies_export.h" -#include "tao/ORB.h" - #include "ace/INET_Addr.h" #include "ace/MEM_Addr.h" diff --git a/TAO/tao/Strategies/SHMIOP_Profile.cpp b/TAO/tao/Strategies/SHMIOP_Profile.cpp index dd0cca3adec..80aa1a02892 100644 --- a/TAO/tao/Strategies/SHMIOP_Profile.cpp +++ b/TAO/tao/Strategies/SHMIOP_Profile.cpp @@ -34,12 +34,13 @@ TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (const ACE_MEM_Addr &addr, const TAO_ObjectKey &object_key, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (TAO_TAG_SHMEM_PROFILE, orb_core, version), + : TAO_Profile (TAO_TAG_SHMEM_PROFILE, + orb_core, + object_key, + version), endpoint_ (addr, orb_core->orb_params ()->use_dotted_decimal_addresses ()), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -49,11 +50,12 @@ TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (const char* host, const ACE_INET_Addr &addr, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (TAO_TAG_SHMEM_PROFILE, orb_core, version), + : TAO_Profile (TAO_TAG_SHMEM_PROFILE, + orb_core, + object_key, + version), endpoint_ (host, port, addr), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -62,9 +64,7 @@ TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (TAO_ORB_Core *orb_core) orb_core, TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, TAO_DEF_GIOP_MINOR)), endpoint_ (), - count_ (1), - object_key_ (), - tagged_profile_ () + count_ (1) { } @@ -458,56 +458,6 @@ TAO_SHMIOP_Profile::encode (TAO_OutputCDR &stream) const return 1; } -IOP::TaggedProfile & -TAO_SHMIOP_Profile::create_tagged_profile (void) -{ - // Check whether we have already created the TaggedProfile - if (this->tagged_profile_.profile_data.get_buffer () == 0) - { - // As we have not created we will now create the TaggedProfile - this->tagged_profile_.tag = TAO_TAG_SHMEM_PROFILE; - - // Create the encapsulation.... - TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE, - TAO_ENCAP_BYTE_ORDER, - this->orb_core ()->output_cdr_buffer_allocator (), - this->orb_core ()->output_cdr_dblock_allocator (), - this->orb_core ()->output_cdr_msgblock_allocator (), - this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (), - TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR, - this->orb_core ()->to_iso8859 (), - this->orb_core ()->to_unicode ()); - - // Create the profile body - this->create_profile_body (encap); - - CORBA::ULong length = - ACE_static_cast(CORBA::ULong,encap.total_length ()); - -#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) - // Place the message block in to the Sequence of Octets that we - // have - this->tagged_profile_.profile_data.replace (length, - encap.begin ()); -#else - this->tagged_profile_.profile_data.length (length); - CORBA::Octet *buffer = - this->tagged_profile_.profile_data.get_buffer (); - for (const ACE_Message_Block *i = encap.begin (); - i != encap.end (); - i = i->next ()) - { - ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ()); - buffer += i->length (); - } -#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1*/ - } - - return this->tagged_profile_; -} - - void TAO_SHMIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const { diff --git a/TAO/tao/Strategies/SHMIOP_Profile.h b/TAO/tao/Strategies/SHMIOP_Profile.h index 3c132cb42a3..0bba7999976 100644 --- a/TAO/tao/Strategies/SHMIOP_Profile.h +++ b/TAO/tao/Strategies/SHMIOP_Profile.h @@ -28,7 +28,6 @@ #include "strategies_export.h" #include "tao/Profile.h" -#include "tao/Object_KeyC.h" #include "SHMIOP_Endpoint.h" #include "ace/Synch.h" @@ -141,9 +140,6 @@ public: CORBA::ULong hash (CORBA::ULong max ACE_ENV_ARG_DECL); - /// Please refer to Profile.h for the documentation of this method - IOP::TaggedProfile &create_tagged_profile (void); - private: /// Create an encapsulation of the struct ProfileBody in <cdr> @@ -177,12 +173,6 @@ private: /// Number of endpoints in the list headed by <endpoint_>. size_t count_; - - /// Object_key associated with this profile. - TAO_ObjectKey object_key_; - - /// The tagged profile info - IOP::TaggedProfile tagged_profile_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Strategies/UIOP_Profile.cpp b/TAO/tao/Strategies/UIOP_Profile.cpp index 21ebcdf9639..549b302b26d 100644 --- a/TAO/tao/Strategies/UIOP_Profile.cpp +++ b/TAO/tao/Strategies/UIOP_Profile.cpp @@ -1,7 +1,6 @@ // This may look like C, but it's really -*- C++ -*- // $Id$ - #include "UIOP_Profile.h" #if TAO_HAS_UIOP == 1 @@ -17,7 +16,6 @@ ACE_RCSID (Strategies, UIOP_Profile, "$Id$") - #if !defined (__ACE_INLINE__) # include "UIOP_Profile.i" #endif /* __ACE_INLINE__ */ @@ -36,11 +34,12 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (const ACE_UNIX_Addr &addr, const TAO_ObjectKey &object_key, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (TAO_TAG_UIOP_PROFILE, orb_core, version), + : TAO_Profile (TAO_TAG_UIOP_PROFILE, + orb_core, + object_key, + version), endpoint_ (addr), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -49,11 +48,12 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (const char *, const ACE_UNIX_Addr &addr, const TAO_GIOP_Message_Version &version, TAO_ORB_Core *orb_core) - : TAO_Profile (TAO_TAG_UIOP_PROFILE, orb_core, version), + : TAO_Profile (TAO_TAG_UIOP_PROFILE, + orb_core, + object_key, + version), endpoint_ (addr), - count_ (1), - object_key_ (object_key), - tagged_profile_ () + count_ (1) { } @@ -61,11 +61,9 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (TAO_ORB_Core *orb_core) : TAO_Profile (TAO_TAG_UIOP_PROFILE, orb_core, TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR)), + TAO_DEF_GIOP_MINOR)), endpoint_ (), - count_ (1), - object_key_ (), - tagged_profile_ () + count_ (1) { } @@ -400,55 +398,6 @@ TAO_UIOP_Profile::encode (TAO_OutputCDR &stream) const return 1; } -IOP::TaggedProfile & -TAO_UIOP_Profile::create_tagged_profile (void) -{ - // Check whether we have already created the TaggedProfile - if (this->tagged_profile_.profile_data.get_buffer () == 0) - { - // As we have not created we will now create the TaggedProfile - this->tagged_profile_.tag = TAO_TAG_UIOP_PROFILE; - - // Create the encapsulation.... - TAO_OutputCDR encap (ACE_CDR::DEFAULT_BUFSIZE, - TAO_ENCAP_BYTE_ORDER, - this->orb_core ()->output_cdr_buffer_allocator (), - this->orb_core ()->output_cdr_dblock_allocator (), - this->orb_core ()->output_cdr_msgblock_allocator (), - this->orb_core ()->orb_params ()->cdr_memcpy_tradeoff (), - TAO_DEF_GIOP_MAJOR, - TAO_DEF_GIOP_MINOR, - this->orb_core ()->to_iso8859 (), - this->orb_core ()->to_unicode ()); - - // Create the profile body - this->create_profile_body (encap); - - CORBA::ULong length = - ACE_static_cast(CORBA::ULong, encap.total_length ()); - -#if (TAO_NO_COPY_OCTET_SEQUENCES == 1) - // Place the message block in to the Sequence of Octets that we - // have - this->tagged_profile_.profile_data.replace (length, - encap.begin ()); -#else - this->tagged_profile_.profile_data.length (length); - CORBA::Octet *buffer = - this->tagged_profile_.profile_data.get_buffer (); - for (const ACE_Message_Block *i = encap.begin (); - i != encap.end (); - i = i->next ()) - { - ACE_OS::memcpy (buffer, i->rd_ptr (), i->length ()); - buffer += i->length (); - } -#endif /* TAO_NO_COPY_OCTET_SEQUENCES == 1*/ - } - - return this->tagged_profile_; -} - void TAO_UIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const { @@ -499,27 +448,8 @@ TAO_UIOP_Profile::encode_endpoints (void) == 0) || (out_cdr << endpoints) == 0) return -1; - CORBA::ULong length = out_cdr.total_length (); - - IOP::TaggedComponent tagged_component; - tagged_component.tag = TAO_TAG_ENDPOINTS; - tagged_component.component_data.length (length); - CORBA::Octet *buf = - tagged_component.component_data.get_buffer (); - - for (const ACE_Message_Block *iterator = out_cdr.begin (); - iterator != 0; - iterator = iterator->cont ()) - { - CORBA::ULong i_length = iterator->length (); - ACE_OS::memcpy (buf, iterator->rd_ptr (), i_length); - - buf += i_length; - } - // Add component with encoded endpoint data to this profile's - // TaggedComponents. - tagged_components_.set_component (tagged_component); + this->set_tagged_components (out_cdr); return 0; } diff --git a/TAO/tao/Strategies/UIOP_Profile.h b/TAO/tao/Strategies/UIOP_Profile.h index 9a7e62ca90f..fc6c84d5d34 100644 --- a/TAO/tao/Strategies/UIOP_Profile.h +++ b/TAO/tao/Strategies/UIOP_Profile.h @@ -29,7 +29,6 @@ #include "strategies_export.h" #include "tao/Profile.h" -#include "tao/Object_KeyC.h" #include "UIOP_Connection_Handler.h" #include "UIOP_Endpoint.h" @@ -140,9 +139,6 @@ public: virtual CORBA::ULong hash (CORBA::ULong max ACE_ENV_ARG_DECL); - /// Please see the Profile.h for the documentation of this method - virtual IOP::TaggedProfile &create_tagged_profile (void); - private: /// Create an encapsulation of the struct ProfileBody in <cdr> @@ -176,12 +172,6 @@ private: /// Number of endpoints in the list headed by <endpoint_>. size_t count_; - - /// Object_key associated with this profile. - TAO_ObjectKey object_key_; - - /// Our tagged profile info - IOP::TaggedProfile tagged_profile_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index f99d5f3de9c..6cb5e4e2d38 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -258,7 +258,13 @@ TAO_Stub::get_profile_ior_info (TAO_MProfile &profiles, { TAO_Profile *prof = profiles.get_profile (index); - ior_info->profiles[index] = prof->create_tagged_profile (); + IOP::TaggedProfile *tp = + prof->create_tagged_profile (); + + if (tp == 0) + ACE_THROW_RETURN (CORBA::NO_MEMORY (), + -1); + ior_info->profiles[index] = *tp; } return 0; diff --git a/TAO/tao/Tagged_Components.cpp b/TAO/tao/Tagged_Components.cpp index d82307c30a7..9158819c7f7 100644 --- a/TAO/tao/Tagged_Components.cpp +++ b/TAO/tao/Tagged_Components.cpp @@ -12,7 +12,6 @@ ACE_RCSID (tao, Tagged_Components, "$Id$") - void TAO_Tagged_Components::set_orb_type (CORBA::ULong orb_type) { diff --git a/TAO/tao/default_client.cpp b/TAO/tao/default_client.cpp index a1ae2f8e890..b28b021320e 100644 --- a/TAO/tao/default_client.cpp +++ b/TAO/tao/default_client.cpp @@ -19,7 +19,8 @@ ACE_RCSID(tao, default_client, "$Id$") TAO_Default_Client_Strategy_Factory::TAO_Default_Client_Strategy_Factory (void) - : profile_lock_type_ (TAO_THREAD_LOCK) + : profile_lock_type_ (TAO_THREAD_LOCK), + rd_table_size_ (TAO_RD_TABLE_SIZE) { // Use single thread client connection handler #if defined (TAO_USE_ST_CLIENT_CONNECTION_HANDLER) @@ -75,7 +76,6 @@ TAO_Default_Client_Strategy_Factory::parse_args (int argc, ACE_TCHAR* argv[]) this->report_option_value_error (ACE_LIB_TEXT("-ORBProfileLock"), name); } } - else if (ACE_OS::strcasecmp (argv[curarg], ACE_LIB_TEXT("-ORBIIOPProfileLock")) == 0) { @@ -157,6 +157,15 @@ TAO_Default_Client_Strategy_Factory::parse_args (int argc, ACE_TCHAR* argv[]) this->report_option_value_error (ACE_LIB_TEXT("-ORBTransportMuxStrategy"), name); } } + else if (ACE_OS::strcmp (argv[curarg], + ACE_LIB_TEXT("-ORBReplyDispatcherTableSize")) == 0) + { + curarg++; + if (curarg < argc) + { + this->rd_table_size_ = ACE_OS::atoi (argv[curarg]); + } + } else if (ACE_OS::strncmp (argv[curarg], ACE_LIB_TEXT("-ORB"), 4) == 0) { // Can we assume there is an argument after the option? @@ -220,6 +229,12 @@ TAO_Default_Client_Strategy_Factory::create_transport_mux_strategy (TAO_Transpor return tms; } +int +TAO_Default_Client_Strategy_Factory::reply_dispatcher_table_size (void) const +{ + return this->rd_table_size_; +} + TAO_Wait_Strategy * TAO_Default_Client_Strategy_Factory::create_wait_strategy (TAO_Transport *transport) { diff --git a/TAO/tao/default_client.h b/TAO/tao/default_client.h index 48b83338640..13698ee8156 100644 --- a/TAO/tao/default_client.h +++ b/TAO/tao/default_client.h @@ -52,6 +52,7 @@ public: // following methods. virtual ACE_Lock* create_profile_lock (void); virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); + virtual int reply_dispatcher_table_size (void) const; virtual int allow_callback (void); virtual TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); virtual TAO_Connect_Strategy *create_connect_strategy (TAO_ORB_Core *); @@ -99,6 +100,9 @@ private: /// The connection initiation strategy. Connect_Strategy connect_strategy_; + + /// Size of the reply dispatcher table + int rd_table_size_; }; #if defined (__ACE_INLINE__) |