diff options
author | alex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-16 01:49:18 +0000 |
---|---|---|
committer | alex <alex@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-16 01:49:18 +0000 |
commit | 483b1140eb7aca3b0fc6cfe9b9e2a7823b3514d5 (patch) | |
tree | 8d29d82a29cc1f683b68c67ca563c6339803e81a | |
parent | c4abdaebbf711b6f1f1098df99eea5ed3006bd05 (diff) | |
download | ATCD-483b1140eb7aca3b0fc6cfe9b9e2a7823b3514d5.tar.gz |
ChangeLogTag : Thu Jul 15 20:48:48 1999 Alexander Babu Arulanthu <alex@cs.wustl.edu>
-rw-r--r-- | TAO/tao/Client_Strategy_Factory.cpp | 2 | ||||
-rw-r--r-- | TAO/tao/Client_Strategy_Factory.h | 2 | ||||
-rw-r--r-- | TAO/tao/ORB_Core.cpp | 1 | ||||
-rw-r--r-- | TAO/tao/Pluggable.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/Reply_Dispatcher.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/Reply_Dispatcher.h | 4 | ||||
-rw-r--r-- | TAO/tao/Transport_Mux_Strategy.cpp | 53 | ||||
-rw-r--r-- | TAO/tao/Transport_Mux_Strategy.h | 29 | ||||
-rw-r--r-- | TAO/tao/Wait_Strategy.cpp | 11 | ||||
-rw-r--r-- | TAO/tao/default_client.cpp | 6 | ||||
-rw-r--r-- | TAO/tao/default_client.h | 2 |
11 files changed, 81 insertions, 46 deletions
diff --git a/TAO/tao/Client_Strategy_Factory.cpp b/TAO/tao/Client_Strategy_Factory.cpp index 967582af54a..55ed1a5e707 100644 --- a/TAO/tao/Client_Strategy_Factory.cpp +++ b/TAO/tao/Client_Strategy_Factory.cpp @@ -19,7 +19,7 @@ TAO_Client_Strategy_Factory::create_profile_lock (void) } TAO_Transport_Mux_Strategy * -TAO_Client_Strategy_Factory::create_transport_mux_strategy (TAO_ORB_Core *) +TAO_Client_Strategy_Factory::create_transport_mux_strategy (TAO_Transport *) { return 0; } diff --git a/TAO/tao/Client_Strategy_Factory.h b/TAO/tao/Client_Strategy_Factory.h index 6d3a1ec668b..2f799cfc7f8 100644 --- a/TAO/tao/Client_Strategy_Factory.h +++ b/TAO/tao/Client_Strategy_Factory.h @@ -45,7 +45,7 @@ public: // <TAO_GIOP_Invocation::location_forward> and the // <TAO_GIOP_Invocation::start>. - virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_ORB_Core *orb_core); + virtual TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); // Create the correct client request muxing strategy. virtual TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); diff --git a/TAO/tao/ORB_Core.cpp b/TAO/tao/ORB_Core.cpp index 01ccbb8a1af..b4bf8c0c078 100644 --- a/TAO/tao/ORB_Core.cpp +++ b/TAO/tao/ORB_Core.cpp @@ -1317,6 +1317,7 @@ TAO_ORB_Core::leader_follower_condition_variable (void) ACE_NEW_RETURN (tss->leader_follower_condition_variable_, ACE_SYNCH_CONDITION (this->leader_follower ().lock ()), 0); + tss->owns_resources_ = 1; } return tss->leader_follower_condition_variable_; diff --git a/TAO/tao/Pluggable.cpp b/TAO/tao/Pluggable.cpp index acdddf5eb77..8ea29d60bb1 100644 --- a/TAO/tao/Pluggable.cpp +++ b/TAO/tao/Pluggable.cpp @@ -161,7 +161,7 @@ TAO_Transport::TAO_Transport (CORBA::ULong tag, this->ws_ = orb_core->client_factory ()->create_wait_strategy (this); // Create TMS now. - this->tms_ = orb_core->client_factory ()->create_transport_mux_strategy (orb_core); + this->tms_ = orb_core->client_factory ()->create_transport_mux_strategy (this); } TAO_Transport::~TAO_Transport (void) @@ -243,13 +243,13 @@ TAO_Transport::register_handler (void) int TAO_Transport::idle_after_send (void) { - return this->tms ()->idle_after_send (this); + return this->tms ()->idle_after_send (); } int TAO_Transport::idle_after_reply (void) { - return this->tms ()->idle_after_reply (this); + return this->tms ()->idle_after_reply (); } int diff --git a/TAO/tao/Reply_Dispatcher.cpp b/TAO/tao/Reply_Dispatcher.cpp index 6bb9ee1751c..4cb772cae0b 100644 --- a/TAO/tao/Reply_Dispatcher.cpp +++ b/TAO/tao/Reply_Dispatcher.cpp @@ -25,10 +25,11 @@ TAO_Reply_Dispatcher::message_state (void) const return 0; } -void +int TAO_Reply_Dispatcher::leader_follower_condition_variable (TAO_Transport *) { // no-op. + return 0; } // ********************************************************************* @@ -92,6 +93,11 @@ TAO_Synch_Reply_Dispatcher::dispatch_reply (CORBA::ULong reply_status, (void) this->leader_follower_condition_variable_->signal (); } + else + { + ACE_DEBUG ((LM_DEBUG, + "(%P | %t):TAO_Synch_Reply_Dispatcher::dispatch_reply:cond variable 0\n")); + } return 1; } @@ -114,11 +120,12 @@ TAO_Synch_Reply_Dispatcher::reply_received (void) return reply_received_; } -void +int TAO_Synch_Reply_Dispatcher::leader_follower_condition_variable (TAO_Transport *transport) { this->leader_follower_condition_variable_ = transport->leader_follower_condition_variable (); + return 0; } // ********************************************************************* diff --git a/TAO/tao/Reply_Dispatcher.h b/TAO/tao/Reply_Dispatcher.h index 3298b12b662..8a754dc6eb9 100644 --- a/TAO/tao/Reply_Dispatcher.h +++ b/TAO/tao/Reply_Dispatcher.h @@ -51,7 +51,7 @@ public: virtual TAO_GIOP_Message_State *message_state (void) const; // Get the Message State into which the reply has been read. - virtual void leader_follower_condition_variable (TAO_Transport *); + virtual int leader_follower_condition_variable (TAO_Transport *); // Obtain the condition variable used in the Leader Follower Wait // Strategy. This is valid only for the synchronous reply dispatcher // and only when the Leader Follower wait strategy is used. @@ -105,7 +105,7 @@ public: // reply will be dispatched as soon as it is available and the // dispatcher will go away immediately after that. - virtual void leader_follower_condition_variable (TAO_Transport *); + virtual int leader_follower_condition_variable (TAO_Transport *); // Obtain the condition variable used in the Leader Follower Wait // Strategy. diff --git a/TAO/tao/Transport_Mux_Strategy.cpp b/TAO/tao/Transport_Mux_Strategy.cpp index b18471fb17a..88623d0fdb5 100644 --- a/TAO/tao/Transport_Mux_Strategy.cpp +++ b/TAO/tao/Transport_Mux_Strategy.cpp @@ -5,7 +5,8 @@ #include "tao/debug.h" #include "tao/Pluggable.h" -TAO_Transport_Mux_Strategy::TAO_Transport_Mux_Strategy (void) +TAO_Transport_Mux_Strategy::TAO_Transport_Mux_Strategy (TAO_Transport *transport) + : transport_ (transport) { } @@ -13,13 +14,24 @@ TAO_Transport_Mux_Strategy::~TAO_Transport_Mux_Strategy (void) { } + +int +TAO_Transport_Mux_Strategy::bind_dispatcher (CORBA::ULong, + TAO_Reply_Dispatcher *rd) +{ + // Help the Reply dispatcher to obtain leader follower condition + // variable. + return rd->leader_follower_condition_variable (this->transport_); +} + // ********************************************************************* -TAO_Exclusive_TMS::TAO_Exclusive_TMS (TAO_ORB_Core *orb_core) - : request_id_generator_ (0), +TAO_Exclusive_TMS::TAO_Exclusive_TMS (TAO_Transport *transport) + : TAO_Transport_Mux_Strategy (transport), + request_id_generator_ (0), request_id_ (0), rd_ (0), - message_state_ (orb_core) + message_state_ (transport->orb_core ()) { } @@ -52,6 +64,9 @@ TAO_Exclusive_TMS::bind_dispatcher (CORBA::ULong request_id, if (this->message_state_.message_size != 0) this->message_state_.reset (); + return TAO_Transport_Mux_Strategy::bind_dispatcher (request_id, + rd); + return 0; } @@ -102,17 +117,17 @@ TAO_Exclusive_TMS::destroy_message_state (TAO_GIOP_Message_State *) } int -TAO_Exclusive_TMS::idle_after_send (TAO_Transport *) +TAO_Exclusive_TMS::idle_after_send (void) { // No op. return 0; } int -TAO_Exclusive_TMS::idle_after_reply (TAO_Transport *transport) +TAO_Exclusive_TMS::idle_after_reply (void) { - if (transport != 0) - return transport->idle (); + if (this->transport_ != 0) + return this->transport_->idle (); return 0; } @@ -146,9 +161,10 @@ TAO_Exclusive_TMS::reply_received (const CORBA::ULong request_id) // ********************************************************************* -TAO_Muxed_TMS::TAO_Muxed_TMS (TAO_ORB_Core *orb_core) - : request_id_generator_ (0), - orb_core_ (orb_core), +TAO_Muxed_TMS::TAO_Muxed_TMS (TAO_Transport *transport) + : TAO_Transport_Mux_Strategy (transport), + request_id_generator_ (0), + orb_core_ (transport->orb_core ()), message_state_ (0) { } @@ -185,6 +201,10 @@ TAO_Muxed_TMS::bind_dispatcher (CORBA::ULong request_id, return -1; } + + return TAO_Transport_Mux_Strategy::bind_dispatcher (request_id, + rd); + return 0; } @@ -235,7 +255,8 @@ TAO_Muxed_TMS::get_message_state (void) { // Create the next message state. ACE_NEW_RETURN (this->message_state_, - TAO_GIOP_Message_State (this->orb_core_), + TAO_GIOP_Message_State + (this->transport_->orb_core ()), 0); } @@ -250,16 +271,16 @@ TAO_Muxed_TMS::destroy_message_state (TAO_GIOP_Message_State *) } int -TAO_Muxed_TMS::idle_after_send (TAO_Transport *transport) +TAO_Muxed_TMS::idle_after_send (void) { - if (transport != 0) - return transport->idle (); + if (this->transport_ != 0) + return this->transport_->idle (); return 0; } int -TAO_Muxed_TMS::idle_after_reply (TAO_Transport *) +TAO_Muxed_TMS::idle_after_reply (void) { return 0; } diff --git a/TAO/tao/Transport_Mux_Strategy.h b/TAO/tao/Transport_Mux_Strategy.h index 6c13a03e73d..0c9d2b3f150 100644 --- a/TAO/tao/Transport_Mux_Strategy.h +++ b/TAO/tao/Transport_Mux_Strategy.h @@ -43,7 +43,7 @@ class TAO_Export TAO_Transport_Mux_Strategy // public: - TAO_Transport_Mux_Strategy (void); + TAO_Transport_Mux_Strategy (TAO_Transport *transport); // Base class constructor. virtual ~TAO_Transport_Mux_Strategy (void); @@ -57,8 +57,9 @@ public: // pairs. virtual int bind_dispatcher (CORBA::ULong request_id, - TAO_Reply_Dispatcher *rd) = 0; - // Bind the dispatcher with the request id. + TAO_Reply_Dispatcher *rd); + // Bind the dispatcher with the request id. Commonalities in the + // derived class implementations is kept here. virtual int dispatch_reply (CORBA::ULong request_id, CORBA::ULong reply_status, @@ -78,11 +79,11 @@ public: virtual void destroy_message_state (TAO_GIOP_Message_State *) = 0; // Destroy a CDR stream. - virtual int idle_after_send (TAO_Transport *) = 0; + virtual int idle_after_send (void) = 0; // Request has been just sent, but the reply is not received. Idle // the transport now. - virtual int idle_after_reply (TAO_Transport *) = 0; + virtual int idle_after_reply (void) = 0; // Request is sent and the reply is received. Idle the transport // now. @@ -90,6 +91,10 @@ public: // Check whether the reply has been receieved for the request with // <request_id>. Return 0 if no, 1 on yes and -1 if the request_id // is invalid or there are some errors. + +protected: + TAO_Transport *transport_; + // Cache the transport reference. }; // ********************************************************************* @@ -104,7 +109,7 @@ class TAO_Export TAO_Exclusive_TMS : public TAO_Transport_Mux_Strategy // public: - TAO_Exclusive_TMS (TAO_ORB_Core *orb_core); + TAO_Exclusive_TMS (TAO_Transport *transport); // Constructor. virtual ~TAO_Exclusive_TMS (void); @@ -132,14 +137,14 @@ public: virtual void destroy_message_state (TAO_GIOP_Message_State *); // No op in this strategy. - virtual int idle_after_send (TAO_Transport *transport); + virtual int idle_after_send (void); // Request has been just sent, but the reply is not received. Idle // the transport now. - virtual int idle_after_reply (TAO_Transport *transport); + virtual int idle_after_reply (void); // Request is sent and the reply is received. Idle the transport // now. - + virtual int reply_received (const CORBA::ULong request_id); // Check whether the reply has been receieved for the request with // <request_id>. Return 0 if no, 1 on yes and -1 if the request_id @@ -172,7 +177,7 @@ class TAO_Export TAO_Muxed_TMS : public TAO_Transport_Mux_Strategy // public: - TAO_Muxed_TMS (TAO_ORB_Core *orb_core); + TAO_Muxed_TMS (TAO_Transport *transport); // Constructor. virtual ~TAO_Muxed_TMS (void); @@ -200,11 +205,11 @@ public: virtual void destroy_message_state (TAO_GIOP_Message_State *); // No op in this strategy. - virtual int idle_after_send (TAO_Transport *transport); + virtual int idle_after_send (void); // Request has been just sent, but the reply is not received. Idle // the transport now. - virtual int idle_after_reply (TAO_Transport *transport); + virtual int idle_after_reply (void); // Request is sent and the reply is received. Idle the transport // now. diff --git a/TAO/tao/Wait_Strategy.cpp b/TAO/tao/Wait_Strategy.cpp index e29b8b1b035..d29b111743b 100644 --- a/TAO/tao/Wait_Strategy.cpp +++ b/TAO/tao/Wait_Strategy.cpp @@ -566,16 +566,17 @@ TAO_Muxed_Wait_On_Leader_Follower::wait (ACE_Time_Value *max_wait_time, && !leader_follower.is_leader_thread ()) { // = Wait as a follower. - - if (TAO_debug_level >= 5) - ACE_DEBUG ((LM_DEBUG, - "TAO (%P|%t) - wait (follower) on <%x>\n", - this->transport_)); // Grab the condtion variable. ACE_SYNCH_CONDITION* cond = orb_core->leader_follower_condition_variable (); + if (TAO_debug_level >= 5) + ACE_DEBUG ((LM_DEBUG, + "TAO (%P|%t) - wait (follower) on Transport <%x>, cond <%x>\n", + this->transport_, + cond)); + // Add ourselves to the list, do it only once because we can // wake up multiple times from the CV loop. And only do it if // the reply has not been received (it could have arrived while diff --git a/TAO/tao/default_client.cpp b/TAO/tao/default_client.cpp index 56052fb4a3b..141e28e7d82 100644 --- a/TAO/tao/default_client.cpp +++ b/TAO/tao/default_client.cpp @@ -157,17 +157,17 @@ TAO_Default_Client_Strategy_Factory::create_profile_lock (void) // Create the correct client transport muxing strategy. TAO_Transport_Mux_Strategy * -TAO_Default_Client_Strategy_Factory::create_transport_mux_strategy (TAO_ORB_Core *orb_core) +TAO_Default_Client_Strategy_Factory::create_transport_mux_strategy (TAO_Transport *transport) { TAO_Transport_Mux_Strategy *tms = 0; if (this->transport_mux_strategy_ == TAO_MUXED_TMS) ACE_NEW_RETURN (tms, - TAO_Muxed_TMS (orb_core), + TAO_Muxed_TMS (transport), 0); else ACE_NEW_RETURN (tms, - TAO_Exclusive_TMS (orb_core), + TAO_Exclusive_TMS (transport), 0); return tms; diff --git a/TAO/tao/default_client.h b/TAO/tao/default_client.h index 0261dfca0f8..2322315c605 100644 --- a/TAO/tao/default_client.h +++ b/TAO/tao/default_client.h @@ -47,7 +47,7 @@ public: // the TAO_GIOP_Invocation::location_forward and the // TAO_GIOP_Invocation::start - TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_ORB_Core *orb_core); + TAO_Transport_Mux_Strategy *create_transport_mux_strategy (TAO_Transport *transport); // Create the correct client request muxing strategy. TAO_Wait_Strategy *create_wait_strategy (TAO_Transport *transport); |