diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-04-20 08:07:58 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-04-20 08:07:58 +0000 |
commit | 5663c6b3ef19398ea57cca072af226ba38caaab2 (patch) | |
tree | c017c63abd2c2e204e92f26c71477fc039fbcf28 /TAO | |
parent | db4ba26a419d6d88d1e6e782c13b7cc14a39bb23 (diff) | |
download | ATCD-5663c6b3ef19398ea57cca072af226ba38caaab2.tar.gz |
Fri Apr 20 08:05:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO')
47 files changed, 674 insertions, 281 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 966452d8ff2..fd39f20d046 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,113 @@ +Fri Apr 20 08:05:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * tao/PortableServer/Collocated_Arguments_Converter.cpp: + * tao/PortableServer/Collocated_Arguments_Converter.h: + * tao/PortableServer/DII_Arguments_Converter.cpp: + * tao/PortableServer/DII_Arguments_Converter.h: + Refactored the DII argument to a generic collocated argument + converter. The issue that was solved for DII is also valid + for AMI. Also made a method for converting the request and + one for the reply, converting the reply is now not done yet but + we do know that also fails. + + * tao/PortableServer/Upcall_Wrapper.cpp: + Changed how the argument converter is retrieved. Instead of retrieving + it using service configurator we put a pointer in the operation details + which is set or not. + + * tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp: + * tao/DynamicInterface/DII_Arguments_Converter_Impl.h: + Updated because the DII base class is renamed: + + * tao/DynamicInterface/DII_Invocation_Adapter.cpp: + * tao/DynamicInterface/DII_Invocation_Adapter.h: + Added new adapter for oneway DII calls so that this adapter can + set the DII Argument Converter for DII oneway calls. + + * tao/DynamicInterface/Request.cpp: + Use false instead of 0, layout changes, use new DII Oneway adapter. + + * tao/DynamicInterface/Request.h: + * tao/Protocol_Factory.cpp: + * tao/IIOP_Profile.cpp: + * tao/PI/PolicyFactoryC.cpp: + Layout changes + + * tao/DynamicInterface/Request.inl: + Use false instead of 0 + + * tao/DynamicInterface/Server_Request.inl: + Use static_cast instead of c-style cast + + * tao/IIOP_Connector.cpp: + Fixed an inconsistent debug statement + + * tao/Invocation_Adapter.cpp: + * tao/Invocation_Adapter.h: + * tao/Invocation_Adapter.inl: + Layout changes and no need to have a member whether we are + a DII invocation or not + + * tao/Makefile.am: + Updated for new files + + * tao/Messaging/AMI_Arguments_Converter_Impl.cpp: + * tao/Messaging/AMI_Arguments_Converter_Impl.h: + New AMI argument converter + + * tao/Messaging/Asynch_Invocation_Adapter.cpp: + Use the new AMI argument converter which fixes bugzilla 2805. Also + use the + + * tao/Messaging/Messaging_Loader.cpp: + Added include of the AMI Argument converter + + * tao/operation_details.cpp: + * tao/operation_details.h: + * tao/operation_details.inl: + Instead of storing whether we have a DII call or not, we store + a pointer to a collocated argument converter that is set or not set + + * tao/ORB_Core.cpp: + * tao/ORB_Core.h: + * tao/params.cpp: + * tao/params.h: + * tao/params.inl: + Added a new -ORBAMICollication which is default yes. If this is no, + then when a collocated AMI invocation is made, the call is converted + to a remote call so that another thread can handle the servant. Also + the problems with argument corruption are then gone. This is for + bugzilla 2351. + + * tao/Profile.h: + Documentation fix + + * tao/Profile_Transport_Resolver.cpp: + * tao/Profile_Transport_Resolver.h: + * tao/PortableServer/POAManager.h: + * tao/PortableServer/POAManagerFactory.cpp: + Layout changes + + * tao/Stub.inl: + * tao/TAO_Server_Request.cpp: + * tao/TAO_Server_Request.h: + * tao/TAO_Server_Request.inl: + Bool changes + + * tao/TkResource/TkResource_Factory.h: + * tao/QtResource/QtResource_Factory.h: + Removed not used mutex + + * tao/Valuetype/AbstractBase.cpp: + Bool change + + * docs/Options.html: + Document new ORBAMICollocation option, this is default yes which + means that when a collocated AMI call is made the servant is invoked + using the client thread. When this option is no, when a collocated AMI + call is made, this is converted to a remote call so that a different + thread can be used to invoke the servant. + Thu Apr 19 18:24:45 UTC 2007 Wallace Zhang <zhang_w@ociweb.com> * orbsvcs/tests/Bug_2248_Regression/Bug_2248_Regression.mpc: diff --git a/TAO/docs/Options.html b/TAO/docs/Options.html index ea3be5d34cb..fbe483bc500 100644 --- a/TAO/docs/Options.html +++ b/TAO/docs/Options.html @@ -367,6 +367,16 @@ strategy, your interfaces must be compiled with the <code><a href="compiler.html">compiler option</a>. </td> </tr> <tr> + <td><code>-ORBAMICollocation</code> <em>1|0</em> + </td> + <td>Specifies what happens when making collocated AMI invocations. + When 1 (default) an AMI call will be done on a collocated + servant and the client thread will be used to invoke the + servant, when 0 the collocated call will be converted + to a remote call so that a different thread could be used + to execute the servant.</td> + </tr> + <tr> <td><code>-ORBNodelay</code> <em>boolean (0|1)</em></td> <td><a name="-ORBNodelay"></a>Enable or disable the <code>TCP_NODELAY</code> option (Nagle's algorithm). By default, <code>TCP_NODELAY</code> is @@ -1106,7 +1116,7 @@ until all the data is sent. <td><a name="-ORBZeroCopyWrite"></a> Use a zero copy write protocol, which at this moment the only option is sendfile. If your platform does support sendfile but you don't want - that TAO uses it you can disable + that TAO uses it you can disable sendfile in TAO by add the define <code>TAO_HAS_SENDFILE 0</code> to your config.h file. </td> diff --git a/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp b/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp index 4f0462c8ce7..cc8d899d14e 100644 --- a/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp +++ b/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.cpp @@ -13,7 +13,7 @@ ACE_RCSID (DynamicInterface, TAO_BEGIN_VERSIONED_NAMESPACE_DECL void -TAO_DII_Arguments_Converter_Impl::convert ( +TAO_DII_Arguments_Converter_Impl::convert_request ( TAO_ServerRequest & server_request, TAO::Argument * const args[], size_t nargs) @@ -74,6 +74,14 @@ TAO_DII_Arguments_Converter_Impl::convert ( details->use_stub_args (false); } +void +TAO_DII_Arguments_Converter_Impl::convert_reply ( + TAO_ServerRequest & /*server_request*/, + TAO::Argument * const /*args*/[], + size_t /*nargs*/) +{ + // TODO +} // ********************************************************************* diff --git a/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.h b/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.h index 9d9f9e360e8..d7859e8b464 100644 --- a/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.h +++ b/TAO/tao/DynamicInterface/DII_Arguments_Converter_Impl.h @@ -22,7 +22,7 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ -#include "tao/PortableServer/DII_Arguments_Converter.h" +#include "tao/PortableServer/Collocated_Arguments_Converter.h" #include "ace/Service_Config.h" @@ -30,21 +30,25 @@ TAO_BEGIN_VERSIONED_NAMESPACE_DECL /** - * @class DII_Arguments_Converter_Impl + * @class TAO_DII_Arguments_Converter_Impl * - * @brief DII_Arguments_Converter_Impl. + * @brief TAO_DII_Arguments_Converter_Impl. * * This class provides the implementation to expand the DII arguments in NVList * to the list of arguments. */ class TAO_DynamicInterface_Export TAO_DII_Arguments_Converter_Impl - : public TAO_DII_Arguments_Converter + : public TAO::Collocated_Arguments_Converter { public: - virtual void convert (TAO_ServerRequest & server_request, - TAO::Argument * const args[], - size_t nargs); + virtual void convert_request (TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs); + + virtual void convert_reply (TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs); // Used to force the initialization of the ORB code. static int Initializer (void); diff --git a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp index 76922e3d88d..3d0e6e694b8 100644 --- a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp +++ b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.cpp @@ -2,6 +2,8 @@ #include "tao/DynamicInterface/DII_Invocation_Adapter.h" #include "tao/DynamicInterface/DII_Invocation.h" #include "tao/DynamicInterface/DII_Reply_Dispatcher.h" +#include "tao/DynamicInterface/DII_Arguments_Converter_Impl.h" +#include "tao/DynamicInterface/Request.h" #include "tao/Exception.h" #include "tao/ORB_Constants.h" @@ -10,7 +12,7 @@ #include "tao/Transport.h" #include "tao/Pluggable_Messaging.h" #include "tao/SystemException.h" -#include "tao/DynamicInterface/Request.h" +#include "tao/operation_details.h" #include "ace/os_include/os_errno.h" @@ -39,8 +41,7 @@ namespace TAO op_len, 0, // Collocation Proxy broker pointer TAO_TWOWAY_INVOCATION, - mode, - true) // is a dii request + mode) , exception_list_ (excp) , request_ (r) { @@ -51,12 +52,29 @@ namespace TAO } Invocation_Status + DII_Invocation_Adapter::invoke_collocated_i ( + TAO_Stub *stub, + TAO_Operation_Details &details, + CORBA::Object_var &effective_target, + Collocation_Strategy strat) + { + TAO_DII_Arguments_Converter_Impl* dii_arguments_converter + = ACE_Dynamic_Service<TAO_DII_Arguments_Converter_Impl>::instance ( + "DII_Arguments_Converter"); + details.cac (dii_arguments_converter); + + return Invocation_Adapter::invoke_collocated_i (stub, + details, + effective_target, + strat); + } + + Invocation_Status DII_Invocation_Adapter::invoke_twoway ( TAO_Operation_Details &op, CORBA::Object_var &effective_target, Profile_Transport_Resolver &r, - ACE_Time_Value *&max_wait_time - ) + ACE_Time_Value *&max_wait_time) { // Simple sanity check if (this->mode_ != TAO_DII_INVOCATION || @@ -69,7 +87,8 @@ namespace TAO CORBA::COMPLETED_NO); } - r.transport ()->messaging_object ()->out_stream ().reset_byte_order (request_->_tao_byte_order ()); + r.transport ()->messaging_object ()->out_stream ().reset_byte_order ( + request_->_tao_byte_order ()); TAO::DII_Invocation synch (this->target_, r, @@ -85,10 +104,10 @@ namespace TAO effective_target = synch.steal_forwarded_reference (); #if TAO_HAS_INTERCEPTORS == 1 - const CORBA::Boolean permanent_forward = + CORBA::Boolean const permanent_forward = (synch.reply_status() == TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD_PERM); #else - const CORBA::Boolean permanent_forward = false; + CORBA::Boolean const permanent_forward = false; #endif this->object_forwarded (effective_target, r.stub (), @@ -115,8 +134,7 @@ namespace TAO op_len, b, TAO_TWOWAY_INVOCATION, - mode, - true) // is a dii request + mode) , request_ (req) , rd_ (0) , orb_core_ (oc) @@ -129,7 +147,7 @@ namespace TAO unsigned long ex_count) { // New reply dispatcher on the heap, because we will go out of - // scope and hand over the reply dispatcher to the ORB. + // scope and hand over the reply dispatcher to the ORB. // So this->rd_ is 0, because we do not need to // hold a pointer to it. ACE_NEW_THROW_EX (this->rd_, @@ -141,6 +159,24 @@ namespace TAO } Invocation_Status + DII_Deferred_Invocation_Adapter::invoke_collocated_i ( + TAO_Stub *stub, + TAO_Operation_Details &details, + CORBA::Object_var &effective_target, + Collocation_Strategy strat) + { + TAO_DII_Arguments_Converter_Impl* dii_arguments_converter + = ACE_Dynamic_Service<TAO_DII_Arguments_Converter_Impl>::instance ( + "DII_Arguments_Converter"); + details.cac (dii_arguments_converter); + + return Invocation_Adapter::invoke_collocated_i (stub, + details, + effective_target, + strat); + } + + Invocation_Status DII_Deferred_Invocation_Adapter::invoke_twoway ( TAO_Operation_Details &op, CORBA::Object_var &effective_target, @@ -197,11 +233,6 @@ namespace TAO { } - void - DII_Asynch_Invocation_Adapter::invoke_reply_handler (Messaging::ReplyHandler_ptr) - { - } - Invocation_Status DII_Asynch_Invocation_Adapter::invoke_twoway ( TAO_Operation_Details &, @@ -212,5 +243,42 @@ namespace TAO return TAO_INVOKE_FAILURE; } + DII_Oneway_Invocation_Adapter::DII_Oneway_Invocation_Adapter ( + CORBA::Object *target, + Argument **args, + int arg_count, + const char *operation, + int op_len, + TAO::Invocation_Mode mode) + : Invocation_Adapter (target, + args, + arg_count, + operation, + op_len, + 0, + TAO_ONEWAY_INVOCATION, + mode) + { + } + + Invocation_Status + DII_Oneway_Invocation_Adapter::invoke_collocated_i ( + TAO_Stub *stub, + TAO_Operation_Details &details, + CORBA::Object_var &effective_target, + Collocation_Strategy strat) + { + TAO_DII_Arguments_Converter_Impl* dii_arguments_converter + = ACE_Dynamic_Service<TAO_DII_Arguments_Converter_Impl>::instance ( + "DII_Arguments_Converter"); + details.cac (dii_arguments_converter); + + return Invocation_Adapter::invoke_collocated_i (stub, + details, + effective_target, + strat); + } + + } // End namespace TAO TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.h b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.h index c407865c222..b540a7b94b7 100644 --- a/TAO/tao/DynamicInterface/DII_Invocation_Adapter.h +++ b/TAO/tao/DynamicInterface/DII_Invocation_Adapter.h @@ -59,7 +59,7 @@ namespace TAO public Invocation_Adapter { public: - /// The only constructor used by the IDL compiler and onlly way to + /// The only constructor used by the IDL compiler and only way to /// create this adapter. /** * @@ -75,7 +75,7 @@ namespace TAO * * @param operation The name of the operation being invoked. * - * @param ope_len Number of charecters in the operation name. This + * @param op_len Number of characters in the operation name. This * is an optimization which helps us to avoid calling strlen () * while creating a message format. * @@ -101,6 +101,12 @@ namespace TAO Profile_Transport_Resolver &r, ACE_Time_Value *&max_wait_time); + virtual Invocation_Status invoke_collocated_i ( + TAO_Stub *stub, + TAO_Operation_Details &details, + CORBA::Object_var &effective_target, + Collocation_Strategy strat); + private: CORBA::ExceptionList *exception_list_; @@ -138,7 +144,6 @@ namespace TAO /// Invoke the target virtual void invoke (TAO::Exception_Data *ex, unsigned long ex_count); - protected: virtual Invocation_Status invoke_twoway ( TAO_Operation_Details &op, @@ -146,6 +151,12 @@ namespace TAO Profile_Transport_Resolver &r, ACE_Time_Value *&max_wait_time); + virtual Invocation_Status invoke_collocated_i ( + TAO_Stub *stub, + TAO_Operation_Details &details, + CORBA::Object_var &effective_target, + Collocation_Strategy strat); + private: CORBA::Request *request_; @@ -178,22 +189,39 @@ namespace TAO /// Invoke the target void invoke_reply_handler (Messaging::ReplyHandler_ptr reply_handler_ptr); - protected: virtual Invocation_Status invoke_twoway ( TAO_Operation_Details &op, CORBA::Object_var &effective_target, Profile_Transport_Resolver &r, ACE_Time_Value *&max_wait_time); + }; +#endif /* TAO_HAS_AMI */ - private: - /// Reply dispatcher for the current Invocation. - TAO_DII_Asynch_Reply_Dispatcher *rd_; + /** + * @class DII_Oneway_Invocation_Adapter + * + * @brief This class is for oneway DII invocation. + */ + class TAO_DynamicInterface_Export DII_Oneway_Invocation_Adapter + : public Invocation_Adapter + { + public: + DII_Oneway_Invocation_Adapter ( + CORBA::Object *target, + Argument **args, + int arg_number, + const char *operation, + int op_len, + TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION); - /// Cache the orb_core - TAO_ORB_Core *orb_core_; + protected: + virtual Invocation_Status invoke_collocated_i ( + TAO_Stub *stub, + TAO_Operation_Details &details, + CORBA::Object_var &effective_target, + Collocation_Strategy strat); }; -#endif /* TAO_HAS_AMI */ } // End namespace TAO TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/DynamicInterface/Request.cpp b/TAO/tao/DynamicInterface/Request.cpp index 83e7a00448f..1f3882d5937 100644 --- a/TAO/tao/DynamicInterface/Request.cpp +++ b/TAO/tao/DynamicInterface/Request.cpp @@ -72,8 +72,7 @@ CORBA::Request::Request (CORBA::Object_ptr obj, CORBA::NVList_ptr args, CORBA::NamedValue_ptr result, CORBA::Flags flags, - CORBA::ExceptionList_ptr exceptions - ) + CORBA::ExceptionList_ptr exceptions) : target_ (CORBA::Object::_duplicate (obj)), orb_ (CORBA::ORB::_duplicate (orb)), opname_ (CORBA::string_dup (op)), @@ -86,7 +85,7 @@ CORBA::Request::Request (CORBA::Object_ptr obj, ctx_ (CORBA::Context::_nil ()), refcount_ (1), lazy_evaluation_ (false), - response_received_ (0), + response_received_ (false), byte_order_ (TAO_ENCAP_BYTE_ORDER) { if (this->exceptions_.in () == 0) @@ -101,8 +100,7 @@ CORBA::Request::Request (CORBA::Object_ptr obj, CORBA::Request::Request (CORBA::Object_ptr obj, CORBA::ORB_ptr orb, - const CORBA::Char *op - ) + const CORBA::Char *op) : target_ (CORBA::Object::_duplicate (obj)), orb_ (CORBA::ORB::_duplicate (orb)), opname_ (CORBA::string_dup (op)), @@ -112,7 +110,7 @@ CORBA::Request::Request (CORBA::Object_ptr obj, ctx_ (CORBA::Context::_nil ()), refcount_ (1), lazy_evaluation_ (false), - response_received_ (0), + response_received_ (false), byte_order_ (TAO_ENCAP_BYTE_ORDER) { CORBA::ExceptionList *tmp = 0; @@ -190,16 +188,13 @@ CORBA::Request::send_oneway (void) &_tao_in_list }; - TAO::Invocation_Adapter _tao_call ( + TAO::DII_Oneway_Invocation_Adapter _tao_call ( this->target_, _tao_arg_list, sizeof( _tao_arg_list ) / sizeof( TAO::Argument* ), this->opname_, static_cast<CORBA::ULong> (ACE_OS::strlen (this->opname_)), - 0, - TAO::TAO_ONEWAY_INVOCATION, - TAO::TAO_SYNCHRONOUS_INVOCATION, - true); // is_dii_request + TAO::TAO_SYNCHRONOUS_INVOCATION); _tao_call.invoke (0, 0); } @@ -266,12 +261,10 @@ CORBA::Request::sendc (CORBA::Object_ptr handler) sizeof( _tao_arg_list ) / sizeof( TAO::Argument* ), const_cast<char *> (this->opname_), static_cast<CORBA::ULong> (ACE_OS::strlen (this->opname_)), - 0 // collocation proxy broker - ); + 0); // collocation proxy broker _tao_call.invoke (dynamic_cast<Messaging::ReplyHandler_ptr>(handler), &CORBA::Request::_tao_reply_stub); - } void diff --git a/TAO/tao/DynamicInterface/Request.h b/TAO/tao/DynamicInterface/Request.h index 0e577c88818..b7339e90999 100644 --- a/TAO/tao/DynamicInterface/Request.h +++ b/TAO/tao/DynamicInterface/Request.h @@ -212,13 +212,11 @@ namespace CORBA CORBA::NVList_ptr args, CORBA::NamedValue_ptr result, CORBA::Flags flags, - CORBA::ExceptionList_ptr exceptions - ); + CORBA::ExceptionList_ptr exceptions); Request (CORBA::Object_ptr obj, CORBA::ORB_ptr orb, - const CORBA::Char *op - ); + const CORBA::Char *op); ~Request (void); diff --git a/TAO/tao/DynamicInterface/Request.inl b/TAO/tao/DynamicInterface/Request.inl index ccd7468d82c..2e6215e5a06 100644 --- a/TAO/tao/DynamicInterface/Request.inl +++ b/TAO/tao/DynamicInterface/Request.inl @@ -188,7 +188,7 @@ CORBA::Request::response_received (void) ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, ace_mon, this->lock_, - 0); + false); return this->response_received_; } diff --git a/TAO/tao/DynamicInterface/Server_Request.inl b/TAO/tao/DynamicInterface/Server_Request.inl index b8e4bf6099f..926ecbd9532 100644 --- a/TAO/tao/DynamicInterface/Server_Request.inl +++ b/TAO/tao/DynamicInterface/Server_Request.inl @@ -37,7 +37,7 @@ CORBA::ServerRequest::_duplicate (CORBA::ServerRequest_ptr x) ACE_INLINE CORBA::ServerRequest_ptr CORBA::ServerRequest::_nil (void) { - return (CORBA::ServerRequest_ptr)0; + return static_cast <CORBA::ServerRequest_ptr>(0); } ACE_INLINE CORBA::Context_ptr diff --git a/TAO/tao/IIOP_Connector.cpp b/TAO/tao/IIOP_Connector.cpp index 77d80f5cc9b..2aa58fb49fd 100644 --- a/TAO/tao/IIOP_Connector.cpp +++ b/TAO/tao/IIOP_Connector.cpp @@ -204,7 +204,7 @@ TAO_IIOP_Connector::make_connection (TAO::Profile_Transport_Resolver *r, if (TAO_debug_level > 1) { ACE_ERROR ((LM_ERROR, - ACE_TEXT ("(%P|%t) IIOP_Connector::make_connection, ") + ACE_TEXT ("TAO (%P|%t) IIOP_Connector::make_connection, ") ACE_TEXT("connection to <%s:%d> failed (%p)\n"), ACE_TEXT_CHAR_TO_TCHAR (iiop_endpoint->host ()), iiop_endpoint->port (), diff --git a/TAO/tao/IIOP_Profile.cpp b/TAO/tao/IIOP_Profile.cpp index 163245261f5..5053043fd9a 100644 --- a/TAO/tao/IIOP_Profile.cpp +++ b/TAO/tao/IIOP_Profile.cpp @@ -343,8 +343,7 @@ TAO_IIOP_Profile::do_is_equivalent (const TAO_Profile *other_profile) } CORBA::ULong -TAO_IIOP_Profile::hash (CORBA::ULong max - ) +TAO_IIOP_Profile::hash (CORBA::ULong max) { // Get the hash value for all endpoints. CORBA::ULong hashval = 0; diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp index 8753897eb8f..02668cd55d7 100644 --- a/TAO/tao/Invocation_Adapter.cpp +++ b/TAO/tao/Invocation_Adapter.cpp @@ -45,8 +45,7 @@ namespace TAO this->args_, this->number_args_, ex_data, - ex_count, - this->is_dii_request_); + ex_count); this->invoke_i (stub, op_details); } @@ -125,9 +124,7 @@ namespace TAO Invocation_Adapter::get_timeout (TAO_Stub *stub, ACE_Time_Value &timeout) { bool has_timeout = false; - this->target_->orb_core ()->call_timeout_hook (stub, - has_timeout, - timeout); + this->target_->orb_core ()->call_timeout_hook (stub, has_timeout, timeout); return has_timeout; } @@ -135,8 +132,7 @@ namespace TAO TAO_Stub * Invocation_Adapter::get_stub (void) const { - TAO_Stub * const stub = - this->target_->_stubobj (); + TAO_Stub * const stub = this->target_->_stubobj (); if (stub == 0) throw ::CORBA::INTERNAL ( @@ -177,15 +173,15 @@ namespace TAO effective_target = coll_inv.steal_forwarded_reference (); #if TAO_HAS_INTERCEPTORS == 1 - const bool is_permanent_forward = + CORBA::Boolean const is_permanent_forward = (coll_inv.reply_status() == TAO_GIOP_LOCATION_FORWARD_PERM); #else - const bool is_permanent_forward = false; + CORBA::Boolean const is_permanent_forward = false; #endif - (void) this->object_forwarded (effective_target, - stub, - is_permanent_forward); + this->object_forwarded (effective_target, + stub, + is_permanent_forward); } return status; @@ -313,10 +309,10 @@ namespace TAO effective_target = synch.steal_forwarded_reference (); #if TAO_HAS_INTERCEPTORS == 1 - const bool is_permanent_forward = + CORBA::Boolean const is_permanent_forward = (synch.reply_status() == TAO_GIOP_LOCATION_FORWARD_PERM); #else - const bool is_permanent_forward = false; + CORBA::Boolean const is_permanent_forward = false; #endif this->object_forwarded (effective_target, @@ -342,10 +338,10 @@ namespace TAO effective_target = synch.steal_forwarded_reference (); #if TAO_HAS_INTERCEPTORS == 1 - const bool is_permanent_forward = + CORBA::Boolean const is_permanent_forward = (synch.reply_status() == TAO_GIOP_LOCATION_FORWARD_PERM); #else - const bool is_permanent_forward = false; + CORBA::Boolean const is_permanent_forward = false; #endif this->object_forwarded (effective_target, r.stub (), diff --git a/TAO/tao/Invocation_Adapter.h b/TAO/tao/Invocation_Adapter.h index 8897da1dd84..c638b74b1b0 100644 --- a/TAO/tao/Invocation_Adapter.h +++ b/TAO/tao/Invocation_Adapter.h @@ -103,9 +103,6 @@ namespace TAO * * @param mode Invocation mode. This information is also available * in the IDL file and in the generated code. - * - * @param is_dii_request DII request flag. This flag defaults to false, - * it's set to be true when invoking via DynamicInterface. */ Invocation_Adapter (CORBA::Object_ptr target, Argument **args, @@ -114,8 +111,7 @@ namespace TAO size_t op_len, Collocation_Proxy_Broker *cpb, TAO::Invocation_Type type = TAO_TWOWAY_INVOCATION, - TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION, - CORBA::Boolean is_dii_request = false); + TAO::Invocation_Mode mode = TAO_SYNCHRONOUS_INVOCATION); virtual ~Invocation_Adapter (void); @@ -129,9 +125,7 @@ namespace TAO * * @param ex_count Number of elements in the array. */ - virtual void invoke (TAO::Exception_Data *ex, - unsigned long ex_count - ); + virtual void invoke (TAO::Exception_Data *ex, unsigned long ex_count); protected: /** * The stub pointer passed to this call has all the details about @@ -141,9 +135,7 @@ namespace TAO * forwarding information or if the first invocation fails * for some reason, like a loss of connection during send () etc. */ - virtual void invoke_i (TAO_Stub *stub, - TAO_Operation_Details &details - ); + virtual void invoke_i (TAO_Stub *stub, TAO_Operation_Details &details); /** * @name Helper methods for making different types of invocations. @@ -173,8 +165,7 @@ namespace TAO TAO_Stub *stub, TAO_Operation_Details &details, CORBA::Object_var &effective_target, - ACE_Time_Value *&max_wait_time - ); + ACE_Time_Value *&max_wait_time); /// Make a collocated call. /** @@ -191,8 +182,7 @@ namespace TAO TAO_Stub *stub, TAO_Operation_Details &details, CORBA::Object_var &effective_target, - Collocation_Strategy strat - ); + Collocation_Strategy strat); /// Helper method to make a two way invocation. /** @@ -205,8 +195,7 @@ namespace TAO TAO_Operation_Details &details, CORBA::Object_var &effective_target, Profile_Transport_Resolver &r, - ACE_Time_Value *&max_wait_time - ); + ACE_Time_Value *&max_wait_time); /// Helper method to make a one way invocation. /** @@ -219,14 +208,12 @@ namespace TAO TAO_Operation_Details &details, CORBA::Object_var &effective_target, Profile_Transport_Resolver &r, - ACE_Time_Value *&max_wait_time - ); + ACE_Time_Value *&max_wait_time); //@} /// Helper function that extracts the roundtrip timeout policies /// set in the ORB. - bool get_timeout (TAO_Stub *stub, - ACE_Time_Value &val); + bool get_timeout (TAO_Stub *stub, ACE_Time_Value &val); /// Helper method that extracts TAO_Stub from the target object. TAO_Stub *get_stub (void) const; @@ -235,8 +222,7 @@ namespace TAO /// the stub object if the target gets forwarded void object_forwarded (CORBA::Object_var &effective_target, TAO_Stub *stub, - CORBA::Boolean permanent_forward - ); + CORBA::Boolean permanent_forward); /// Helper method to set the response flags within @a details void set_response_flags (TAO_Stub *stub, @@ -278,9 +264,6 @@ namespace TAO /// The invocation mode Invocation_Mode const mode_; - - /// Flag that indicates a dii request. - CORBA::Boolean is_dii_request_; }; } // End namespace TAO diff --git a/TAO/tao/Invocation_Adapter.inl b/TAO/tao/Invocation_Adapter.inl index a3d8dd5eacc..3ee1410310c 100644 --- a/TAO/tao/Invocation_Adapter.inl +++ b/TAO/tao/Invocation_Adapter.inl @@ -15,8 +15,7 @@ namespace TAO size_t op_len, Collocation_Proxy_Broker *p, Invocation_Type type, - Invocation_Mode mode, - CORBA::Boolean is_dii_request) + Invocation_Mode mode) : target_ (target) , args_ (args) , number_args_ (arg_number) @@ -25,7 +24,6 @@ namespace TAO , cpb_ (p) , type_ (type) , mode_ (mode) - , is_dii_request_ (is_dii_request) { } } diff --git a/TAO/tao/Makefile.am b/TAO/tao/Makefile.am index 94021756257..5fd80181e2c 100644 --- a/TAO/tao/Makefile.am +++ b/TAO/tao/Makefile.am @@ -2865,7 +2865,7 @@ libTAO_PortableServer_la_SOURCES = \ PortableServer/Adapter_Activator.cpp \ PortableServer/Collocated_Object_Proxy_Broker.cpp \ PortableServer/Creation_Time.cpp \ - PortableServer/DII_Arguments_Converter.cpp \ + PortableServer/Collocated_Arguments_Converter.cpp \ PortableServer/Default_Acceptor_Filter.cpp \ PortableServer/Default_Policy_Validator.cpp \ PortableServer/Default_Servant_Dispatcher.cpp \ @@ -3012,7 +3012,7 @@ nobase_include_HEADERS += \ PortableServer/Collocated_Object_Proxy_Broker.h \ PortableServer/Creation_Time.h \ PortableServer/Creation_Time.inl \ - PortableServer/DII_Arguments_Converter.h \ + PortableServer/Collocated_Arguments_Converter.h \ PortableServer/Default_Acceptor_Filter.h \ PortableServer/Default_Policy_Validator.h \ PortableServer/Default_Servant_Dispatcher.h \ @@ -4110,6 +4110,7 @@ libTAO_Messaging_la_SOURCES = \ Messaging/Asynch_Invocation_Adapter.cpp \ Messaging/Asynch_Reply_Dispatcher.cpp \ Messaging/Asynch_Timeout_Handler.cpp \ + Messaging/AMI_Arguments_Converter_Impl.cpp \ Messaging/Connection_Timeout_Policy_i.cpp \ Messaging/ExceptionHolderA.cpp \ Messaging/ExceptionHolderC.cpp \ @@ -4151,6 +4152,7 @@ nobase_include_HEADERS += \ Messaging/Asynch_Invocation_Adapter.h \ Messaging/Asynch_Reply_Dispatcher.h \ Messaging/Asynch_Timeout_Handler.h \ + Messaging/AMI_Arguments_Converter_Impl.h \ Messaging/Connection_Timeout_Policy_i.h \ Messaging/ExceptionHolder.pidl \ Messaging/ExceptionHolderA.h \ diff --git a/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.cpp b/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.cpp new file mode 100644 index 00000000000..7870920c807 --- /dev/null +++ b/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.cpp @@ -0,0 +1,99 @@ +// $Id$ +#include "tao/Messaging/AMI_Arguments_Converter_Impl.h" +#include "tao/operation_details.h" +#include "tao/SystemException.h" + +ACE_RCSID (Messaging, + AMI_Arguments_Converter_Impl, + "$Id$") + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +void +TAO_AMI_Arguments_Converter_Impl::convert_request ( + TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs) +{ + // The AMI requests on client side just has the in and inout argumenst, + // Since the argument list in the client side is used by server side + // in collocation case and the server expects the full list of arguments + // and not just the inout arguments we need to expand the client arguments + // to be list of Arguments. + + CORBA::ULong const nrarg = server_request.operation_details ()->args_num (); + + TAO_OutputCDR output; + for (CORBA::ULong i = 1; i < nrarg; ++i) + { + if (!(server_request.operation_details ()->args()[i])->marshal (output)) + { + throw ::CORBA::BAD_PARAM (); + } + } + + TAO_InputCDR input (output); + for (CORBA::ULong j = 1; j < nargs; ++j) + { + if (!(args[j]->demarshal (input))) + { + throw ::CORBA::BAD_PARAM (); + } + } + + TAO_Operation_Details* details + = const_cast <TAO_Operation_Details*> (server_request.operation_details ()); + + details->use_stub_args (false); +} + +void +TAO_AMI_Arguments_Converter_Impl::convert_reply ( + TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs) +{ + TAO_OutputCDR output; + for (CORBA::ULong j = 1; j < nargs; ++j) + { + if (!(args[j]->marshal (output))) + { + throw ::CORBA::BAD_PARAM (); + } + } + CORBA::ULong const nrarg = server_request.operation_details ()->args_num (); + TAO_InputCDR input (output); + for (CORBA::ULong i = 1; i < nrarg; ++i) + { + if (!(server_request.operation_details ()->args()[i])->demarshal (output)) + { + throw ::CORBA::BAD_PARAM (); + } + } +} + +// ********************************************************************* + +// Initialization and registration of dynamic service object. + +int +TAO_AMI_Arguments_Converter_Impl::Initializer (void) +{ + return ACE_Service_Config::process_directive ( + ace_svc_desc_TAO_AMI_Arguments_Converter_Impl); +} + + +TAO_END_VERSIONED_NAMESPACE_DECL + +ACE_STATIC_SVC_DEFINE ( + TAO_AMI_Arguments_Converter_Impl, + ACE_TEXT ("AMI_Arguments_Converter"), + ACE_SVC_OBJ_T, + &ACE_SVC_NAME (TAO_AMI_Arguments_Converter_Impl), + ACE_Service_Type::DELETE_THIS | ACE_Service_Type::DELETE_OBJ, + 0 + ) + +ACE_FACTORY_DEFINE (TAO_Messaging, TAO_AMI_Arguments_Converter_Impl) + diff --git a/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.h b/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.h new file mode 100644 index 00000000000..4de9b623090 --- /dev/null +++ b/TAO/tao/Messaging/AMI_Arguments_Converter_Impl.h @@ -0,0 +1,71 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file AMI_Arguments_Converter_Impl.h + * + * $Id$ + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + + +#ifndef TAO_AMI_ARGUMENTS_CONVERTER_IMPL_H +#define TAO_AMI_ARGUMENTS_CONVERTER_IMPL_H + +#include /**/ "ace/pre.h" + +#include "tao/Messaging/messaging_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/PortableServer/Collocated_Arguments_Converter.h" + +#include "ace/Service_Config.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + + +/** + * @class TAO_AMI_Arguments_Converter_Impl + * + * @brief TAO_AMI_Arguments_Converter_Impl. + * + * This class provides the implementation to expand the DII arguments in NVList + * to the list of arguments. + */ +class TAO_Messaging_Export TAO_AMI_Arguments_Converter_Impl + : public TAO::Collocated_Arguments_Converter +{ +public: + + virtual void convert_request (TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs); + + virtual void convert_reply (TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs); + + // Used to force the initialization of the ORB code. + static int Initializer (void); +}; + +static int +TAO_Requires_AMI_Arguments_Converter_Impl_Initializer = + TAO_AMI_Arguments_Converter_Impl::Initializer (); + +TAO_END_VERSIONED_NAMESPACE_DECL + +ACE_STATIC_SVC_DECLARE (TAO_AMI_Arguments_Converter_Impl) +ACE_FACTORY_DECLARE (TAO_Messaging, TAO_AMI_Arguments_Converter_Impl) + + +#include /**/ "ace/post.h" + +#endif /* TAO_AMI_ARGUMENTS_CONVERTER_IMPL_H */ + + diff --git a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp index c4c15850c87..f8cb57a02e2 100644 --- a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp +++ b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp @@ -2,6 +2,7 @@ #include "tao/Messaging/Asynch_Invocation_Adapter.h" #include "tao/Messaging/Asynch_Reply_Dispatcher.h" #include "tao/Messaging/Asynch_Invocation.h" +#include "tao/Messaging/AMI_Arguments_Converter_Impl.h" #include "tao/Profile_Transport_Resolver.h" #include "tao/operation_details.h" @@ -120,17 +121,32 @@ namespace TAO TAO_Stub *stub, TAO_Operation_Details &details, CORBA::Object_var &effective_target, - Collocation_Strategy strat - ) + Collocation_Strategy strat) { - // When doing a collocation asynch invocation we shouldn't use the - // stub args but use the skel args - details.use_stub_args (false); - - return Invocation_Adapter::invoke_collocated_i (stub, + if (stub->orb_core ()->orb_params ()->ami_collication ()) + { + // When doing a collocation asynch invocation we shouldn't use the + // stub args but use the skel args + details.use_stub_args (false); + + TAO_AMI_Arguments_Converter_Impl* ami_arguments_converter + = ACE_Dynamic_Service<TAO_AMI_Arguments_Converter_Impl>::instance ( + "AMI_Arguments_Converter"); + details.cac (ami_arguments_converter); + + return Invocation_Adapter::invoke_collocated_i (stub, + details, + effective_target, + strat); + } + else + { + ACE_Time_Value *max_wait_time = 0; + return Invocation_Adapter::invoke_remote_i (stub, details, effective_target, - strat); + max_wait_time); + } } Invocation_Status @@ -163,8 +179,7 @@ namespace TAO { this->safe_rd_->schedule_timer ( op.request_id (), - *max_wait_time - ); + *max_wait_time); } } diff --git a/TAO/tao/Messaging/Messaging_Loader.cpp b/TAO/tao/Messaging/Messaging_Loader.cpp index f9c1897c6a4..2a1e975158f 100644 --- a/TAO/tao/Messaging/Messaging_Loader.cpp +++ b/TAO/tao/Messaging/Messaging_Loader.cpp @@ -3,6 +3,7 @@ #include "tao/Messaging/Messaging_Loader.h" #include "tao/Messaging/Messaging_ORBInitializer.h" +#include "tao/Messaging/AMI_Arguments_Converter_Impl.h" #include "tao/debug.h" #include "tao/ORB_Core.h" diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index f1071bc2b4d..75d7fcb4569 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -796,6 +796,17 @@ TAO_ORB_Core::init (int &argc, char *argv[] ) ACE_OS::atoi (current_arg); arg_shifter.consume_arg (); } + else if ((current_arg = arg_shifter.get_the_parameter + (ACE_TEXT("-ORBAMICollocation")))) + { + int ami_collocation = ACE_OS::atoi (current_arg); + if (ami_collocation) + this->orb_params ()->ami_collication (true); + else + this->orb_params ()->ami_collication (false); + + arg_shifter.consume_arg (); + } else if (0 != (current_arg = arg_shifter.get_the_parameter (ACE_TEXT("-ORBResources")))) { diff --git a/TAO/tao/ORB_Core.h b/TAO/tao/ORB_Core.h index c9f199ceb8d..b1fad823e9e 100644 --- a/TAO/tao/ORB_Core.h +++ b/TAO/tao/ORB_Core.h @@ -242,8 +242,7 @@ public: * No-Collocation is a special case of collocation. */ static - TAO::Collocation_Strategy collocation_strategy (CORBA::Object_ptr object - ); + TAO::Collocation_Strategy collocation_strategy (CORBA::Object_ptr object); //@} /// Set/get the collocation flags @@ -376,7 +375,6 @@ public: /// Gets the value of TAO_ORB_Core::valuetype_adapter_factory_name. static const char *valuetype_adapter_factory_name (void); - /// See if we have a collocated address, if yes, return the POA /// associated with the address. int is_collocated (const TAO_MProfile& mprofile); diff --git a/TAO/tao/PI/PolicyFactoryC.cpp b/TAO/tao/PI/PolicyFactoryC.cpp index b99583692aa..1b70783c712 100644 --- a/TAO/tao/PI/PolicyFactoryC.cpp +++ b/TAO/tao/PI/PolicyFactoryC.cpp @@ -89,7 +89,6 @@ PortableInterceptor::PolicyFactory::~PolicyFactory (void) PortableInterceptor::PolicyFactory_ptr PortableInterceptor::PolicyFactory::_narrow ( ::CORBA::Object_ptr _tao_objref - ) { return PolicyFactory::_duplicate ( @@ -100,7 +99,6 @@ PortableInterceptor::PolicyFactory::_narrow ( PortableInterceptor::PolicyFactory_ptr PortableInterceptor::PolicyFactory::_unchecked_narrow ( ::CORBA::Object_ptr _tao_objref - ) { return PolicyFactory::_duplicate ( @@ -126,10 +124,7 @@ PortableInterceptor::PolicyFactory::_tao_release (PolicyFactory_ptr obj) } ::CORBA::Boolean -PortableInterceptor::PolicyFactory::_is_a ( - const char *value - - ) +PortableInterceptor::PolicyFactory::_is_a (const char *value) { if ( !ACE_OS::strcmp ( @@ -167,8 +162,7 @@ PortableInterceptor::PolicyFactory::marshal (TAO_OutputCDR &) // Hand-crafted. ::CORBA::Policy_ptr -PortableInterceptor::PolicyFactory::_create_policy (CORBA::PolicyType - ) +PortableInterceptor::PolicyFactory::_create_policy (CORBA::PolicyType) { throw ::CORBA::PolicyError (CORBA::BAD_POLICY_TYPE); } diff --git a/TAO/tao/PortableServer/Collocated_Arguments_Converter.cpp b/TAO/tao/PortableServer/Collocated_Arguments_Converter.cpp new file mode 100644 index 00000000000..204b5d9868c --- /dev/null +++ b/TAO/tao/PortableServer/Collocated_Arguments_Converter.cpp @@ -0,0 +1,23 @@ +// @(#) $Id$ + +#include "tao/PortableServer/Collocated_Arguments_Converter.h" + +ACE_RCSID(PortableServer, + TAO_Collocated_Arguments_Converter, + "$Id$") + + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace TAO +{ + +Collocated_Arguments_Converter::~Collocated_Arguments_Converter (void) +{ +} + +} + +TAO_END_VERSIONED_NAMESPACE_DECL + + diff --git a/TAO/tao/PortableServer/Collocated_Arguments_Converter.h b/TAO/tao/PortableServer/Collocated_Arguments_Converter.h new file mode 100644 index 00000000000..08a5fd73540 --- /dev/null +++ b/TAO/tao/PortableServer/Collocated_Arguments_Converter.h @@ -0,0 +1,60 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file Collocated_Arguments_Converter.h + * + * $Id$ + * + * @author Yan Dai <dai_y@ociweb.com> + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + + +#ifndef TAO_COLLOCATED_ARGUMENTS_CONVERTER_H +#define TAO_COLLOCATED_ARGUMENTS_CONVERTER_H + +#include /**/ "ace/pre.h" + +#include "portableserver_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/TAO_Server_Request.h" +#include "ace/Service_Object.h" + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +namespace TAO +{ +/** + * @class Collocated_Arguments_Converter + * + * @brief Collocated_Arguments_Converter. + * + * Abstract class that convert arguments in the case of a collocated call. + */ +class TAO_PortableServer_Export Collocated_Arguments_Converter : + public ACE_Service_Object +{ +public: + + virtual ~Collocated_Arguments_Converter (void); + + virtual void convert_request (TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs) = 0; + + virtual void convert_reply (TAO_ServerRequest & server_request, + TAO::Argument * const args[], + size_t nargs) = 0; +}; +} +TAO_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" +#endif /* TAO_COLLOCATED_ARGUMENTS_CONVERTER_H */ + diff --git a/TAO/tao/PortableServer/DII_Arguments_Converter.cpp b/TAO/tao/PortableServer/DII_Arguments_Converter.cpp deleted file mode 100644 index abc8d89fe42..00000000000 --- a/TAO/tao/PortableServer/DII_Arguments_Converter.cpp +++ /dev/null @@ -1,18 +0,0 @@ -// @(#) $Id$ - -#include "tao/PortableServer/DII_Arguments_Converter.h" - -ACE_RCSID(PortableServer, - DII_Arguments_Converter, - "$Id$") - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -TAO_DII_Arguments_Converter::~TAO_DII_Arguments_Converter (void) -{ -} - -TAO_END_VERSIONED_NAMESPACE_DECL - - diff --git a/TAO/tao/PortableServer/DII_Arguments_Converter.h b/TAO/tao/PortableServer/DII_Arguments_Converter.h deleted file mode 100644 index b2b0291f448..00000000000 --- a/TAO/tao/PortableServer/DII_Arguments_Converter.h +++ /dev/null @@ -1,57 +0,0 @@ -// -*- C++ -*- - -//============================================================================= -/** - * @file DII_Arguments_Converter.h - * - * $Id$ - * - * @author Yan Dai <dai_y@ociweb.com> - */ -//============================================================================= - - -#ifndef TAO_DII_ARGUMENTS_CONVERTER_H -#define TAO_DII_ARGUMENTS_CONVERTER_H - -#include /**/ "ace/pre.h" - -#include "portableserver_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "tao/TAO_Server_Request.h" -#include "ace/Service_Object.h" - - -TAO_BEGIN_VERSIONED_NAMESPACE_DECL - -/** - * @class TAO_DII_Arguments_Converter - * - * @brief TAO_DII_Arguments_Converter. - * - * Abstract class that convert the DII arguments in NVList to the - * list of arguments. This is a base class for the actual implementation - * in the DynamicInterface library. - */ -class TAO_PortableServer_Export TAO_DII_Arguments_Converter : public ACE_Service_Object -{ -public: - - virtual ~TAO_DII_Arguments_Converter (void); - - virtual void convert (TAO_ServerRequest & server_request, - TAO::Argument * const args[], - size_t nargs) = 0; -}; - - -TAO_END_VERSIONED_NAMESPACE_DECL - - -#include /**/ "ace/post.h" -#endif /* TAO_DII_ARGUMENTS_CONVERTER_H */ - diff --git a/TAO/tao/PortableServer/POAManager.h b/TAO/tao/PortableServer/POAManager.h index 8f46f7f56ab..b048cb1d617 100644 --- a/TAO/tao/PortableServer/POAManager.h +++ b/TAO/tao/PortableServer/POAManager.h @@ -68,8 +68,7 @@ public: void hold_requests (CORBA::Boolean wait_for_completion); - void discard_requests (CORBA::Boolean wait_for_completion - ); + void discard_requests (CORBA::Boolean wait_for_completion); void deactivate (CORBA::Boolean etherealize_objects, CORBA::Boolean wait_for_completion); diff --git a/TAO/tao/PortableServer/POAManagerFactory.cpp b/TAO/tao/PortableServer/POAManagerFactory.cpp index eb3a8ef823f..2c0fc32b1da 100644 --- a/TAO/tao/PortableServer/POAManagerFactory.cpp +++ b/TAO/tao/PortableServer/POAManagerFactory.cpp @@ -105,7 +105,7 @@ TAO_POAManager_Factory::list (void) } ::PortableServer::POAManager_ptr -TAO_POAManager_Factory::find (const char * id ) +TAO_POAManager_Factory::find (const char * id) { ::PortableServer::POAManager_ptr poamanager = ::PortableServer::POAManager::_nil(); diff --git a/TAO/tao/PortableServer/Upcall_Wrapper.cpp b/TAO/tao/PortableServer/Upcall_Wrapper.cpp index 8d865765f1d..7edb782eb13 100644 --- a/TAO/tao/PortableServer/Upcall_Wrapper.cpp +++ b/TAO/tao/PortableServer/Upcall_Wrapper.cpp @@ -2,7 +2,7 @@ #include "tao/PortableServer/Upcall_Wrapper.h" #include "tao/PortableServer/Upcall_Command.h" -#include "tao/PortableServer/DII_Arguments_Converter.h" +#include "tao/PortableServer/Collocated_Arguments_Converter.h" #include "tao/SystemException.h" #if TAO_HAS_INTERCEPTORS == 1 @@ -38,17 +38,10 @@ TAO::Upcall_Wrapper::upcall (TAO_ServerRequest & server_request, ) { if (server_request.collocated () - && server_request.operation_details ()->is_dii_request ()) + && server_request.operation_details ()->cac () != 0) { - TAO_DII_Arguments_Converter* dii_arguments_converter - = ACE_Dynamic_Service<TAO_DII_Arguments_Converter>::instance ("DII_Arguments_Converter"); - - if (dii_arguments_converter != 0) - { - dii_arguments_converter->convert (server_request, args, nargs); - } - else - throw ::CORBA::NO_IMPLEMENT (); + server_request.operation_details ()->cac ()->convert_request ( + server_request, args, nargs); } if (server_request.incoming ()) @@ -199,6 +192,13 @@ TAO::Upcall_Wrapper::upcall (TAO_ServerRequest & server_request, this->post_upcall (*server_request.outgoing (), args, nargs); } } + + if (server_request.collocated () + && server_request.operation_details ()->cac () != 0) + { + server_request.operation_details ()->cac ()->convert_reply ( + server_request, args, nargs); + } } void diff --git a/TAO/tao/Profile.h b/TAO/tao/Profile.h index 6f6cbb6ef16..edf81c265f9 100644 --- a/TAO/tao/Profile.h +++ b/TAO/tao/Profile.h @@ -226,7 +226,7 @@ public: /** * Return the first endpoint in the list that matches some filtering * constraint, such as IPv6 compatibility for IIOP endpoints. This - * method is implemented in terms of TAO_Endpoint;:next_filtered(). + * method is implemented in terms of TAO_Endpoint::next_filtered(). */ TAO_Endpoint *first_filtered_endpoint (void); diff --git a/TAO/tao/Profile_Transport_Resolver.cpp b/TAO/tao/Profile_Transport_Resolver.cpp index 648f0bb0757..0a60929e532 100644 --- a/TAO/tao/Profile_Transport_Resolver.cpp +++ b/TAO/tao/Profile_Transport_Resolver.cpp @@ -77,8 +77,7 @@ namespace TAO void - Profile_Transport_Resolver::resolve (ACE_Time_Value *max_time_val - ) + Profile_Transport_Resolver::resolve (ACE_Time_Value *max_time_val) { ACE_Countdown_Time countdown (max_time_val); @@ -118,21 +117,17 @@ namespace TAO bool Profile_Transport_Resolver::try_connect ( TAO_Transport_Descriptor_Interface *desc, - ACE_Time_Value *timeout - - ) + ACE_Time_Value *timeout) { - return this->try_connect_i (desc, timeout, 0); + return this->try_connect_i (desc, timeout, false); } bool Profile_Transport_Resolver::try_parallel_connect ( TAO_Transport_Descriptor_Interface *desc, - ACE_Time_Value *timeout - - ) + ACE_Time_Value *timeout) { - return this->try_connect_i (desc, timeout, 1); + return this->try_connect_i (desc, timeout, true); } @@ -140,13 +135,10 @@ namespace TAO Profile_Transport_Resolver::try_connect_i ( TAO_Transport_Descriptor_Interface *desc, ACE_Time_Value *timeout, - bool parallel - - ) + bool parallel) { TAO_Connector_Registry *conn_reg = - this->stub_->orb_core ()->connector_registry ( - ); + this->stub_->orb_core ()->connector_registry (); if (conn_reg == 0) { @@ -180,13 +172,11 @@ namespace TAO ACE_ASSERT(con != 0); if (parallel) { - this->transport_.set (con->parallel_connect (this, desc, timeout - )); + this->transport_.set (con->parallel_connect (this, desc, timeout)); } else { - this->transport_.set (con->connect (this, desc, timeout - )); + this->transport_.set (con->connect (this, desc, timeout)); } // A timeout error occurred. // If the user has set a roundtrip timeout policy, throw a timeout @@ -240,8 +230,7 @@ namespace TAO void - Profile_Transport_Resolver::init_inconsistent_policies ( - void) + Profile_Transport_Resolver::init_inconsistent_policies (void) { ACE_NEW_THROW_EX (this->inconsistent_policies_, CORBA::PolicyList (0), diff --git a/TAO/tao/Profile_Transport_Resolver.h b/TAO/tao/Profile_Transport_Resolver.h index 77960b2f88d..4ebf0f3edd6 100644 --- a/TAO/tao/Profile_Transport_Resolver.h +++ b/TAO/tao/Profile_Transport_Resolver.h @@ -85,8 +85,7 @@ namespace TAO * the ORB_Core to decide on the strategy to be used for selecting * the profile. */ - void resolve (ACE_Time_Value *val - ); + void resolve (ACE_Time_Value *val); //@{ /** @@ -138,8 +137,7 @@ namespace TAO ACE_Time_Value *val); bool try_parallel_connect (TAO_Transport_Descriptor_Interface *desc, - ACE_Time_Value *val - ); + ACE_Time_Value *val); /// This method wraps a call to the orb core to see if parallel /// connection attempts are even desired. This is controlled by @@ -162,8 +160,7 @@ namespace TAO private: bool try_connect_i (TAO_Transport_Descriptor_Interface *desc, ACE_Time_Value *val, - bool parallel - ); + bool parallel); /// Target object mutable CORBA::Object *obj_; diff --git a/TAO/tao/Protocol_Factory.cpp b/TAO/tao/Protocol_Factory.cpp index 7d67c460789..a6f9fcf1a9d 100644 --- a/TAO/tao/Protocol_Factory.cpp +++ b/TAO/tao/Protocol_Factory.cpp @@ -26,8 +26,7 @@ TAO_Protocol_Factory::tag (void) const } int -TAO_Protocol_Factory::init (int /* argc */, - ACE_TCHAR * /* argv */ []) +TAO_Protocol_Factory::init (int /* argc */, ACE_TCHAR * /* argv */ []) { return -1; } diff --git a/TAO/tao/QtResource/QtResource_Factory.h b/TAO/tao/QtResource/QtResource_Factory.h index 6832fc8e2be..40abf78958a 100644 --- a/TAO/tao/QtResource/QtResource_Factory.h +++ b/TAO/tao/QtResource/QtResource_Factory.h @@ -57,9 +57,6 @@ namespace TAO /// QApplication running reactor QApplication *qapp_; - - /// For internal locking. - TAO_SYNCH_MUTEX lock_; }; } diff --git a/TAO/tao/Stub.inl b/TAO/tao/Stub.inl index 265d599d312..cb0dd3a0a37 100644 --- a/TAO/tao/Stub.inl +++ b/TAO/tao/Stub.inl @@ -109,10 +109,10 @@ TAO_Stub::next_profile_i (void) // We may have been forwarded to / from a collocated situation // Check for this and apply / remove optimisation if required. this->orb_core_->reinitialize_object (this); - + return pfile_next; } - else + else { if (this->forward_profiles_) // Now do the common operation { diff --git a/TAO/tao/TAO_Server_Request.cpp b/TAO/tao/TAO_Server_Request.cpp index 448e00e270f..34f79c6e039 100644 --- a/TAO/tao/TAO_Server_Request.cpp +++ b/TAO/tao/TAO_Server_Request.cpp @@ -74,7 +74,7 @@ TAO_ServerRequest::TAO_ServerRequest (TAO_Pluggable_Messaging *mesg_base, requesting_principal_ (0), dsi_nvlist_align_ (0), operation_details_ (0), - argument_flag_ (1) + argument_flag_ (true) #if TAO_HAS_INTERCEPTORS == 1 , interceptor_count_ (0) , rs_pi_current_ (0) @@ -285,8 +285,7 @@ TAO_ServerRequest::init_reply (void) 0); // Construct a REPLY header. - this->mesg_base_->generate_reply_header (*this->outgoing_, - reply_params); + this->mesg_base_->generate_reply_header (*this->outgoing_, reply_params); // Finish the GIOP Reply header, then marshal the exception. if (reply_params.reply_status_ == TAO_PLUGGABLE_MESSAGE_LOCATION_FORWARD || @@ -325,7 +324,7 @@ TAO_ServerRequest::send_no_exception_reply (void) reply_params.reply_status_ = TAO_GIOP_NO_EXCEPTION; // No data anyway. - reply_params.argument_flag_ = 0; + reply_params.argument_flag_ = false; this->outgoing_->message_attributes (this->request_id_, 0, @@ -333,8 +332,7 @@ TAO_ServerRequest::send_no_exception_reply (void) 0); // Construct a REPLY header. - this->mesg_base_->generate_reply_header (*this->outgoing_, - reply_params); + this->mesg_base_->generate_reply_header (*this->outgoing_, reply_params); this->outgoing_->more_fragments (false); @@ -397,7 +395,7 @@ TAO_ServerRequest::tao_send_reply_exception (const CORBA::Exception &ex) reply_params.service_context_notowned (&this->reply_service_info ()); // We are going to send some data - reply_params.argument_flag_ = 1; + reply_params.argument_flag_ = true; // Make a default reply status reply_params.reply_status_ = TAO_GIOP_USER_EXCEPTION; @@ -472,7 +470,7 @@ TAO_ServerRequest::tao_send_reply_exception (const CORBA::Exception &ex) void TAO_ServerRequest::send_cached_reply (CORBA::OctetSeq &s) { - #if defined(ACE_HAS_PURIFY) +#if defined(ACE_HAS_PURIFY) // Only inititialize the buffer if we're compiling with Purify. // Otherwise, there is no real need to do so, especially since // we can avoid the initialization overhead at runtime if we @@ -506,7 +504,7 @@ TAO_ServerRequest::send_cached_reply (CORBA::OctetSeq &s) reply_params.service_context_notowned (&this->reply_service_info ()); // We are going to send some data - reply_params.argument_flag_ = 1; + reply_params.argument_flag_ = true; // Make a default reply status reply_params.reply_status_ = TAO_GIOP_NO_EXCEPTION; diff --git a/TAO/tao/TAO_Server_Request.h b/TAO/tao/TAO_Server_Request.h index ff0129ade41..4539e750d2c 100644 --- a/TAO/tao/TAO_Server_Request.h +++ b/TAO/tao/TAO_Server_Request.h @@ -299,7 +299,6 @@ private: /// Incoming stream. TAO_InputCDR *incoming_; - /// Outgoing stream. TAO_OutputCDR *outgoing_; diff --git a/TAO/tao/TAO_Server_Request.inl b/TAO/tao/TAO_Server_Request.inl index 45c05553533..d400bf7ee31 100644 --- a/TAO/tao/TAO_Server_Request.inl +++ b/TAO/tao/TAO_Server_Request.inl @@ -27,7 +27,7 @@ TAO_ServerRequest::TAO_ServerRequest (void) requesting_principal_ (0), dsi_nvlist_align_ (0), operation_details_ (0), - argument_flag_ (1) + argument_flag_ (true) #if TAO_HAS_INTERCEPTORS == 1 , interceptor_count_ (0) , rs_pi_current_ () diff --git a/TAO/tao/TkResource/TkResource_Factory.h b/TAO/tao/TkResource/TkResource_Factory.h index fd2f5461556..417879ebce2 100644 --- a/TAO/tao/TkResource/TkResource_Factory.h +++ b/TAO/tao/TkResource/TkResource_Factory.h @@ -49,12 +49,8 @@ namespace TAO virtual ACE_Reactor_Impl *reactor_impl (void); private: - /// Reactor created by this factory. ACE_TkReactor *reactor_impl_; - - /// for internal locking. - TAO_SYNCH_MUTEX lock_; }; } diff --git a/TAO/tao/Valuetype/AbstractBase.cpp b/TAO/tao/Valuetype/AbstractBase.cpp index 5897df93668..c958b4b24bf 100644 --- a/TAO/tao/Valuetype/AbstractBase.cpp +++ b/TAO/tao/Valuetype/AbstractBase.cpp @@ -295,7 +295,7 @@ operator>> (TAO_InputCDR &strm, CORBA::AbstractBase_ptr &abs) if (strm >> tb) { - if (discriminator == 0) + if (!discriminator) { CORBA::ULong value_tag; diff --git a/TAO/tao/operation_details.cpp b/TAO/tao/operation_details.cpp index de697c78aad..460e7c1c31f 100644 --- a/TAO/tao/operation_details.cpp +++ b/TAO/tao/operation_details.cpp @@ -21,7 +21,7 @@ ACE_RCSID (tao, TAO_BEGIN_VERSIONED_NAMESPACE_DECL CORBA::Exception * -TAO_Operation_Details::corba_exception (const char *id) +TAO_Operation_Details::corba_exception (const char *id) const { for (CORBA::ULong i = 0; i != this->ex_count_; ++i) { diff --git a/TAO/tao/operation_details.h b/TAO/tao/operation_details.h index 61ad4d406e4..68ea3206442 100644 --- a/TAO/tao/operation_details.h +++ b/TAO/tao/operation_details.h @@ -35,6 +35,7 @@ namespace Dynamic namespace TAO { class Argument; + class Collocated_Arguments_Converter; struct Exception_Data; } @@ -73,8 +74,7 @@ public: TAO::Argument **args = 0, CORBA::ULong num_args = 0, TAO::Exception_Data *ex_data = 0, - CORBA::ULong ex_count = 0, - CORBA::Boolean is_dii_request = false); + CORBA::ULong ex_count = 0); /// Operation name const char* opname (void) const; @@ -129,7 +129,7 @@ public: * is not found in the list of exceptions specified by the operation * this call would raise an UNKNOWN exception. */ - CORBA::Exception *corba_exception (const char *ex); + CORBA::Exception *corba_exception (const char *ex) const; /// Check whether exception @a ex is in the signature of this operation bool has_exception (::CORBA::Exception& ex) const; @@ -165,8 +165,9 @@ public: CORBA::Long ft_retention_id (void) const; #endif /*TAO_HAS_INTERCEPTORS == 1*/ - /// Accessor for is_dii_request_ flag. - CORBA::Boolean is_dii_request (void) const; + /// Accessor for cac_ pointer. + TAO::Collocated_Arguments_Converter *cac (void) const; + void cac (TAO::Collocated_Arguments_Converter *cac); private: @@ -220,8 +221,8 @@ private: CORBA::Long ft_retention_id_; #endif /*TAO_HAS_INTERCEPTORS == 1*/ - /// The dii request flag. - CORBA::Boolean is_dii_request_; + /// The optional collocated arguments converter + TAO::Collocated_Arguments_Converter *cac_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/operation_details.inl b/TAO/tao/operation_details.inl index 3ebb8296e02..8250b9451da 100644 --- a/TAO/tao/operation_details.inl +++ b/TAO/tao/operation_details.inl @@ -10,8 +10,7 @@ TAO_Operation_Details::TAO_Operation_Details (const char *name, TAO::Argument **args, CORBA::ULong num, TAO::Exception_Data *data, - CORBA::ULong count, - CORBA::Boolean is_dii_request) + CORBA::ULong count) : opname_ (name) , opname_len_ (len) , request_id_ (0) @@ -26,7 +25,7 @@ TAO_Operation_Details::TAO_Operation_Details (const char *name, , ft_expiration_time_ (0) , ft_retention_id_ (0) #endif /*TAO_HAS_INTERCEPTORS == 1*/ - , is_dii_request_ (is_dii_request) + , cac_ (0) { } @@ -210,10 +209,16 @@ TAO_Operation_Details::ft_retention_id (void) const } #endif /*TAO_HAS_INTERCEPTORS == 1*/ -ACE_INLINE CORBA::Boolean -TAO_Operation_Details::is_dii_request (void) const +ACE_INLINE TAO::Collocated_Arguments_Converter * +TAO_Operation_Details::cac (void) const +{ + return this->cac_; +} + +ACE_INLINE void +TAO_Operation_Details::cac (TAO::Collocated_Arguments_Converter *cac) { - return this->is_dii_request_; + this->cac_ = cac; } TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/params.cpp b/TAO/tao/params.cpp index efc6ca3fe1b..e3a9c6e3154 100644 --- a/TAO/tao/params.cpp +++ b/TAO/tao/params.cpp @@ -48,6 +48,7 @@ TAO_ORB_Parameters::TAO_ORB_Parameters (void) , use_ipv6_link_local_ (false) #endif /* ACE_HAS_IPV6 */ , negotiate_codesets_ (true) + , ami_collication_ (true) { for (int i = 0; i != TAO_NO_OF_MCAST_SERVICES; ++i) { diff --git a/TAO/tao/params.h b/TAO/tao/params.h index a7fb631e804..5cbf9bc23b0 100644 --- a/TAO/tao/params.h +++ b/TAO/tao/params.h @@ -181,7 +181,7 @@ public: /// Want to use parallel connection attempts when profiles have multiple /// endpoints. - bool use_parallel_connects(void) const; + bool use_parallel_connects(void) const; void use_parallel_connects (bool x); /// The milliseconds delay used to stagger individual connection starts @@ -215,6 +215,9 @@ public: void negotiate_codesets (bool c); bool negotiate_codesets (void) const; + void ami_collication (bool opt); + bool ami_collication (void) const; + private: // Each "endpoint" is of the form: // @@ -368,6 +371,9 @@ private: /// Enable the use of codeset negotiation bool negotiate_codesets_; + + /// Do we make collocated ami calls + bool ami_collication_; }; TAO_END_VERSIONED_NAMESPACE_DECL diff --git a/TAO/tao/params.inl b/TAO/tao/params.inl index 04e3f7575ec..5870a555e8d 100644 --- a/TAO/tao/params.inl +++ b/TAO/tao/params.inl @@ -291,4 +291,16 @@ TAO_ORB_Parameters::negotiate_codesets (bool x) this->negotiate_codesets_ = x; } +ACE_INLINE bool +TAO_ORB_Parameters::ami_collication (void) const +{ + return this->ami_collication_; +} + +ACE_INLINE void +TAO_ORB_Parameters::ami_collication (bool x) +{ + this->ami_collication_ = x; +} + TAO_END_VERSIONED_NAMESPACE_DECL |