diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2003-08-15 14:25:56 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2003-08-15 14:25:56 +0000 |
commit | c4fb1d64817bdd90b7485602ff21873109c5f555 (patch) | |
tree | 5e984096619f61e8332692e656daa365b4114533 /TAO | |
parent | 5fed5b9bd06ff2e7763307127b3c71ceefeb743d (diff) | |
download | ATCD-c4fb1d64817bdd90b7485602ff21873109c5f555.tar.gz |
ChangeLogTag: Fri Aug 15 14:25:12 UTC 2003 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'TAO')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp | 13 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp | 40 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h | 17 | ||||
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h | 2 |
4 files changed, 69 insertions, 3 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp index 4a1d5a068db..9757b598fdd 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp @@ -41,8 +41,8 @@ TAO_ECG_Reconnect_ConsumerEC_Control::try_reconnect ( ACE_TRY_CHECK; if (!non_existent) { - is_consumer_ec_connected_ = 1; - gateway_->reconnect_consumer_ec(ACE_ENV_SINGLE_ARG_PARAMETER); + this->reconnect(ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; } } ACE_CATCHANY @@ -59,6 +59,7 @@ TAO_ECG_Reconnect_ConsumerEC_Control::reconnect ( ACE_TRY { is_consumer_ec_connected_ = 1; + gateway_->reconnect_consumer_ec(ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -238,6 +239,10 @@ TAO_ECG_Reconnect_ConsumerEC_Control::event_channel_not_exist ( // "ECG_Reconnect_ConsumerControl(%P|%t) - " // "channel %x does not exists\n")); is_consumer_ec_connected_ = 0; + + gateway->suspend_supplier_ec (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + gateway->cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } @@ -272,6 +277,10 @@ TAO_ECG_Reconnect_ConsumerEC_Control::system_exception ( // "ECG_Reconnect_ConsumerControl(%P|%t) - " // "channel %x does not exists system except\n")); is_consumer_ec_connected_ = 0; + + gateway->suspend_supplier_ec (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + gateway->cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; } diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp index df9d25a77dc..0432f32023b 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.cpp @@ -14,6 +14,8 @@ ACE_RCSID(Event, EC_Gateway_IIOP, "$Id$") TAO_EC_Gateway_IIOP::TAO_EC_Gateway_IIOP (void) : busy_count_ (0), update_posted_ (0), + cleanup_posted_ (0), + supplier_ec_suspended_ (0), supplier_info_ (0), consumer_info_ (0), consumer_ (this), @@ -102,6 +104,13 @@ TAO_EC_Gateway_IIOP::cleanup_consumer_proxies (ACE_ENV_SINGLE_ARG_DECL) { ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, this->lock_); + // In case we are still pushing, don't cleanup the proxies + if (this->busy_count_ != 0) + { + this->cleanup_posted_ = 1; + return; + } + this->cleanup_consumer_proxies_i (ACE_ENV_SINGLE_ARG_PARAMETER); } @@ -517,6 +526,13 @@ TAO_EC_Gateway_IIOP::push (const RtecEventComm::EventSet &events this->busy_count_--; + if (this->busy_count_ == 0 && this->cleanup_posted_ != 0) + { + this->cleanup_posted_ = 0; + this->cleanup_consumer_proxies_i (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + } + if (this->busy_count_ == 0 && this->update_posted_ != 0) { this->update_posted_ = 0; @@ -667,6 +683,30 @@ TAO_EC_Gateway_IIOP::consumer_ec_non_existent ( #endif /* TAO_HAS_MINIMUM_CORBA */ } +void +TAO_EC_Gateway_IIOP::suspend_supplier_ec (ACE_ENV_SINGLE_ARG_DECL) +{ + if (!CORBA::is_nil (this->supplier_proxy_.in ()) && supplier_ec_suspended_ == 0) + { + this->supplier_proxy_->suspend_connection (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + supplier_ec_suspended_ = 1; + } +} + +void +TAO_EC_Gateway_IIOP::resume_supplier_ec (ACE_ENV_SINGLE_ARG_DECL) +{ + if (!CORBA::is_nil (this->supplier_proxy_.in ()) && supplier_ec_suspended_ == 1) + { + this->supplier_proxy_->resume_connection (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + supplier_ec_suspended_ = 0; + } +} + #if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) template class ACE_PushConsumer_Adapter<TAO_EC_Gateway_IIOP>; diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h index 55b72425425..2dd758d825d 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Gateway_IIOP.h @@ -116,6 +116,12 @@ public: /// ec again, just set the object to nil int cleanup_supplier_ec (void); + /// Suspend the connection to the supplier ec + void suspend_supplier_ec (ACE_ENV_SINGLE_ARG_DECL); + + /// Resume the connection to the supplier ec + void resume_supplier_ec (ACE_ENV_SINGLE_ARG_DECL); + private: void close_i (ACE_ENV_SINGLE_ARG_DECL); @@ -168,6 +174,17 @@ protected: int update_posted_; RtecEventChannelAdmin::ConsumerQOS c_qos_; + /** + * We have a cleanup outstanding and must wait doing cleanup until all pushes + * are ready. + */ + int cleanup_posted_; + + /** + * Is the supplier ec suspended? + */ + int supplier_ec_suspended_; + /// The event channel acting as supplier for this gateway so we can reconnect /// when the list changes. RtecEventChannelAdmin::EventChannel_var supplier_ec_; diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h index 725e9617aab..009f6fba1b9 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_ProxySupplier.h @@ -115,7 +115,7 @@ public: /// Pushes to the consumer, verifies that it is connected and that it /// is not suspended. /** - * These methods take <consumer> argument because during the time + * These methods take @a consumer argument because during the time * the filters have been processing the event, this proxy's consumer * may have changed. */ |