diff options
author | bala <balanatarajan@users.noreply.github.com> | 2003-10-15 22:51:11 +0000 |
---|---|---|
committer | bala <balanatarajan@users.noreply.github.com> | 2003-10-15 22:51:11 +0000 |
commit | 225ae94028a932eeaae5ab7dcc5b890574cbe307 (patch) | |
tree | 33b851354aba0b0270dac9b44ca71a1de556e534 | |
parent | d3ed062ef9d520b76c55d57d24b14aaf351495a8 (diff) | |
download | ATCD-225ae94028a932eeaae5ab7dcc5b890574cbe307.tar.gz |
ChangeLogTag:Wed Oct 15 17:40:46 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog_ref | 31 | ||||
-rw-r--r-- | TAO/tao/Collocated_Invocation.h | 2 | ||||
-rw-r--r-- | TAO/tao/Invocation_Adapter.cpp | 18 | ||||
-rw-r--r-- | TAO/tao/Invocation_Base.h | 2 | ||||
-rw-r--r-- | TAO/tao/Invocation_Utils.h | 2 | ||||
-rw-r--r-- | TAO/tao/Messaging/Asynch_Invocation.cpp | 8 | ||||
-rw-r--r-- | TAO/tao/Messaging/Asynch_Invocation.h | 2 | ||||
-rw-r--r-- | TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp | 100 | ||||
-rw-r--r-- | TAO/tao/Messaging/Asynch_Invocation_Adapter.h | 10 | ||||
-rw-r--r-- | TAO/tao/Profile_Transport_Resolver.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Remote_Invocation.h | 2 | ||||
-rw-r--r-- | TAO/tao/Synch_Invocation.h | 4 |
12 files changed, 109 insertions, 78 deletions
diff --git a/TAO/ChangeLog_ref b/TAO/ChangeLog_ref index 030ed3c0925..cc7ce358506 100644 --- a/TAO/ChangeLog_ref +++ b/TAO/ChangeLog_ref @@ -1,3 +1,34 @@ +Wed Oct 15 17:40:46 2003 Balachandran Natarajan <bala@dre.vanderbilt.edu> + + * tao/Collocated_Invocation.h: Changed the inheritance to be + public. Couldn't work with protected or private inheritance in + this chain, since we use all the classes in this hierarchy in a + "is_a" mode. + + * tao/Invocation_Adapter.cpp: Do not call this object_forwarded + (), unless we are really forwarded. We could a restart call, + even if we cannot write messages on the wire. + + * tao/Invocation_Base.h: Removed the friend declaration. + + * tao/Invocation_Utils.h: Added some documentation. + + * tao/Profile_Transport_Resolver.cpp: Idle the transport before + decreasing transports reference. + + * tao/Synch_Invocation.h: + * tao/Remote_Invocation.h: Use public inheritance. + + * tao/Messaging/Asynch_Invocation.cpp: Idle the transport and then + set the flag on the profile transport resolver. + + * tao/Messaging/Asynch_Invocation.h: Use public inherticance. + + * tao/Messaging/Asynch_Invocation_Adapter.cpp: + * tao/Messaging/Asynch_Invocation_Adapter.h: Just overload the + invoke_twoway () call instead of invoke_remote (). + + Tue Oct 14 11:05:36 2003 Jeff Parsons <j.parsons@vanderbilt.edu> * orbsvcs/examples/Notify/Lanes/Consumer.cpp: diff --git a/TAO/tao/Collocated_Invocation.h b/TAO/tao/Collocated_Invocation.h index f8595fb06fa..1ffc7f7cfd3 100644 --- a/TAO/tao/Collocated_Invocation.h +++ b/TAO/tao/Collocated_Invocation.h @@ -42,7 +42,7 @@ namespace TAO * @NOTE: Reliable oneways are not handled properly including use of * interceptors. */ - class TAO_Export Collocated_Invocation : protected Invocation_Base + class TAO_Export Collocated_Invocation : public Invocation_Base { public: Collocated_Invocation (CORBA::Object_ptr et, diff --git a/TAO/tao/Invocation_Adapter.cpp b/TAO/tao/Invocation_Adapter.cpp index 0ee4d82540a..2fd03f25714 100644 --- a/TAO/tao/Invocation_Adapter.cpp +++ b/TAO/tao/Invocation_Adapter.cpp @@ -127,13 +127,15 @@ namespace TAO ACE_ENV_ARG_PARAMETER); ACE_CHECK; - if (status == TAO_INVOKE_RESTART) + if (status == TAO_INVOKE_RESTART && + coll_inv.is_forwarded ()) { - effective_target = coll_inv.steal_forwarded_reference (); + effective_target = + coll_inv.steal_forwarded_reference (); - this->object_forwarded (effective_target, - stub - ACE_ENV_ARG_PARAMETER); + (void) this->object_forwarded (effective_target, + stub + ACE_ENV_ARG_PARAMETER); ACE_CHECK; } } @@ -289,7 +291,8 @@ namespace TAO ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); - if (status == TAO_INVOKE_RESTART) + if (status == TAO_INVOKE_RESTART && + synch.is_forwarded ()) { effective_target = synch.steal_forwarded_reference (); @@ -331,7 +334,8 @@ namespace TAO ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); - if (s == TAO_INVOKE_RESTART) + if (s == TAO_INVOKE_RESTART && + synch.is_forwarded ()) { effective_target = synch.steal_forwarded_reference (); diff --git a/TAO/tao/Invocation_Base.h b/TAO/tao/Invocation_Base.h index 10cb1f2d8ee..fdc08d08969 100644 --- a/TAO/tao/Invocation_Base.h +++ b/TAO/tao/Invocation_Base.h @@ -62,8 +62,6 @@ namespace TAO class TAO_Export Invocation_Base { public: - friend class Invocation_Adapter; - virtual ~Invocation_Base (void); //@{ diff --git a/TAO/tao/Invocation_Utils.h b/TAO/tao/Invocation_Utils.h index c0cc422817a..733509c4d56 100644 --- a/TAO/tao/Invocation_Utils.h +++ b/TAO/tao/Invocation_Utils.h @@ -26,7 +26,7 @@ namespace TAO enum Invocation_Status { /// Initial state of the FSM in the invocation class. - TAO_INVOKE_START, + TAO_INVOKE_START = 0, /// The request must be restarted, a temporary failure has /// occured. TAO_INVOKE_RESTART, diff --git a/TAO/tao/Messaging/Asynch_Invocation.cpp b/TAO/tao/Messaging/Asynch_Invocation.cpp index 0e777b87e9c..9b9b7724c4d 100644 --- a/TAO/tao/Messaging/Asynch_Invocation.cpp +++ b/TAO/tao/Messaging/Asynch_Invocation.cpp @@ -115,9 +115,11 @@ namespace TAO // that. dispatch_guard.status (TAO_Bind_Dispatcher_Guard::NO_UNBIND); - // Irrespective of whatever the muxed strategy is, just - // release the transport for other threads. This is AMI dude. - (void) this->resolver_.transport_released (); + // NOTE: Not sure how things are handles with exclusive muxed + // strategy. + if (this->resolver_.transport ()->idle_after_send ()) + (void) this->resolver_.transport_released (); + } ACE_CATCHANY { diff --git a/TAO/tao/Messaging/Asynch_Invocation.h b/TAO/tao/Messaging/Asynch_Invocation.h index c50beb872e1..4f6ed7318e3 100644 --- a/TAO/tao/Messaging/Asynch_Invocation.h +++ b/TAO/tao/Messaging/Asynch_Invocation.h @@ -38,7 +38,7 @@ namespace TAO class Profile_Transport_Resolver; class TAO_Messaging_Export Asynch_Remote_Invocation - : protected Synch_Twoway_Invocation + : public Synch_Twoway_Invocation { public: Asynch_Remote_Invocation (CORBA::Object_ptr otarget, diff --git a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp index 788ec9fb65e..3fb32898c26 100644 --- a/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp +++ b/TAO/tao/Messaging/Asynch_Invocation_Adapter.cpp @@ -77,73 +77,67 @@ namespace TAO } - void - Asynch_Invocation_Adapter::invoke_remote (TAO_Stub *stub, - TAO_Operation_Details &op - ACE_ENV_ARG_DECL) + Invocation_Status + Asynch_Invocation_Adapter::invoke_twoway ( + TAO_Operation_Details &op, + CORBA::Object *&effective_target, + Profile_Transport_Resolver &r, + ACE_Time_Value *&max_wait_time + ACE_ENV_ARG_DECL) { - ACE_Time_Value tmp_wait_time; - - bool is_timeout = - this->get_timeout (tmp_wait_time); - - ACE_Time_Value *max_wait_time = 0; - - if (is_timeout) - max_wait_time = &tmp_wait_time; - - TAO::Invocation_Status s = TAO_INVOKE_START; + // Simple sanity check + if (this->mode_ != TAO_ASYNCHRONOUS_CALLBACK_INVOCATION || + this->type_ != TAO_TWOWAY_INVOCATION) + { + ACE_THROW_RETURN (CORBA::INTERNAL ( + CORBA::SystemException::_tao_minor_code ( + TAO_DEFAULT_MINOR_CODE, + EINVAL), + CORBA::COMPLETED_NO), + TAO_INVOKE_FAILURE); + } auto_ptr<TAO_Asynch_Reply_Dispatcher> safe_rd (this->rd_); - while (s == TAO_INVOKE_START || - s == TAO_INVOKE_RESTART) + if (this->rd_) { - // Resolver for resolving transports for htis profile. - Profile_Transport_Resolver resolver (this->target_, - stub); - - (void) resolver.resolve (max_wait_time - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + // Cache the transport in the reply dispatcher + this->rd_->transport (r.transport ()); - op.request_id (resolver.transport ()->tms ()->request_id ()); + // AMI Timeout Handling Begin + ACE_Time_Value tmp; - if (this->rd_) + if (this->get_timeout (tmp)) { - // Cache the transport in the reply dispatcher - this->rd_->transport (resolver.transport ()); - - // AMI Timeout Handling Begin - if (is_timeout) - { - this->rd_->schedule_timer (op.request_id (), - *max_wait_time); - } + this->rd_->schedule_timer (op.request_id (), + *max_wait_time); } + } - op.response_flags (TAO_TWOWAY_RESPONSE_FLAG); + TAO::Asynch_Remote_Invocation asynch (effective_target, + r, + op, + this->rd_); + Invocation_Status s = + asynch.remote_invocation (max_wait_time + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); - TAO::Asynch_Remote_Invocation asynch (this->target_, - resolver, - op, - this->rd_); - s = - asynch.remote_invocation (max_wait_time - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + if (s != TAO_INVOKE_FAILURE) + (void) safe_rd.release (); - if (s != TAO_INVOKE_FAILURE) - safe_rd.release (); + if (s == TAO_INVOKE_RESTART && + asynch.is_forwarded ()) + { + effective_target = asynch.steal_forwarded_reference (); - if (TAO_debug_level > 3 && - s == TAO_INVOKE_RESTART) - { - ACE_DEBUG ((LM_DEBUG, - "TAO_Messaging (%P|%t) - Asynch_Invocation_Adapter::invoke_remote -" - " retstarting invocation again \n")); - } + this->object_forwarded (effective_target, + r.stub () + ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (TAO_INVOKE_FAILURE); } + + return s; } } // End namespace TAO diff --git a/TAO/tao/Messaging/Asynch_Invocation_Adapter.h b/TAO/tao/Messaging/Asynch_Invocation_Adapter.h index 0e85f49156e..9e3e476ce94 100644 --- a/TAO/tao/Messaging/Asynch_Invocation_Adapter.h +++ b/TAO/tao/Messaging/Asynch_Invocation_Adapter.h @@ -73,11 +73,13 @@ namespace TAO TAO_Operation_Details &op ACE_ENV_ARG_DECL); **/ - virtual void invoke_remote (TAO_Stub *, - TAO_Operation_Details &op - ACE_ENV_ARG_DECL); - private: + virtual Invocation_Status invoke_twoway ( + TAO_Operation_Details &op, + CORBA::Object *&effective_target, + Profile_Transport_Resolver &r, + ACE_Time_Value *&max_wait_time + ACE_ENV_ARG_DECL); private: TAO_Asynch_Reply_Dispatcher *rd_; diff --git a/TAO/tao/Profile_Transport_Resolver.cpp b/TAO/tao/Profile_Transport_Resolver.cpp index a8b1be5e612..a07c3aa9337 100644 --- a/TAO/tao/Profile_Transport_Resolver.cpp +++ b/TAO/tao/Profile_Transport_Resolver.cpp @@ -41,12 +41,12 @@ namespace TAO if (this->transport_) { - this->transport_->remove_reference (); - if (this->is_released_ == false) { this->transport_->make_idle (); } + + this->transport_->remove_reference (); } if (this->inconsistent_policies_) @@ -115,7 +115,7 @@ namespace TAO if (!this->transport_->is_tcs_set ()) { - TAO_Codeset_Manager *tcm = + TAO_Codeset_Manager *tcm = this->stub_->orb_core ()->codeset_manager (); tcm->set_tcs (*this->profile_, *this->transport_); } diff --git a/TAO/tao/Remote_Invocation.h b/TAO/tao/Remote_Invocation.h index 28d3e964b33..61638659a53 100644 --- a/TAO/tao/Remote_Invocation.h +++ b/TAO/tao/Remote_Invocation.h @@ -43,7 +43,7 @@ namespace TAO * @brief Base class for Twoway_Invocation and Oneway_Invocation. * */ - class TAO_Export Remote_Invocation : protected Invocation_Base + class TAO_Export Remote_Invocation : public Invocation_Base { public: Remote_Invocation (CORBA::Object_ptr otarget, diff --git a/TAO/tao/Synch_Invocation.h b/TAO/tao/Synch_Invocation.h index 75cae376927..e6ec50b9cb2 100644 --- a/TAO/tao/Synch_Invocation.h +++ b/TAO/tao/Synch_Invocation.h @@ -38,7 +38,7 @@ namespace TAO { class Profile_Transport_Resolver; - class TAO_Export Synch_Twoway_Invocation : protected Remote_Invocation + class TAO_Export Synch_Twoway_Invocation : public Remote_Invocation { public: Synch_Twoway_Invocation (CORBA::Object_ptr otarget, @@ -87,7 +87,7 @@ namespace TAO }; - class TAO_Export Synch_Oneway_Invocation : protected Synch_Twoway_Invocation + class TAO_Export Synch_Oneway_Invocation : public Synch_Twoway_Invocation { public: Synch_Oneway_Invocation (CORBA::Object_ptr otarget, |