diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2005-03-24 09:14:56 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2005-03-24 09:14:56 +0000 |
commit | 544edff99b1d44b218685d0d606abd02630c586e (patch) | |
tree | 47aa29d23e8d48eecd52fd3214f238e34a67dfc6 | |
parent | eaff829647099c3c95408d6476b86fdaafe50d37 (diff) | |
download | ATCD-544edff99b1d44b218685d0d606abd02630c586e.tar.gz |
ChangeLogTag: Thu Mar 24 09:14:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
8 files changed, 45 insertions, 23 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.cpp index ac9c1e18bfe..26be3c2f02d 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.cpp @@ -19,6 +19,9 @@ TAO_ECG_Reactive_ConsumerEC_Control:: adapter_ (this), gateway_ (gateway), orb_ (CORBA::ORB::_duplicate (orb)) +#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 + , timer_id_ (-1) +#endif /* TAO_HAS_CORBA_MESSAGING != 0*/ { this->reactor_ = this->orb_->orb_core ()->reactor (); @@ -151,11 +154,11 @@ TAO_ECG_Reactive_ConsumerEC_Control::activate (void) // Schedule the timer after these policies has been set, because the // handle_timeout uses these policies, if done in front, the channel // can crash when the timeout expires before initiazation is ready. - long id = this->reactor_->schedule_timer (&this->adapter_, - 0, - this->rate_, - this->rate_); - if (id == -1) + timer_id_ = this->reactor_->schedule_timer (&this->adapter_, + 0, + this->rate_, + this->rate_); + if (timer_id_ == -1) return -1; } } @@ -172,9 +175,12 @@ TAO_ECG_Reactive_ConsumerEC_Control::activate (void) int TAO_ECG_Reactive_ConsumerEC_Control::shutdown (void) { - int r = - this->reactor_->remove_handler (&this->adapter_, - ACE_Event_Handler::DONT_CALL); + int r = 0; + +#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 + r = this->reactor_->cancel_timer (timer_id_); +#endif /* TAO_HAS_CORBA_MESSAGING */ + this->adapter_.reactor (0); return r; } diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h index 387b2e9dcfc..f09e0da850e 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reactive_ConsumerEC_Control.h @@ -117,6 +117,11 @@ private: /// The ORB reactor ACE_Reactor *reactor_; + +#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 + /// The timer id + long timer_id_; +#endif /* TAO_HAS_CORBA_MESSAGING */ }; #include /**/ "ace/post.h" diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp index 9757b598fdd..e9867dffaf6 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.cpp @@ -19,6 +19,9 @@ TAO_ECG_Reconnect_ConsumerEC_Control:: gateway_ (gateway), orb_ (CORBA::ORB::_duplicate (orb)), is_consumer_ec_connected_ (1) +#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 + , timer_id_ (-1) +#endif /* TAO_HAS_CORBA_MESSAGING != 0*/ { this->reactor_ = this->orb_->orb_core ()->reactor (); @@ -200,11 +203,11 @@ TAO_ECG_Reconnect_ConsumerEC_Control::activate (void) // Schedule the timer after these policies has been set, because the // handle_timeout uses these policies, if done in front, the channel // can crash when the timeout expires before initiazation is ready. - long id = this->reactor_->schedule_timer (&this->adapter_, - 0, - this->rate_, - this->rate_); - if (id == -1) + timer_id_ = this->reactor_->schedule_timer (&this->adapter_, + 0, + this->rate_, + this->rate_); + if (timer_id_ == -1) return -1; } } @@ -221,9 +224,12 @@ TAO_ECG_Reconnect_ConsumerEC_Control::activate (void) int TAO_ECG_Reconnect_ConsumerEC_Control::shutdown (void) { - int r = - this->reactor_->remove_handler (&this->adapter_, - ACE_Event_Handler::DONT_CALL); + int r = 0; + +#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 + r = this->reactor_->cancel_timer (timer_id_); +#endif /* TAO_HAS_CORBA_MESSAGING */ + this->adapter_.reactor (0); return r; } diff --git a/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h index c24dacb2872..efad4e64e31 100644 --- a/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h +++ b/TAO/orbsvcs/orbsvcs/Event/ECG_Reconnect_ConsumerEC_Control.h @@ -130,6 +130,11 @@ private: /// Do we have a connection to the consumer ec int is_consumer_ec_connected_; + +#if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 + /// The timer id + long timer_id_; +#endif /* TAO_HAS_CORBA_MESSAGING */ }; #include /**/ "ace/post.h" diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.h b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.h index 4457d1f280f..8ec08a78287 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_ConsumerControl.h @@ -124,7 +124,7 @@ private: #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 /// The timer id - int timer_id_; + long timer_id_; #endif /* TAO_HAS_CORBA_MESSAGING */ }; diff --git a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.h b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.h index d51c1074240..d04d411302f 100644 --- a/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.h +++ b/TAO/orbsvcs/orbsvcs/Event/EC_Reactive_SupplierControl.h @@ -134,7 +134,7 @@ private: #if defined (TAO_HAS_CORBA_MESSAGING) && TAO_HAS_CORBA_MESSAGING != 0 /// The timer id - int timer_id_; + long timer_id_; #endif /* TAO_HAS_CORBA_MESSAGING */ }; diff --git a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp index 6fd353f5ebd..0de783903ff 100644 --- a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp +++ b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.cpp @@ -1697,7 +1697,7 @@ ACE_ES_Correlation_Module::schedule_timeout (ACE_ES_Consumer_Rep_Timeout *consum // interval.low, interval.high)); // Register the timer. - int id = + long id = this->channel_->schedule_timer (consumer->dependency ()->rt_info, consumer, consumer->preemption_priority (), @@ -1750,7 +1750,7 @@ ACE_ES_Correlation_Module::reschedule_timeout (ACE_ES_Consumer_Rep_Timeout *cons consumer->preemption_priority (::IntervalToPriority (interval)); // Register the timer. - int id = + long id = this->channel_->schedule_timer (0, // Do not pass an RT_Info. consumer, consumer->preemption_priority (), diff --git a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.h b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.h index ca3535f7f62..acc771444c6 100644 --- a/TAO/orbsvcs/orbsvcs/Event/Event_Channel.h +++ b/TAO/orbsvcs/orbsvcs/Event/Event_Channel.h @@ -686,8 +686,8 @@ public: RtecEventChannelAdmin::Dependency &dep); // = Get/set timer returned from the reactor. - int timer_id (void); - void timer_id (int); + long timer_id (void); + void timer_id (long); // = Get/set preemption priority. RtecScheduler::OS_Priority preemption_priority (void); @@ -698,7 +698,7 @@ protected: virtual int execute (void* arg = 0); /// For cancelling timers. - int timer_id_; + long timer_id_; /// Store the preemption priority so we can cancel the correct timer. /// The priority values may change during the life. |