diff options
author | bala <balanatarajan@users.noreply.github.com> | 2000-04-29 03:18:01 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2000-04-29 03:18:01 +0000 |
commit | 1b7ee19343cf09427ceb269c939215b64515ea70 (patch) | |
tree | 57ebea34d9a91d06901b6c7a6c3ecd783e2e82dd | |
parent | 96e2f2477c708719fad165ee133e2a644f3cc10e (diff) | |
download | ATCD-1b7ee19343cf09427ceb269c939215b64515ea70.tar.gz |
ChangeLogTag: Fri Apr 28 21:22:44 2000 Balachandran Natarajan <bala@cs.wustl.edu>
48 files changed, 1062 insertions, 218 deletions
diff --git a/TAO/ChangeLogs/ChangeLog-02a b/TAO/ChangeLogs/ChangeLog-02a index d9e7ada4ea4..924a80cfa39 100644 --- a/TAO/ChangeLogs/ChangeLog-02a +++ b/TAO/ChangeLogs/ChangeLog-02a @@ -1,3 +1,92 @@ +Fri Apr 28 21:22:44 2000 Balachandran Natarajan <bala@cs.wustl.edu> + + * tao/Invocation.cpp (create_ior_info): + * tao/Invocation.h: Added support for GIOP 1.2 exceptions. GIOP + 1.2 raises two new exceptions for the Request and + LocateRequest. Added support to handle these exceptions. To add + support, I had to add a new method called create_ior_info () + which would create IOP::IOR information only once, if an + exception is received from the server side seeking that + information. + + * tao/Acceptor_Registry.cpp: + * tao/Acceptor_Registry.h: Added a new method, that would return + the right acceptor by taking a tag value. This is similar to the + method in Connector_Registry.{h,cpp}. + + * tao/Pluggable_Messaging_Utils.h: + * tao/operation_details.h: + * tao/operation_details.i: + * tao/target_specification.h: + * tao/target_specification.i: + * tao/GIOP_Utils.h: + * tao/GIOP_Message_Accept_State.cpp: + * tao/GIOP_Message_Accept_State.h: + * tao/GIOP_Message_Acceptors.cpp: + * tao/GIOP_Message_Connectors.cpp: + * tao/GIOP_Message_Connectors.h: + * tao/GIOP_Message_Headers.h: + * tao/GIOP_Message_Headers.i: + * tao/GIOP_Message_Lite.cpp: Added support for GIOP 1.2 + + * tao/GIOP_Server_Request.cpp: + * tao/GIOP_Server_Request.h: + * tao/GIOP_Server_Request.i: Removed some of the GIOP 1.2 specific + data from here and moved it to a new file + TaggedProfile.{h,cpp,i} which would do the related processing of + the data to extract ObjectKey. As TAO servers, as on date do not + use any data other than ObjectKey, we need to do the processing + to extract ObjectKey from IOP::IOR and IOP::TaggedProfile. + + * tao/Pluggable.h: Added a virtual function that would extract an + ObjectKey from an IOP::TaggedProfile. + + * tao/IIOP_Acceptor.cpp: + * tao/IIOP_Acceptor.h: + * tao/SHMIOP_Acceptor.cpp: + * tao/SHMIOP_Acceptor.h: + * tao/UIOP_Acceptor.cpp: + * tao/UIOP_Acceptor.h: Concrete implementations for the above. + + * tao/Profile.cpp: + * tao/Profile.h: Added a virtual function that would create a + IOP::TaggedProfile info from the profile info that is being + stored. This is necessary as different protocol implementations + could encapsulate different types of info in its profile which + is a part of the server exhibited IOR. + + * tao/IIOP_Profile.cpp: + * tao/IIOP_Profile.h: + * tao/IIOP_Profile.i: + * tao/UIOP_Profile.cpp: + * tao/UIOP_Profile.h: + * tao/SHMIOP_Profile.cpp: + * tao/SHMIOP_Profile.h: Concrete implementations for the above. + + * tao/Stub.cpp: + * tao/Stub.h: + * tao/Stub.i: Added a method to store and retrieve information + about the GIOP 1.2 specific exception thrown. If we have + received a LOC_NEEDS_ADDRESSING, we need to change the + addressing mode and restart the request. This is something + similar to LOCATION_FORWARD, but here we store only a flag to + indicate what addressing mode to use so that subsequent + invocations would use the right addressing mode. + + * tao/MProfile.h: + * tao/MProfile.i: Added a method get_current_handle () that would + allow acces for const objects. + + * tao/Tagged_Profile.cpp: + * tao/Tagged_Profile.h: + * tao/Tagged_Profile.i: New files that would do GIOP 1.2 specific + data processing for the server side. + + * tao/Makefile: Added the above file in the Makefile. + + * tao/orbconf.h: Turned on support for GIOP 1.2. Now would be + ideal time. Any bugs that arises can be fixed I am gone on vacation. + Fri Apr 28 19:57:41 2000 Carlos O'Ryan <coryan@uci.edu> * Minor fixes to the IDL compiler to facilitate the automatic diff --git a/TAO/tao/Acceptor_Registry.cpp b/TAO/tao/Acceptor_Registry.cpp index b2054de9db2..52166739b3f 100644 --- a/TAO/tao/Acceptor_Registry.cpp +++ b/TAO/tao/Acceptor_Registry.cpp @@ -83,6 +83,26 @@ TAO_Acceptor_Registry::is_collocated (const TAO_MProfile &mprofile) return 0; } +TAO_Acceptor* +TAO_Acceptor_Registry::get_acceptor (CORBA::ULong tag) +{ + TAO_AcceptorSetIterator end = + this->end (); + TAO_AcceptorSetIterator acceptor = + this->begin (); + + for (; + acceptor != end ; + acceptor++) + { + if ((*acceptor)->tag () == tag) + return *acceptor; + } + + return 0; +} + + int TAO_Acceptor_Registry::open (TAO_ORB_Core *orb_core, CORBA::Environment &ACE_TRY_ENV) diff --git a/TAO/tao/Acceptor_Registry.h b/TAO/tao/Acceptor_Registry.h index ca603e2c693..a862ad9d1cc 100644 --- a/TAO/tao/Acceptor_Registry.h +++ b/TAO/tao/Acceptor_Registry.h @@ -81,6 +81,9 @@ public: // Check if there is at least one profile in <mprofile> that // corresponds to a collocated object. + TAO_Acceptor *get_acceptor (CORBA::ULong tag); + // Return the acceptor bridges + // = Iterator. TAO_AcceptorSetIterator begin (void); TAO_AcceptorSetIterator end (void); diff --git a/TAO/tao/GIOP_Message_Accept_State.cpp b/TAO/tao/GIOP_Message_Accept_State.cpp index 51070ff62e5..c61e57eac93 100644 --- a/TAO/tao/GIOP_Message_Accept_State.cpp +++ b/TAO/tao/GIOP_Message_Accept_State.cpp @@ -8,6 +8,7 @@ //#include "tao/CDR.h" #include "tao/Pluggable_Messaging_Utils.h" #include "tao/NVList.h" +#include "tao/Tagged_Profile.h" ACE_RCSID(tao, GIOP_Message_Accept_State, "$Id$") @@ -83,7 +84,7 @@ TAO_GIOP_Message_Accept_State::marshal_reply_status (TAO_OutputCDR &output, output.write_ulong (TAO_GIOP_USER_EXCEPTION); break; default: - // Some other specifc exception + // Some other specific exception output.write_ulong (reply.reply_status_); break; } @@ -115,8 +116,7 @@ TAO_GIOP_Message_Accept_State:: CORBA::Boolean TAO_GIOP_Message_Accept_State:: -unmarshall_iop_profile (TAO_ObjectKey & /*object_key*/, - IOP::TaggedProfile & /*profile*/, +unmarshall_iop_profile (TAO_Tagged_Profile & /*profile*/, TAO_InputCDR & /*cdr*/) { return 0; @@ -125,8 +125,7 @@ unmarshall_iop_profile (TAO_ObjectKey & /*object_key*/, CORBA::Boolean TAO_GIOP_Message_Accept_State:: -unmarshall_ref_addr (TAO_ObjectKey & /*object_key*/, - GIOP::IORAddressingInfo & /*profile*/, +unmarshall_ref_addr (TAO_Tagged_Profile & /*profile*/, TAO_InputCDR & /*cdr*/) { return 0; @@ -452,15 +451,13 @@ TAO_GIOP_Message_Accept_State_12:: else if (disc == GIOP::ProfileAddr) { hdr_status = - this->unmarshall_iop_profile (request.object_key (), - request.tagged_profile (), + this->unmarshall_iop_profile (request.profile (), input); } else if (disc == GIOP::ReferenceAddr) { hdr_status = - this->unmarshall_ref_addr (request.object_key (), - request.addressing_info (), + this->unmarshall_ref_addr (request.profile (), input); } } @@ -547,15 +544,13 @@ TAO_GIOP_Message_Accept_State_12:: else if (disc == GIOP::ProfileAddr) { hdr_status = - this->unmarshall_iop_profile (request.object_key (), - request.tagged_profile (), + this->unmarshall_iop_profile (request.profile (), msg); } else if (disc == GIOP::ReferenceAddr) { hdr_status = - this->unmarshall_ref_addr (request.object_key (), - request.addressing_info (), + this->unmarshall_ref_addr (request.profile (), msg); } } @@ -570,28 +565,20 @@ TAO_GIOP_Message_Accept_State_12:: CORBA::Boolean TAO_GIOP_Message_Accept_State_12:: - unmarshall_iop_profile (TAO_ObjectKey &object_key, - IOP::TaggedProfile &profile_addr, + unmarshall_iop_profile (TAO_Tagged_Profile &profile_addr, TAO_InputCDR &input) { CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit (); - - // Extract the TaggedProfile - // @@We can also look in to the CDR stream to extract the - // members of the struct (TaggedProfile) directly. A place - // for optimzation. Once we have this working we can implement - // this - hdr_status &= input >> profile_addr; + + // Get the IOP::Tagged profile. + IOP::TaggedProfile &tagged_profile = + profile_addr.tagged_profile (); + + hdr_status &= input >> tagged_profile; // Extract the object key from the TaggedProfile - if (hdr_status) - { - object_key.replace (profile_addr.profile_data.length (), - profile_addr.profile_data.length (), - profile_addr.profile_data.get_buffer ()); - - } + hdr_status &=profile_addr.extract_object_key (tagged_profile); return hdr_status; } @@ -599,33 +586,24 @@ TAO_GIOP_Message_Accept_State_12:: CORBA::Boolean TAO_GIOP_Message_Accept_State_12:: - unmarshall_ref_addr (TAO_ObjectKey &object_key, - GIOP::IORAddressingInfo &addr_info, + unmarshall_ref_addr (TAO_Tagged_Profile &profile_addr, TAO_InputCDR &input) { CORBA::Boolean hdr_status = (CORBA::Boolean) input.good_bit (); - //Extract the Addressing info - // @@We can also look in to the CDR stream to extract the - // members of the struct (AddressingInfo) directly. A place - // for optimzation. Once we have this working we can implement - // this + // Get the IOP::Tagged profile. + GIOP::IORAddressingInfo &addr_info = + profile_addr.addressing_info (); + hdr_status &= input>> addr_info; + + IOP::TaggedProfile &tag = + addr_info.ior.profiles [addr_info.selected_profile_index]; - // Extract the object key - if (hdr_status) - { - // Get the IOP::TaggedProfile - IOP::TaggedProfile &tag = - addr_info.ior.profiles [addr_info.selected_profile_index]; - - // Replace the object key - object_key.replace (tag.profile_data.length (), - tag.profile_data.length (), - tag.profile_data.get_buffer ()); - } - + // Extract the object key from the TaggedProfile + hdr_status &= profile_addr.extract_object_key (tag); + return hdr_status; } @@ -650,7 +628,7 @@ write_reply_header (TAO_OutputCDR & output, output.write_ulong (TAO_GIOP_LOCATION_FORWARD_PERM); } else if (reply.reply_status_ == - TAO_PLUGABLE_MESSAGE_NEEDS_ADDRESSING_MODE) + TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE) { // Not sure when we will use this. output.write_ulong (TAO_GIOP_LOC_NEEDS_ADDRESSING_MODE); @@ -678,8 +656,9 @@ write_locate_reply_mesg (TAO_OutputCDR & output, CORBA::ULong request_id, TAO_GIOP_Locate_Status_Msg &status_info) { - // Make the header for the locate request output.write_ulong (request_id); + + // Make the header for the locate request output.write_ulong (status_info.status); if (output.align_write_ptr (TAO_GIOP_MESSAGE_ALIGN_PTR) == -1) @@ -687,9 +666,9 @@ write_locate_reply_mesg (TAO_OutputCDR & output, switch (status_info.status) { - - // More likely than not we will not have this in TAO case TAO_GIOP_OBJECT_FORWARD: + + // More likely than not we will not have this in TAO case TAO_GIOP_OBJECT_FORWARD_PERM: { CORBA::Object_ptr object_ptr = diff --git a/TAO/tao/GIOP_Message_Accept_State.h b/TAO/tao/GIOP_Message_Accept_State.h index b6616b06702..cf9de937f82 100644 --- a/TAO/tao/GIOP_Message_Accept_State.h +++ b/TAO/tao/GIOP_Message_Accept_State.h @@ -24,6 +24,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +class TAO_Tagged_Profile; // @@ Bala: do we want to have separate classes for the server side // and client side? IMHO not, with bi-directional connections the // differences will be completely blurred. @@ -103,14 +104,12 @@ protected: // Unmarshals the received object key virtual CORBA::Boolean - unmarshall_iop_profile (TAO_ObjectKey &object_key, - IOP::TaggedProfile &profile, + unmarshall_iop_profile (TAO_Tagged_Profile &profile, TAO_InputCDR &cdr); // Unmarshall the IOP::TaggedProfile virtual CORBA::Boolean - unmarshall_ref_addr (TAO_ObjectKey &object_key, - GIOP::IORAddressingInfo &profile, + unmarshall_ref_addr (TAO_Tagged_Profile &profile, TAO_InputCDR &cdr); // Unmarshalls the GIOP::IORAddressingInfo }; @@ -220,14 +219,14 @@ public: private: virtual CORBA::Boolean - unmarshall_iop_profile (TAO_ObjectKey &object_key, - IOP::TaggedProfile &profile, + unmarshall_iop_profile (TAO_Tagged_Profile &profile, TAO_InputCDR &cdr); + // Unmarshall the IOP::TaggedProfile virtual CORBA::Boolean - unmarshall_ref_addr (TAO_ObjectKey &object_key, - GIOP::IORAddressingInfo &ref_addr, + unmarshall_ref_addr (TAO_Tagged_Profile &profile, TAO_InputCDR &cdr); + // Unmarshall the IOR Addressing info }; diff --git a/TAO/tao/GIOP_Message_Acceptors.cpp b/TAO/tao/GIOP_Message_Acceptors.cpp index 7ea79b8566b..d23b8efbb98 100644 --- a/TAO/tao/GIOP_Message_Acceptors.cpp +++ b/TAO/tao/GIOP_Message_Acceptors.cpp @@ -322,7 +322,8 @@ TAO_GIOP_Message_Acceptors:: // This will extract the request header, set <response_required> as // appropriate. - TAO_GIOP_Locate_Request_Header locate_request (input); + TAO_GIOP_Locate_Request_Header locate_request (input, + orb_core); TAO_GIOP_Locate_Status_Msg status_info; diff --git a/TAO/tao/GIOP_Message_Connectors.cpp b/TAO/tao/GIOP_Message_Connectors.cpp index 31861e04ed8..19c2db7cdd3 100644 --- a/TAO/tao/GIOP_Message_Connectors.cpp +++ b/TAO/tao/GIOP_Message_Connectors.cpp @@ -85,20 +85,38 @@ TAO_GIOP_Message_Connectors:: { // Request completed successfully case TAO_GIOP_NO_EXCEPTION: - params.reply_status_ = TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION; + params.reply_status_ = + TAO_PLUGGABLE_MESSAGE_NO_EXCEPTION; break; // Request terminated with user exception case TAO_GIOP_USER_EXCEPTION: - params.reply_status_ = TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION; + params.reply_status_ = + TAO_PLUGGABLE_MESSAGE_USER_EXCEPTION; break; // Request terminated with system exception case TAO_GIOP_SYSTEM_EXCEPTION: - params.reply_status_ = TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION; + params.reply_status_ = + TAO_PLUGGABLE_MESSAGE_SYSTEM_EXCEPTION; break; // Reply is a location forward type case TAO_GIOP_LOCATION_FORWARD: - params.reply_status_ = TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD; + params.reply_status_ = + TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD; + break; + // Reply is a location forward perm type + // @@For the time being the behaviour of the + // LOCATION_FORWARD_PERM would be similar to the + // LOCATION_FORWARD as there is a controversy surrounding the + // usage of this in the OMG. + case TAO_GIOP_LOCATION_FORWARD_PERM: + params.reply_status_ = + TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD; + break; + // Reply is a location forward type + case TAO_GIOP_NEEDS_ADDRESSING_MODE: + params.reply_status_ = + TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE; break; default: if (TAO_debug_level > 0) @@ -111,6 +129,43 @@ TAO_GIOP_Message_Connectors:: int +TAO_GIOP_Message_Connectors:: + parse_locate_reply (TAO_GIOP_Message_State &state, + TAO_Pluggable_Reply_Params ¶ms) +{ + // Read the request id + if (!state.cdr.read_ulong (params.request_id_)) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t|%N|%l) : TAO_GIOP_Message_1_1::parse_reply, ") + ACE_TEXT ("extracting request id"))); + return -1; + } + + // and the reply status type. status can be NO_EXCEPTION, + // SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD + + // Cannot handle LOCATION_FORWARD_PERM here + + // Please note here that we are NOT converting to the Pluggable + // messaging layer exception as this is GIOP specific. Not many + // messaging protocols have the locate_* messages. + if (!state.cdr.read_ulong (params.reply_status_)) + { + if (TAO_debug_level > 0) + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Connectors::parse_locate_reply, ") + ACE_TEXT ("extracting reply status\n"))); + return -1; + } + + return 0; + +} + + +int TAO_GIOP_Message_Connectors::validate_version (TAO_GIOP_Message_State *state) { @@ -275,8 +330,8 @@ TAO_GIOP_Message_Connector_10:: case TAO_GIOP_REQUEST: // In GIOP 1.0 and GIOP 1.1 this is an error, ACE_ERROR_RETURN ((LM_ERROR, - "TAO (%P|%t) %N:%l TAO_GIOP_Message_1_1::parse_reply: " - "request.\n"), + ACE_TEXT ("TAO (%P|%t) TAO_GIOP_Message_Connector_10::parse_reply: ") + ACE_TEXT ("request.\n")), -1); case TAO_GIOP_CANCELREQUEST: @@ -289,7 +344,9 @@ TAO_GIOP_Message_Connector_10:: ACE_TEXT ("wrong message.\n")), -1); case TAO_GIOP_LOCATEREPLY: - // Handle after the switch + if (this->parse_locate_reply (*state, + params) == -1) + return -1; break; case TAO_GIOP_REPLY: if ((state->cdr >> params.svc_ctx_) == 0) @@ -300,18 +357,15 @@ TAO_GIOP_Message_Connector_10:: ACE_TEXT ("extracting context\n"))); return -1; } - // Rest of the stuff after the switch + if (TAO_GIOP_Message_Connectors::parse_reply (*state, + params) == -1) + return -1; break; case TAO_GIOP_FRAGMENT: // Never happens: why?? break; } - if (TAO_GIOP_Message_Connectors::parse_reply (*state, - params) - == -1) - return -1; - return 0; } @@ -537,10 +591,7 @@ parse_reply (TAO_Message_State_Factory &mesg_state, // Cast to the GIOP Message state TAO_GIOP_Message_State *state = ACE_dynamic_cast (TAO_GIOP_Message_State *, &mesg_state); - if (TAO_GIOP_Message_Connectors::parse_reply (*state, - params) - == -1) - return -1; + switch (state->message_type) { @@ -558,9 +609,15 @@ parse_reply (TAO_Message_State_Factory &mesg_state, ACE_TEXT ("wrong message.\n")), -1); case TAO_GIOP_LOCATEREPLY: - // Handle after the switch + if (this->parse_locate_reply (*state, + params) == -1) + return -1; break; case TAO_GIOP_REPLY: + if (TAO_GIOP_Message_Connectors::parse_reply (*state, + params) + == -1) + return -1; if ((state->cdr >> params.svc_ctx_) == 0) { if (TAO_debug_level > 0) diff --git a/TAO/tao/GIOP_Message_Connectors.h b/TAO/tao/GIOP_Message_Connectors.h index cd8a2cb40fd..a3c4e905799 100644 --- a/TAO/tao/GIOP_Message_Connectors.h +++ b/TAO/tao/GIOP_Message_Connectors.h @@ -59,6 +59,11 @@ protected: int parse_reply (TAO_Message_State_Factory &mesg_state, TAO_Pluggable_Reply_Params ¶ms); // Parse the reply message from the server + + + int parse_locate_reply (TAO_GIOP_Message_State &state, + TAO_Pluggable_Reply_Params ¶ms); + // Parse the locate reply message private: virtual CORBA::Boolean diff --git a/TAO/tao/GIOP_Message_Headers.h b/TAO/tao/GIOP_Message_Headers.h index a72af9d472d..a93d90d49f4 100644 --- a/TAO/tao/GIOP_Message_Headers.h +++ b/TAO/tao/GIOP_Message_Headers.h @@ -21,19 +21,20 @@ #define TAO_GIOP_MESSAGE_HEADERS_H #include "ace/pre.h" -#include "tao/GIOPC.h" +#include "tao/Tagged_Profile.h" + // @@ Bala: what goes in this file? All the message headers? A few of // @@ them? Only the Locate_Request header?! -// @@ Bala: the TAO_Export macros are missing here too! class TAO_Export TAO_GIOP_Locate_Request_Header { // = TITLE // Location service support public: - TAO_GIOP_Locate_Request_Header (TAO_InputCDR &msg); + TAO_GIOP_Locate_Request_Header (TAO_InputCDR &msg, + TAO_ORB_Core *core); // Constructor void request_id (CORBA::ULong id); @@ -48,11 +49,8 @@ public: TAO_ObjectKey &object_key (void); // Get the object_key in read/write mode.. - IOP::TaggedProfile &tagged_profile (void); - // get the tagged_profile in the read/write mode - - GIOP::IORAddressingInfo &addressing_info (void); - // get the addressing info in the read/write mode + TAO_Tagged_Profile &profile (void); + // Get the reference to the underlying profile TAO_InputCDR &incoming_stream (void); // Get the CDR stream for read/write @@ -61,20 +59,12 @@ private: CORBA::ULong request_id_; // Request id + TAO_Tagged_Profile profile_; + // Profile info. + TAO_ObjectKey object_key_; // Object Key - IOP::TaggedProfile profile_; - // The Tagged profile. This class would have the Tagged Profile - - GIOP::IORAddressingInfo addr_info_; - // The addressing info - - // The above two declarations are not used in TAO as on date. It is - // here so that we can use this if we get to that point. The - // object_key extracted from these would still be available in - // <object_key_>. - TAO_InputCDR *incoming_; // Incoming CDR stream }; diff --git a/TAO/tao/GIOP_Message_Headers.i b/TAO/tao/GIOP_Message_Headers.i index 24420b32260..208019a5dea 100644 --- a/TAO/tao/GIOP_Message_Headers.i +++ b/TAO/tao/GIOP_Message_Headers.i @@ -2,11 +2,10 @@ //$Id$ ACE_INLINE -TAO_GIOP_Locate_Request_Header::TAO_GIOP_Locate_Request_Header (TAO_InputCDR &msg) +TAO_GIOP_Locate_Request_Header::TAO_GIOP_Locate_Request_Header (TAO_InputCDR &msg, + TAO_ORB_Core *orb) : request_id_ (0), - object_key_ (), - profile_ (), - addr_info_ (), + profile_ (orb), incoming_ (&msg) { } @@ -26,29 +25,21 @@ TAO_GIOP_Locate_Request_Header::request_id (void) ACE_INLINE const TAO_ObjectKey & TAO_GIOP_Locate_Request_Header::object_key (void) const { - return object_key_; + return this->profile_.object_key (); } ACE_INLINE TAO_ObjectKey & TAO_GIOP_Locate_Request_Header::object_key (void) { - return this->object_key_; + return this->profile_.object_key (); } -ACE_INLINE IOP::TaggedProfile& -TAO_GIOP_Locate_Request_Header::tagged_profile (void) +ACE_INLINE TAO_Tagged_Profile & +TAO_GIOP_Locate_Request_Header::profile (void) { return this->profile_; } - -ACE_INLINE GIOP::IORAddressingInfo & -TAO_GIOP_Locate_Request_Header::addressing_info (void) -{ - return this->addr_info_; -} - - ACE_INLINE TAO_InputCDR & TAO_GIOP_Locate_Request_Header::incoming_stream (void) { diff --git a/TAO/tao/GIOP_Message_Lite.cpp b/TAO/tao/GIOP_Message_Lite.cpp index 01ce35ebbda..652c7b2dd9c 100644 --- a/TAO/tao/GIOP_Message_Lite.cpp +++ b/TAO/tao/GIOP_Message_Lite.cpp @@ -804,7 +804,8 @@ TAO_GIOP_Message_Lite:: // This will extract the request header, set <response_required> as // appropriate. - TAO_GIOP_Locate_Request_Header locate_request (input); + TAO_GIOP_Locate_Request_Header locate_request (input, + orb_core); TAO_GIOP_Locate_Status_Msg status_info; diff --git a/TAO/tao/GIOP_Server_Request.cpp b/TAO/tao/GIOP_Server_Request.cpp index decc1bde30f..ffa86b82d2f 100644 --- a/TAO/tao/GIOP_Server_Request.cpp +++ b/TAO/tao/GIOP_Server_Request.cpp @@ -49,7 +49,7 @@ TAO_GIOP_ServerRequest:: TAO_InputCDR &input, TAO_OutputCDR &output, TAO_ORB_Core *orb_core, - const TAO_GIOP_Version &version) + const TAO_GIOP_Version & /*version*/) :mesg_base_ (mesg_base), incoming_ (&input), outgoing_ (&output), @@ -67,10 +67,10 @@ TAO_GIOP_ServerRequest:: exception_ (0), exception_type_ (TAO_GIOP_NO_EXCEPTION), orb_core_ (orb_core), - version_ (version), + // version_ (version), service_info_ (), request_id_ (0), - object_key_ (), + profile_ (orb_core), requesting_principal_ (0) { ACE_FUNCTION_TIMEPROBE (TAO_SERVER_REQUEST_START); @@ -87,7 +87,7 @@ TAO_GIOP_ServerRequest:: const ACE_CString &operation, TAO_OutputCDR &output, TAO_ORB_Core *orb_core, - const TAO_GIOP_Version &version, + const TAO_GIOP_Version & /*version*/, int &parse_error) : mesg_base_ (mesg_base), operation_ (operation), @@ -107,12 +107,13 @@ TAO_GIOP_ServerRequest:: exception_ (0), exception_type_ (TAO_GIOP_NO_EXCEPTION), orb_core_ (orb_core), - version_ (version), + //version_ (version), service_info_ (), request_id_ (request_id), - object_key_ (object_key), + profile_ (orb_core), requesting_principal_ (0) { + profile_.object_key (object_key); parse_error = 0; } diff --git a/TAO/tao/GIOP_Server_Request.h b/TAO/tao/GIOP_Server_Request.h index 05880288251..d45434bdf01 100644 --- a/TAO/tao/GIOP_Server_Request.h +++ b/TAO/tao/GIOP_Server_Request.h @@ -32,7 +32,8 @@ #include "tao/ORB.h" #include "tao/Principal.h" #include "tao/GIOP_Message_Base.h" -#include "tao/GIOPC.h" +#include "tao/Tagged_Profile.h" + class TAO_Export TAO_GIOP_ServerRequest : public CORBA_ServerRequest { @@ -176,12 +177,9 @@ public: void requesting_principal (CORBA_Principal_ptr principal); // set the requesting principal - - IOP::TaggedProfile &tagged_profile (void); - // get the tagged_profile - GIOP::IORAddressingInfo &addressing_info (void); - // get the addressing info + TAO_Tagged_Profile &profile (void); + // Return the reference to the tagged profile private: TAO_Pluggable_Messaging *mesg_base_; @@ -229,7 +227,7 @@ private: // A pointer to the ORB Core for the context where the request was // created. - TAO_GIOP_Version version_; + //TAO_GIOP_Version version_; // The version for the GIOP request, the reply must have the same // one. @@ -238,19 +236,9 @@ private: CORBA::ULong request_id_; // Unique identifier for a request - - TAO_ObjectKey object_key_; - // The object key of the destination object. - - IOP::TaggedProfile profile_; - // The Tagged profile. This class would have the Tagged Profile - - GIOP::IORAddressingInfo addr_info_; - // The addressing info - - // The above two declarations are not used in TAO as on date. It is - // here so that we can use this anyday. The object_key extracted - // from these would still be available in <object_key_>. + + TAO_Tagged_Profile profile_; + // The tagged profile that has the addressing information CORBA::Principal_var requesting_principal_; // Identifies the requester diff --git a/TAO/tao/GIOP_Server_Request.i b/TAO/tao/GIOP_Server_Request.i index 6d9efed18b0..ef6318e8623 100644 --- a/TAO/tao/GIOP_Server_Request.i +++ b/TAO/tao/GIOP_Server_Request.i @@ -92,13 +92,13 @@ TAO_GIOP_ServerRequest::principal (void) const ACE_INLINE TAO_ObjectKey & TAO_GIOP_ServerRequest::object_key (void) { - return this->object_key_; + return this->profile_.object_key (); } ACE_INLINE CORBA::Object_ptr TAO_GIOP_ServerRequest::objref (CORBA_Environment &ACE_TRY_ENV) { - return this->orb ()->key_to_object (this->object_key_, + return this->orb ()->key_to_object (this->object_key (), 0, 0, 1, @@ -137,14 +137,10 @@ TAO_GIOP_ServerRequest::requesting_principal (CORBA_Principal_ptr this->requesting_principal_ = principal; } -ACE_INLINE IOP::TaggedProfile & -TAO_GIOP_ServerRequest::tagged_profile (void) +ACE_INLINE TAO_Tagged_Profile & +TAO_GIOP_ServerRequest::profile (void) { return this->profile_; } -ACE_INLINE GIOP::IORAddressingInfo & -TAO_GIOP_ServerRequest::addressing_info (void) -{ - return this->addr_info_; -} + diff --git a/TAO/tao/GIOP_Utils.h b/TAO/tao/GIOP_Utils.h index a41326e2722..59d611fff04 100644 --- a/TAO/tao/GIOP_Utils.h +++ b/TAO/tao/GIOP_Utils.h @@ -96,7 +96,7 @@ typedef enum GIOP_ReplyStatusType TAO_GIOP_LOCATION_FORWARD_PERM, // GIOP 1.2, Reply is a location forward perm type.. - NEEDS_ADDRESSING_MODE + TAO_GIOP_NEEDS_ADDRESSING_MODE // GIOP1.2, } TAO_GIOP_Reply_Status_Type; diff --git a/TAO/tao/IIOP_Acceptor.cpp b/TAO/tao/IIOP_Acceptor.cpp index c9b4151c57e..f491f9ceecb 100644 --- a/TAO/tao/IIOP_Acceptor.cpp +++ b/TAO/tao/IIOP_Acceptor.cpp @@ -474,6 +474,56 @@ TAO_IIOP_Acceptor::endpoint_count (void) } int +TAO_IIOP_Acceptor::object_key (IOP::TaggedProfile &profile, + TAO_ObjectKey &object_key) +{ + // Create the decoding stream from the encapsulation in the buffer, + TAO_InputCDR cdr (profile.profile_data.mb ()); + + CORBA::Octet major, minor; + + // Read the version. We just read it here. We don't*do any* + // processing. + if (!(cdr.read_octet (major) + && cdr.read_octet (minor))) + { + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) IIOP_Profile::decode - v%d.%d\n"), + major, + minor)); + } + return -1; + } + + CORBA::String_var host; + CORBA::UShort port = 0; + + // Get host and port. No processing here too.. + if (cdr.read_string (host.out ()) == 0 + || cdr.read_ushort (port) == 0) + { + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) TAO_Tagged_Profile::decode - ") + ACE_TEXT ("error while decoding host/port"))); + } + return -1; + } + + // ... and object key. + if ((cdr >> object_key) == 0) + return -1; + + // We are NOT bothered about the rest. + + return 1; +} + + +int TAO_IIOP_Acceptor::parse_options (const char *str) { if (str == 0) diff --git a/TAO/tao/IIOP_Acceptor.h b/TAO/tao/IIOP_Acceptor.h index 2e4d0867e19..bc2f993adfb 100644 --- a/TAO/tao/IIOP_Acceptor.h +++ b/TAO/tao/IIOP_Acceptor.h @@ -75,6 +75,8 @@ public: virtual int is_collocated (const TAO_Profile* profile); virtual CORBA::ULong endpoint_count (void); + virtual int object_key (IOP::TaggedProfile &profile, + TAO_ObjectKey &key); private: int open_i (TAO_ORB_Core *orb_core, const ACE_INET_Addr &addr); diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 2d5eee57d4a..8b14d986852 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -39,7 +39,8 @@ TAO_IIOP_Profile::TAO_IIOP_Profile (const ACE_INET_Addr &addr, object_key_ (object_key), object_addr_ (addr), hint_ (0), - orb_core_ (orb_core) + orb_core_ (orb_core), + tagged_profile_ () { this->set (addr); } @@ -452,28 +453,71 @@ TAO_IIOP_Profile::encode (TAO_OutputCDR &stream) const this->orb_core_->to_iso8859 (), this->orb_core_->to_unicode ()); - encap.write_octet (TAO_ENCAP_BYTE_ORDER); + // Create the profile body + this->create_profile_body (encap); + + // write the encapsulation as an octet sequence... + stream << CORBA::ULong (encap.total_length ()); + stream.write_octet_array_mb (encap.begin ()); + + 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 = TAO_TAG_IIOP_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_->orb_params ()->cdr_memcpy_tradeoff (), + this->orb_core_->to_iso8859 (), + this->orb_core_->to_unicode ()); + + // Create the profile body + this->create_profile_body (encap); + + // Place the message block in to the Sequence of Octets that we + // have + this->tagged_profile_.profile_data.replace ( + (CORBA::ULong) encap.total_length (), + encap.begin ()); + } + + return this->tagged_profile_; +} + +void +TAO_IIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const +{ + encap.write_octet (TAO_ENCAP_BYTE_ORDER); + // The GIOP version encap.write_octet (this->version_.major); encap.write_octet (this->version_.minor); - + // STRING hostname from profile encap.write_string (this->host_.in ()); - + // UNSIGNED SHORT port number encap.write_ushort (this->port_); - + // OCTET SEQUENCE for object key encap << this->object_key_; - + if (this->version_.major > 1 || this->version_.minor > 0) this->tagged_components ().encode (encap); +} + - // write the encapsulation as an octet sequence... - stream << CORBA::ULong (encap.total_length ()); - stream.write_octet_array_mb (encap.begin ()); - return 1; -} diff --git a/TAO/tao/IIOP_Profile.h b/TAO/tao/IIOP_Profile.h index d1502b8070d..475d5e6d1a1 100644 --- a/TAO/tao/IIOP_Profile.h +++ b/TAO/tao/IIOP_Profile.h @@ -145,6 +145,10 @@ public: void reset_hint (void); // Reset the hint's value. + IOP::TaggedProfile &create_tagged_profile (void); + // Please refer to Profile.h for the documentation of this + // function. + private: int set (const ACE_INET_Addr &addr); // helper method to set the INET_Addr. @@ -155,6 +159,9 @@ private: private: + void create_profile_body (TAO_OutputCDR &cdr) const; + // Creates a encapsultaion of the ProfileBody struct in the <cdr> + CORBA::String_var host_; // String representing the hosts name. @@ -177,6 +184,10 @@ private: TAO_ORB_Core *orb_core_; // ORB Core. + + IOP::TaggedProfile tagged_profile_; + // Our tagged profile + }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/IIOP_Profile.i b/TAO/tao/IIOP_Profile.i index d3f233336a7..7fb7ce710a8 100644 --- a/TAO/tao/IIOP_Profile.i +++ b/TAO/tao/IIOP_Profile.i @@ -54,3 +54,5 @@ TAO_IIOP_Profile::hint (void) { return this->hint_; } + + diff --git a/TAO/tao/Invocation.cpp b/TAO/tao/Invocation.cpp index f9bee0da6c5..ec4d61fec52 100644 --- a/TAO/tao/Invocation.cpp +++ b/TAO/tao/Invocation.cpp @@ -175,7 +175,7 @@ TAO_GIOP_Invocation::select_profile_based_on_policy { this->profile_ = ACE_const_cast(TAO_Profile*,profile); - break; + } } @@ -312,7 +312,31 @@ TAO_GIOP_Invocation::prepare_header (CORBA::Octet response_flags, // Then fill in the rest of the RequestHeader // // The target specification mode - this->target_spec_.target_specifier (this->profile_->object_key ()); + + if (this->stub_->addressing_mode () == + TAO_Target_Specification::Key_Addr) + { + this->target_spec_.target_specifier ( + this->profile_->object_key ()); + } + else if (this->stub_->addressing_mode () == + TAO_Target_Specification::Profile_Addr) + { + this->target_spec_.target_specifier ( + this->profile_->create_tagged_profile ()); + } + else if (this->stub_->addressing_mode () == + TAO_Target_Specification::Reference_Addr) + { + // We need to call the method seperately. If there is no + // IOP::IOR info, the call would create the info and return the + // index that we need. + // @@Will not work for RT CORBA as the index we get would be + // wrong. + CORBA::ULong index = this->create_ior_info (); + this->target_spec_.target_specifier (this->ior_info_, + index); + } // Update the response flags this->op_details_.response_flags (response_flags); @@ -515,6 +539,51 @@ TAO_GIOP_Invocation::location_forward (TAO_InputCDR &inp_stream, return TAO_INVOKE_RESTART; } + +CORBA::ULong +TAO_GIOP_Invocation::create_ior_info (void) +{ + // Get the list of profiles + const TAO_MProfile &mprofile = + this->stub_->base_profiles (); + + if (this->ior_info_.profiles.length () == 0) + { + // We are making a copy, it is expensive. We want a copy of the + // profiles as we dont want to modify the profile set held by + // the Stub classes. We may want to hold a lock for doing + // that. To avoid unnecssary complications we make a copy and + // get the info + + // @@ There should be a better way to do this - Bala + TAO_MProfile *multi_prof = + this->stub_->make_profiles (); + + // Get the number of elements + CORBA::ULong count = multi_prof->profile_count (); + + // Set the number of elements in the sequence of tagged_profile + this->ior_info_.profiles.length (count); + + // Call the create_tagged_profile one every member of the + // profile and make the sequence + for (CORBA::ULong index = 0; + index < count; + ++index) + { + TAO_Profile *prof = + multi_prof->get_profile (index); + + this->ior_info_.profiles[index] = + prof->create_tagged_profile (); + } + + delete multi_prof; + } + + return mprofile.get_current_handle (); +} + // **************************************************************** TAO_GIOP_Twoway_Invocation::~TAO_GIOP_Twoway_Invocation (void) @@ -887,7 +956,29 @@ TAO_GIOP_Twoway_Invocation::invoke_i (CORBA::Environment &ACE_TRY_ENV) // Handle the forwarding and return so the stub restarts the // request! return this->location_forward (this->inp_stream (), ACE_TRY_ENV); - // NOT REACHED. + case TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE: + { + // We have received an exception with a request to change the + // addressing mode. First let us read the mode that the + // server/agent asks for. + CORBA::Short addr_mode = 0; + if (this->inp_stream ().read_short (addr_mode) == 0) + { + // Could not demarshal the addressing disposition, raise an local + // CORBA::MARSHAL + ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_MAYBE), + TAO_INVOKE_OK); + } + + // Now set this addressing mode in the stub object, so that + // the next invocation need not go through this. + this->stub_->addressing_mode (addr_mode); + + // Now restart the invocation + return TAO_INVOKE_RESTART; + } + } return TAO_INVOKE_OK; @@ -1112,6 +1203,28 @@ TAO_GIOP_Oneway_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV) // request! return this->location_forward (rd.reply_cdr (), ACE_TRY_ENV); + case TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE: + { + // We have received an exception with a request to change the + // addressing mode. First let us read the mode that the + // server/agent asks for. + CORBA::Short addr_mode = 0; + if (rd.reply_cdr ().read_short (addr_mode) == 0) + { + // Could not demarshal the addressing disposition, raise an local + // CORBA::MARSHAL + ACE_THROW_RETURN (CORBA::MARSHAL (TAO_DEFAULT_MINOR_CODE, + CORBA::COMPLETED_MAYBE), + TAO_INVOKE_OK); + } + + // Now set this addressing mode in the stub object, so that + // the next invocation need not go through this. + this->stub_->addressing_mode (addr_mode); + + // Now restart the invocation + return TAO_INVOKE_RESTART; + } } return TAO_INVOKE_OK; @@ -1242,7 +1355,7 @@ TAO_GIOP_Locate_Request_Invocation::invoke (CORBA::Environment &ACE_TRY_ENV) { case TAO_GIOP_OBJECT_HERE: break; - + case TAO_GIOP_UNKNOWN_OBJECT: ACE_THROW_RETURN (CORBA::OBJECT_NOT_EXIST (TAO_DEFAULT_MINOR_CODE, CORBA::COMPLETED_YES), diff --git a/TAO/tao/Invocation.h b/TAO/tao/Invocation.h index 0985c48d4c8..7ce35374935 100644 --- a/TAO/tao/Invocation.h +++ b/TAO/tao/Invocation.h @@ -146,6 +146,11 @@ protected: // In any case we must demarshal the object reference and setup the // profiles. // It returns TAO_INVOKE_RESTART unless an exception is raised. + + CORBA::ULong create_ior_info (void); + // Create the IOP::IOR info. We will create the info atmost + // once. This method will not work for RTCorba - Bala + protected: TAO_Stub *stub_; // The object on which this invocation is going. @@ -175,6 +180,14 @@ protected: ACE_Time_Value *max_wait_time_; // The timeout remaining for this request, it is initialized in // start() and updated as required. + + IOP::IOR ior_info_; + // The ior info. This would be needed for GIOP 1.2, as the clients + // could receive an exception from the server asking for this + // info. The exception that the client receives is + // LOC_NEEDS_ADDRESSING_MODE. If we receive an exception we will + // fill up this data atmost *once* and send it to the server. + }; // **************************************************************** diff --git a/TAO/tao/MProfile.h b/TAO/tao/MProfile.h index 209ea9d223a..eac409da8ff 100644 --- a/TAO/tao/MProfile.h +++ b/TAO/tao/MProfile.h @@ -101,6 +101,9 @@ public: TAO_PHandle get_current_handle (void); // Returns the index for the current profile. + TAO_PHandle get_current_handle (void) const; + // Returns the index for the current profile. + CORBA::ULong profile_count (void) const; // Returns the number of profiles stored in the list (last_+1). @@ -111,7 +114,7 @@ public: const TAO_Profile* get_profile (CORBA::ULong slot) const; // Return the profile at position <slot>. If <slot> is out of range // it returns 0. - + void rewind (void); // Sets the current slot back to 0. diff --git a/TAO/tao/MProfile.i b/TAO/tao/MProfile.i index 54c46dc744d..e87a921640f 100644 --- a/TAO/tao/MProfile.i +++ b/TAO/tao/MProfile.i @@ -125,6 +125,15 @@ TAO_MProfile::get_current_handle (void) return 0; } +ACE_INLINE TAO_PHandle +TAO_MProfile::get_current_handle (void) const +{ + if (current_ > 0) + return current_ - 1; + else + return 0; +} + ACE_INLINE void TAO_MProfile::rewind (void) { diff --git a/TAO/tao/Makefile b/TAO/tao/Makefile index dc1239ddca3..33dee6359a2 100644 --- a/TAO/tao/Makefile +++ b/TAO/tao/Makefile @@ -107,7 +107,8 @@ GIOP_Message_Headers \ target_specification \ GIOP_Server_Request \ GIOP_Message_Lite \ -GIOP_Message_State +GIOP_Message_State \ +Tagged_Profile DEFAULT_RESOURCES_FILES = \ default_client \ diff --git a/TAO/tao/Pluggable.h b/TAO/tao/Pluggable.h index 00374ef5c0f..dcdb9001662 100644 --- a/TAO/tao/Pluggable.h +++ b/TAO/tao/Pluggable.h @@ -297,6 +297,14 @@ public: // is used for determining how many profiles will be generated // for this acceptor. + virtual int object_key (IOP::TaggedProfile &profile, + TAO_ObjectKey &key) = 0; + // This method fetches the <key> from the <profile>. Protocols that + // are pluggable can send data that are specific in the + // <profile_data> field encapsulated as a octet stream. This method + // allows those protocols to get the object key from the + // encapsulation. + protected: CORBA::Short priority_; // The priority for this endpoint diff --git a/TAO/tao/Pluggable_Messaging_Utils.h b/TAO/tao/Pluggable_Messaging_Utils.h index 6cd322ed4d1..42d66a52b30 100644 --- a/TAO/tao/Pluggable_Messaging_Utils.h +++ b/TAO/tao/Pluggable_Messaging_Utils.h @@ -149,7 +149,7 @@ enum TAO_Pluggable_Message_Exception_Type TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM, // PLUGGABLE_MESSAGE 1.2, Reply is a location forward perm type.. - TAO_PLUGABLE_MESSAGE_NEEDS_ADDRESSING_MODE + TAO_PLUGGABLE_MESSAGE_NEEDS_ADDRESSING_MODE // GIOP1.2, }; diff --git a/TAO/tao/Profile.cpp b/TAO/tao/Profile.cpp index 1e0d585d599..87053bad885 100644 --- a/TAO/tao/Profile.cpp +++ b/TAO/tao/Profile.cpp @@ -17,7 +17,8 @@ TAO_Profile::~TAO_Profile (void) // **************************************************************** TAO_Unknown_Profile::TAO_Unknown_Profile (CORBA::ULong tag) - : TAO_Profile (tag) + : TAO_Profile (tag), + tagged_profile_ () { } @@ -104,3 +105,14 @@ TAO_Unknown_Profile::reset_hint (void) { // do nothing } + +IOP::TaggedProfile& +TAO_Unknown_Profile::create_tagged_profile (void) +{ + this->tagged_profile_.tag = this->tag (); + + // I dont know about the rest, so we return our copy + return this->tagged_profile_; + +} + diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h index 17314a326e9..a64c1a8a78b 100644 --- a/TAO/tao/Profile.h +++ b/TAO/tao/Profile.h @@ -110,6 +110,14 @@ public: // This method is used with a connection has been reset requiring // the hint to be cleaned up and reset to NULL. + virtual IOP::TaggedProfile &create_tagged_profile (void) = 0; + // This method is used to get the IOP::taggedProfile. The profile + // information that is received from the server side would have + // already been decoded. So this method will just make a + // IOP::TaggedProfile struct from the existing information and + // return the reference to that. This method is necessary for GIOP + // 1.2. + private: TAO_MProfile *forward_to_i (void); // this object keeps ownership of this object @@ -166,9 +174,11 @@ public: CORBA::Environment &ACE_TRY_ENV); virtual int addr_to_string(char *buffer, size_t length); virtual void reset_hint (void); - + virtual IOP::TaggedProfile &create_tagged_profile (void); + private: TAO_opaque body_; + IOP::TaggedProfile tagged_profile_; }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/SHMIOP_Acceptor.cpp b/TAO/tao/SHMIOP_Acceptor.cpp index e625c78f935..dc91873f702 100644 --- a/TAO/tao/SHMIOP_Acceptor.cpp +++ b/TAO/tao/SHMIOP_Acceptor.cpp @@ -248,6 +248,57 @@ TAO_SHMIOP_Acceptor::open_i (TAO_ORB_Core* orb_core) return 0; } + +int +TAO_SHMIOP_Acceptor::object_key (IOP::TaggedProfile &profile, + TAO_ObjectKey &object_key) +{ + // Create the decoding stream from the encapsulation in the buffer, + TAO_InputCDR cdr (profile.profile_data.mb ()); + + CORBA::Octet major, minor; + + // Read the version. We just read it here. We don't*do any* + // processing. + if (!(cdr.read_octet (major) + && cdr.read_octet (minor))) + { + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) IIOP_Profile::decode - v%d.%d\n"), + major, + minor)); + } + return -1; + } + + CORBA::String_var host; + CORBA::UShort port = 0; + + // Get host and port. No processing here too.. + if (cdr.read_string (host.out ()) == 0 + || cdr.read_ushort (port) == 0) + { + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) TAO_Tagged_Profile::decode - ") + ACE_TEXT ("error while decoding host/port"))); + } + return -1; + } + + // ... and object key. + if ((cdr >> object_key) == 0) + return -1; + + // We are NOT bothered about the rest. + + return 1; +} + + CORBA::ULong TAO_SHMIOP_Acceptor::endpoint_count (void) { diff --git a/TAO/tao/SHMIOP_Acceptor.h b/TAO/tao/SHMIOP_Acceptor.h index feec7372933..137c83e7888 100644 --- a/TAO/tao/SHMIOP_Acceptor.h +++ b/TAO/tao/SHMIOP_Acceptor.h @@ -72,6 +72,8 @@ public: virtual int is_collocated (const TAO_Profile* profile); virtual CORBA::ULong endpoint_count (void); + virtual int object_key (IOP::TaggedProfile &profile, + TAO_ObjectKey &key); private: int open_i (TAO_ORB_Core* orb_core); // Implement the common part of the open*() methods. diff --git a/TAO/tao/SHMIOP_Profile.cpp b/TAO/tao/SHMIOP_Profile.cpp index a25530eab77..ccb1f11a24a 100644 --- a/TAO/tao/SHMIOP_Profile.cpp +++ b/TAO/tao/SHMIOP_Profile.cpp @@ -40,7 +40,8 @@ TAO_SHMIOP_Profile::TAO_SHMIOP_Profile (const ACE_MEM_Addr &addr, object_key_ (object_key), object_addr_ (addr.get_remote_addr ()), hint_ (0), - orb_core_ (orb_core) + orb_core_ (orb_core), + tagged_profile_ () { this->set (addr.get_remote_addr ()); } @@ -448,6 +449,50 @@ TAO_SHMIOP_Profile::encode (TAO_OutputCDR &stream) const this->orb_core_->to_iso8859 (), this->orb_core_->to_unicode ()); + this->create_profile_body (encap); + + // write the encapsulation as an octet sequence... + stream << CORBA::ULong (encap.total_length ()); + stream.write_octet_array_mb (encap.begin ()); + + 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_->orb_params ()->cdr_memcpy_tradeoff (), + this->orb_core_->to_iso8859 (), + this->orb_core_->to_unicode ()); + + // Create the profile body + this->create_profile_body (encap); + + // Place the message block in to the Sequence of Octets that we + // have + this->tagged_profile_.profile_data.replace ( + (CORBA::ULong) encap.total_length (), + encap.begin ()); + } + + return this->tagged_profile_; +} + + +void +TAO_SHMIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const +{ encap.write_octet (TAO_ENCAP_BYTE_ORDER); // The GIOP version @@ -466,12 +511,6 @@ TAO_SHMIOP_Profile::encode (TAO_OutputCDR &stream) const if (this->version_.major > 1 || this->version_.minor > 0) this->tagged_components ().encode (encap); - - // write the encapsulation as an octet sequence... - stream << CORBA::ULong (encap.total_length ()); - stream.write_octet_array_mb (encap.begin ()); - - return 1; } #endif /* TAO_HAS_SHMIOP && TAO_HAS_SHMIOP != 0 */ diff --git a/TAO/tao/SHMIOP_Profile.h b/TAO/tao/SHMIOP_Profile.h index 9237c47da91..c54bce9f640 100644 --- a/TAO/tao/SHMIOP_Profile.h +++ b/TAO/tao/SHMIOP_Profile.h @@ -146,6 +146,9 @@ public: void reset_hint (void); // Reset the hint's value. + IOP::TaggedProfile &create_tagged_profile (void); + // Please refer to Profile.h for the documentation of this method + private: int set (const ACE_INET_Addr &addr); // helper method to set the INET_Addr. @@ -156,6 +159,9 @@ private: private: + void create_profile_body (TAO_OutputCDR &cdr) const; + // Create an encapsulation of the struct ProfileBody in <cdr> + CORBA::String_var host_; // String representing the hosts name. @@ -178,6 +184,9 @@ private: TAO_ORB_Core *orb_core_; // ORB Core. + + IOP::TaggedProfile tagged_profile_; + // The tagged profile info }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/Stub.cpp b/TAO/tao/Stub.cpp index 4be37dc2884..d8f9bb5d5cc 100644 --- a/TAO/tao/Stub.cpp +++ b/TAO/tao/Stub.cpp @@ -47,13 +47,13 @@ TAO_Stub::TAO_Stub (char *repository_id, first_locate_request_ (0), orb_core_ (orb_core), orb_ (), - servant_orb_ () - + servant_orb_ (), #if (TAO_HAS_CORBA_MESSAGING == 1) - - , policies_ (0) + + policies_ (0), #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ + addressing_mode_ (0) { if (this->orb_core_ == 0) diff --git a/TAO/tao/Stub.h b/TAO/tao/Stub.h index 70537d923e6..061a4a81031 100644 --- a/TAO/tao/Stub.h +++ b/TAO/tao/Stub.h @@ -275,17 +275,17 @@ public: // Just forward profiles. void use_locate_requests (CORBA::Boolean use_it); // set the flags to use locate_requests. - + void set_valid_profile (void); - // NON-THREAD-SAFE. Will set profile_success_ to 0. - - CORBA::Boolean valid_profile (void); - // returns TRUE if a connection was successful with at least - // one profile. + // NON-THREAD-SAFE. Will set profile_success_ to 0. - TAO_Profile *base_profiles (const TAO_MProfile& mprofiles); - // Initialize the base_profiles_ and set profile_in_use_ to - // reference the first profile. + CORBA::Boolean valid_profile (void); + // returns TRUE if a connection was successful with at least + // one profile. + + TAO_Profile *base_profiles (const TAO_MProfile& mprofiles); + // Initialize the base_profiles_ and set profile_in_use_ to + // reference the first profile. void add_forward_profiles (const TAO_MProfile &mprofiles); // THREAD SAFE. @@ -312,6 +312,12 @@ public: // return a copy of the orb since the accessing of the ORB is considered // temporary. + void addressing_mode (CORBA::Short addr_mode); + // Set the addressing mode + + CORBA::Short addressing_mode (void); + // Return the Addressing mode + protected: #if (TAO_HAS_MINIMUM_CORBA == 0) @@ -402,6 +408,9 @@ private: #endif /* TAO_HAS_CORBA_MESSAGING == 1 */ + CORBA::Short addressing_mode_; + // The addressing mode + // = Disallow copy constructor and assignment operator ACE_UNIMPLEMENTED_FUNC (TAO_Stub (const TAO_Stub &)) ACE_UNIMPLEMENTED_FUNC (TAO_Stub &operator = (const TAO_Stub &)) diff --git a/TAO/tao/Stub.i b/TAO/tao/Stub.i index 925b440a5f6..0e80536460a 100644 --- a/TAO/tao/Stub.i +++ b/TAO/tao/Stub.i @@ -256,6 +256,19 @@ TAO_Stub::servant_orb (CORBA::ORB_ptr orb) this->servant_orb_ = CORBA::ORB::_duplicate (orb); } + +ACE_INLINE void +TAO_Stub::addressing_mode (CORBA::Short addr) +{ + this->addressing_mode_ = addr; +} + +ACE_INLINE CORBA::Short +TAO_Stub::addressing_mode (void) +{ + return this->addressing_mode_; +} + // Creator methods for TAO_Stub_Auto_Ptr (TAO_Stub Auto Pointer) ACE_INLINE TAO_Stub_Auto_Ptr::TAO_Stub_Auto_Ptr (TAO_Stub *p) diff --git a/TAO/tao/Tagged_Profile.cpp b/TAO/tao/Tagged_Profile.cpp new file mode 100644 index 00000000000..454895089c5 --- /dev/null +++ b/TAO/tao/Tagged_Profile.cpp @@ -0,0 +1,44 @@ +// $Id$ + +#include "tao/Tagged_Profile.h" +#include "tao/ORB_Core.h" +#include "tao/Acceptor_Registry.h" +#include "tao/Pluggable.h" +#include "tao/debug.h" + +#if !defined (__ACE_INLINE__) +# include "tao/Tagged_Profile.i" +#endif /* ! __ACE_INLINE__ */ + +ACE_RCSID(tao, Tagged_Profile, "$Id$") + +CORBA::Boolean +TAO_Tagged_Profile::extract_object_key (IOP::TaggedProfile &profile) +{ + // Get our Acceptor registry + TAO_Acceptor_Registry *acceptor_registry = + this->orb_core_->acceptor_registry (); + + // Get the right acceptor for the tag in the TaggedProfile + TAO_Acceptor *acceptor = + acceptor_registry->get_acceptor (profile.tag); + + if (acceptor) + { + // Get the object key + int retval = + acceptor->object_key (profile, + this->object_key_); + if (retval == -1) + return 0; + } + else + { + if (TAO_debug_level > 0) + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("(%P|%t)TAO_Tagged_Profile \n")), + 0); + } + + return 1; +} diff --git a/TAO/tao/Tagged_Profile.h b/TAO/tao/Tagged_Profile.h new file mode 100644 index 00000000000..a4b32168368 --- /dev/null +++ b/TAO/tao/Tagged_Profile.h @@ -0,0 +1,102 @@ +// -*- C++ -*- +// $Id$ + +// ============================================================================ +// +// = LIBRARY +// TAO +// +// = FILENAME +// Tagged_Profile.h +// +// = AUTHOR +// Bala Natarajan <bala@cs.wustl.edu> +// +// ============================================================================ + +#ifndef TAO_TAGGED_PROFILE_H +#define TAO_TAGGED_PROFILE_H +#include "ace/pre.h" + +#include "tao/IOPC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/GIOPC.h" + + +class TAO_Export TAO_Tagged_Profile +{ + // + // = TITLE + // Implementation of one of the GIOP 1.2 Target Address + // recognition mode + // + // = DESCRIPTION + // This class is used to manipulate and access the profile_data + // field of an IIOP profile (and other GIOP profiles). + // The definition for that field is simply a sequence of the + // following structures: + // + // struct ProfileBody + // { + // Version iiop_version; + // string host; + // unsigned short port; + // sequence<octet> object_key; + // sequence <IOP::TaggedComponent> components; + // }; + // + // the real motivation is to store the details sent by a client + // and use only the object key which is relevant to a TAO server + // as on date. + // +public: + TAO_Tagged_Profile (TAO_ORB_Core *orb_core); + // Ctor + + TAO_ObjectKey &object_key (void); + // Return the object key + + void object_key (TAO_ObjectKey &object_key); + // Save the object key + + const TAO_ObjectKey &object_key (void) const; + // Return a const object key + + IOP::TaggedProfile &tagged_profile (void); + // get the tagged_profile + + GIOP::IORAddressingInfo &addressing_info (void); + // get the addressing info + + CORBA::Boolean extract_object_key (IOP::TaggedProfile &profile); + // Extract the object key from the TaggedProfile and store it in + // <object_key_> + +private: + TAO_ORB_Core *orb_core_; + // Our ORB Core + + TAO_ObjectKey object_key_; + // The object key + + IOP::TaggedProfile profile_; + // The Tagged profile. This class would have the Tagged Profile + + GIOP::IORAddressingInfo addr_info_; + // The addressing info + + // The above two declarations are not used in TAO as on date. It is + // here so that we can use this anyday. The object_key extracted + // from these would still be available in <object_key_>. +}; + +#if defined (__ACE_INLINE__) +# include "tao/Tagged_Profile.i" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /*TAO_TAGGED_PROFILE_H*/ diff --git a/TAO/tao/Tagged_Profile.i b/TAO/tao/Tagged_Profile.i new file mode 100644 index 00000000000..cccf1d21463 --- /dev/null +++ b/TAO/tao/Tagged_Profile.i @@ -0,0 +1,46 @@ +// -*- C++ -*- +// $Id$ + +ACE_INLINE +TAO_Tagged_Profile::TAO_Tagged_Profile (TAO_ORB_Core *orb_core) + : orb_core_ (orb_core), + object_key_ (), + profile_ (), + addr_info_ () +{ + +} + + +ACE_INLINE TAO_ObjectKey & +TAO_Tagged_Profile::object_key (void) +{ + return this->object_key_; +} + +ACE_INLINE const TAO_ObjectKey & +TAO_Tagged_Profile::object_key (void) const +{ + return this->object_key_; +} + +ACE_INLINE void +TAO_Tagged_Profile::object_key (TAO_ObjectKey &object_key) +{ + this->object_key_.replace (object_key.length (), + object_key.length (), + object_key.get_buffer ()); + +} + +ACE_INLINE IOP::TaggedProfile & +TAO_Tagged_Profile::tagged_profile (void) +{ + return this->profile_; +} + +ACE_INLINE GIOP::IORAddressingInfo & +TAO_Tagged_Profile::addressing_info (void) +{ + return this->addr_info_; +} diff --git a/TAO/tao/UIOP_Acceptor.cpp b/TAO/tao/UIOP_Acceptor.cpp index 599b4661406..64408b21c27 100644 --- a/TAO/tao/UIOP_Acceptor.cpp +++ b/TAO/tao/UIOP_Acceptor.cpp @@ -298,6 +298,49 @@ TAO_UIOP_Acceptor::endpoint_count (void) } int +TAO_UIOP_Acceptor::object_key (IOP::TaggedProfile &profile, + TAO_ObjectKey &object_key) +{ + // Create the decoding stream from the encapsulation in the buffer, + TAO_InputCDR cdr (profile.profile_data.mb ()); + + CORBA::Octet major, minor; + + // Read the version. We just read it here. We don't*do any* + // processing. + if (!(cdr.read_octet (major) + && cdr.read_octet (minor))) + { + if (TAO_debug_level > 0) + { + ACE_DEBUG ((LM_DEBUG, + ACE_TEXT ("TAO (%P|%t) IIOP_Profile::decode - v%d.%d\n"), + major, + minor)); + } + return -1; + } + + char *rendezvous = 0; + + // Get rendezvous_point + if (cdr.read_string (rendezvous) == 0) + { + ACE_DEBUG ((LM_DEBUG, "error decoding UIOP rendezvous_point")); + return -1; + } + + // delete the rendezvous point. We don't do any processing. + delete [] rendezvous; + + // ... and object key. + if ((cdr >> object_key) == 0) + return -1; + + return 1; +} + +int TAO_UIOP_Acceptor::parse_options (const char *str) { if (str == 0) diff --git a/TAO/tao/UIOP_Acceptor.h b/TAO/tao/UIOP_Acceptor.h index dfde5cb6456..3f5b0152819 100644 --- a/TAO/tao/UIOP_Acceptor.h +++ b/TAO/tao/UIOP_Acceptor.h @@ -75,6 +75,8 @@ public: virtual int is_collocated (const TAO_Profile* profile); virtual CORBA::ULong endpoint_count (void); + virtual int object_key (IOP::TaggedProfile &profile, + TAO_ObjectKey &key); private: int open_i (TAO_ORB_Core *orb_core, const char *rendezvous); // Implement the common part of the open*() methods diff --git a/TAO/tao/UIOP_Profile.cpp b/TAO/tao/UIOP_Profile.cpp index b83b8663937..9db7961bbc3 100644 --- a/TAO/tao/UIOP_Profile.cpp +++ b/TAO/tao/UIOP_Profile.cpp @@ -39,7 +39,8 @@ TAO_UIOP_Profile::TAO_UIOP_Profile (const ACE_UNIX_Addr &addr, object_key_ (object_key), object_addr_ (addr), hint_ (0), - orb_core_ (orb_core) + orb_core_ (orb_core), + tagged_profile_ () { } @@ -361,6 +362,50 @@ TAO_UIOP_Profile::encode (TAO_OutputCDR &stream) const this->orb_core_->to_iso8859 (), this->orb_core_->to_unicode ()); + // Create the profile body + this->create_profile_body (encap); + + // write the encapsulation as an octet sequence... + stream << CORBA::ULong (encap.total_length ()); + stream.write_octet_array_mb (encap.begin ()); + + 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_->orb_params ()->cdr_memcpy_tradeoff (), + this->orb_core_->to_iso8859 (), + this->orb_core_->to_unicode ()); + + // Create the profile body + this->create_profile_body (encap); + + // Place the message block in to the Sequence of Octets that we + // have + this->tagged_profile_.profile_data.replace ( + (CORBA::ULong) encap.total_length (), + encap.begin ()); + } + + return this->tagged_profile_; +} + +void +TAO_UIOP_Profile::create_profile_body (TAO_OutputCDR &encap) const +{ // CHAR describing byte order, starting the encapsulation encap.write_octet (TAO_ENCAP_BYTE_ORDER); @@ -377,12 +422,6 @@ TAO_UIOP_Profile::encode (TAO_OutputCDR &stream) const if (this->version_.major > 1 || this->version_.minor > 0) this->tagged_components ().encode (encap); - - // write the encapsulation as an octet sequence... - stream << CORBA::ULong (encap.total_length ()); - stream.write_octet_array_mb (encap.begin ()); - - return 1; } #endif /* TAO_HAS_UIOP == 1 */ diff --git a/TAO/tao/UIOP_Profile.h b/TAO/tao/UIOP_Profile.h index dce95a60d34..c054371f257 100644 --- a/TAO/tao/UIOP_Profile.h +++ b/TAO/tao/UIOP_Profile.h @@ -134,6 +134,9 @@ public: void reset_hint (void); // Reset the hint's value. + IOP::TaggedProfile &create_tagged_profile (void); + // Please see the Profile.h for the documentation of this method + private: ACE_UNIMPLEMENTED_FUNC (TAO_UIOP_Profile (const TAO_UIOP_Profile &)) @@ -142,6 +145,9 @@ private: private: + void create_profile_body (TAO_OutputCDR &cdr) const; + // Create an encapsulation of the struct ProfileBody in <cdr> + TAO_GIOP_Version version_; // UIOP version number. @@ -161,6 +167,9 @@ private: TAO_ORB_Core *orb_core_; // ORB Core. + + IOP::TaggedProfile tagged_profile_; + // Our tagged profile info }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/operation_details.h b/TAO/tao/operation_details.h index 574fd258114..fe9c5cf85bc 100644 --- a/TAO/tao/operation_details.h +++ b/TAO/tao/operation_details.h @@ -18,6 +18,7 @@ #include "tao/corbafwd.h" #include "tao/IOPC.h" +#include "tao/target_specification.h" // @@ Bala: Why is this not part of the RequestHeader?! class TAO_Operation_Details @@ -56,7 +57,16 @@ public: CORBA::ULong request_id (void); CORBA::ULong request_id (void) const; - // Get and set for request id + // Get for request id + + TAO_Target_Specification::TAO_Target_Address addressing_mode (void); + TAO_Target_Specification::TAO_Target_Address + addressing_mode (void) const; + // Get method for the addressing mode + + void + addressing_mode (CORBA::Short addr); + // Set method for the addressing mode private: const char *opname_; @@ -80,6 +90,9 @@ private: // transaction service APIs. Other kinds of context are as yet // undefined. // + + TAO_Target_Specification::TAO_Target_Address addressing_mode_; + // Addressing mode for this request. }; #if defined (__ACE_INLINE__) diff --git a/TAO/tao/operation_details.i b/TAO/tao/operation_details.i index 8e0dbe46c8a..736261b89f7 100644 --- a/TAO/tao/operation_details.i +++ b/TAO/tao/operation_details.i @@ -1,12 +1,13 @@ -//$Id$ // -*- C++ -*- +//$Id$ ACE_INLINE TAO_Operation_Details::TAO_Operation_Details (const char *name, CORBA::ULong len) :opname_ (name), opname_len_ (len), request_id_ (0), - response_flags_ (0) + response_flags_ (0), + addressing_mode_ (TAO_Target_Specification::Key_Addr) { //no-op } @@ -70,3 +71,28 @@ TAO_Operation_Details::response_flags (void) const { return this->response_flags_; } + +ACE_INLINE TAO_Target_Specification::TAO_Target_Address +TAO_Operation_Details::addressing_mode (void) +{ + return this->addressing_mode_; +} + +ACE_INLINE TAO_Target_Specification::TAO_Target_Address +TAO_Operation_Details::addressing_mode (void) const +{ + return this->addressing_mode_; +} + +ACE_INLINE void +TAO_Operation_Details:: + addressing_mode (CORBA::Short mode) +{ + if (mode == 0) + this->addressing_mode_ = TAO_Target_Specification::Key_Addr; + else if (mode == 1) + this->addressing_mode_ = TAO_Target_Specification::Profile_Addr; + else if (mode == 2) + this->addressing_mode_ = TAO_Target_Specification::Reference_Addr; +} + diff --git a/TAO/tao/orbconf.h b/TAO/tao/orbconf.h index 2e5692e94e8..e562c879aa4 100644 --- a/TAO/tao/orbconf.h +++ b/TAO/tao/orbconf.h @@ -843,7 +843,7 @@ and should not be set by the user. Please use TAO_HAS_REMOTE_POLICIES instead. #define TAO_DEF_GIOP_MAJOR 1 #endif /* TAO_DEF_GIOP_MAJOR */ #if !defined (TAO_DEF_GIOP_MINOR) -#define TAO_DEF_GIOP_MINOR 1 +#define TAO_DEF_GIOP_MINOR 2 #endif /* TAO_DEF_GIOP_MINOR */ // By default TAO generate the OMG standard profile components diff --git a/TAO/tao/target_specification.h b/TAO/tao/target_specification.h index 2e07be74abd..e78a0374ce6 100644 --- a/TAO/tao/target_specification.h +++ b/TAO/tao/target_specification.h @@ -84,10 +84,10 @@ public: // Set the target specification by giving the object key. - void target_specifier (IOP::TaggedProfile *profile); + void target_specifier (IOP::TaggedProfile &profile); // Set the target specification by passing in an IOP::TaggedProfile. - void target_specifier (IOP::IOR *ior, + void target_specifier (IOP::IOR &ior, CORBA::ULong prof_index); // Specify the target by passing in the IOP::IOR with a profile // index. Please see the header file IOPC.h on why a profile index diff --git a/TAO/tao/target_specification.i b/TAO/tao/target_specification.i index f2bccbace2d..17b942b85c3 100644 --- a/TAO/tao/target_specification.i +++ b/TAO/tao/target_specification.i @@ -28,25 +28,24 @@ TAO_Target_Specification::target_specifier (const TAO_ObjectKey &key) } ACE_INLINE void -TAO_Target_Specification::target_specifier (IOP::TaggedProfile *profile) +TAO_Target_Specification::target_specifier (IOP::TaggedProfile &profile) { - if (profile) - { - this->specifier_ = TAO_Target_Specification::Profile_Addr; - this->u_.profile_ = profile; - } + this->specifier_ = TAO_Target_Specification::Profile_Addr; + this->u_.profile_ = ACE_const_cast (IOP::TaggedProfile *, + &profile); + } ACE_INLINE void -TAO_Target_Specification::target_specifier (IOP::IOR *ior, +TAO_Target_Specification::target_specifier (IOP::IOR &ior, CORBA::ULong prof_index) -{ if (ior) - { - this->specifier_ = TAO_Target_Specification::Reference_Addr; - this->u_.ior_ = ior; - this->profile_index_ = prof_index; - } +{ + this->specifier_ = TAO_Target_Specification::Reference_Addr; + this->u_.ior_ = ACE_const_cast (IOP::IOR *, + &ior); + this->profile_index_ = prof_index; + } ACE_INLINE const TAO_ObjectKey* |