diff options
author | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-22 20:24:58 +0000 |
---|---|---|
committer | pradeep <pradeep@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-22 20:24:58 +0000 |
commit | 24700fefd0c617c834ccea1e840e67dfdaa326d5 (patch) | |
tree | d4971bb53ab07fed1f482780e065bad2834adf9b | |
parent | 4c0786e72c75117b33302f2dbd504f3654f22249 (diff) | |
download | ATCD-24700fefd0c617c834ccea1e840e67dfdaa326d5.tar.gz |
*** empty log message ***
125 files changed, 2002 insertions, 1033 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Admin.cpp b/TAO/orbsvcs/orbsvcs/Notify/Admin.cpp index 9647c2aa451..ec510943c8f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Admin.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Admin.cpp @@ -1,12 +1,11 @@ // $Id$ - #include "Admin.h" #if ! defined (__ACE_INLINE__) #include "Admin.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Admin, "$Id$") +ACE_RCSID(Notify, TAO_NS_Admin, "$Id$") #include "orbsvcs/CosNotifyChannelAdminC.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.cpp b/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.cpp index 46b3d3c0ec2..9f5e56ece6d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/AdminProperties.cpp @@ -11,12 +11,12 @@ ACE_RCSID(Notify, TAO_NS_AdminProperties, "$id$") #include "orbsvcs/CosNotificationC.h" TAO_NS_AdminProperties::TAO_NS_AdminProperties (void) - : max_global_queue_length_ (CosNotification::MaxQueueLength, 0), - max_consumers_ (CosNotification::MaxConsumers, 0), - max_suppliers_ (CosNotification::MaxSuppliers, 0), - reject_new_events_ (CosNotification::RejectNewEvents, 0), - global_queue_length_ (0), - global_queue_not_full_condition_ (global_queue_lock_) + : max_global_queue_length_ (CosNotification::MaxQueueLength, 0) + , max_consumers_ (CosNotification::MaxConsumers, 0) + , max_suppliers_ (CosNotification::MaxSuppliers, 0) + , reject_new_events_ (CosNotification::RejectNewEvents, 0) + , global_queue_length_ (0) + , global_queue_not_full_condition_ (global_queue_lock_) { } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp index 4eaaa2555b9..bf16f89d514 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.cpp @@ -11,77 +11,102 @@ ACE_RCSID(Notify, TAO_NS_AnyEvent, "$id$") #include "../Consumer.h" #include "tao/debug.h" -TAO_NS_EventType TAO_NS_AnyEvent::event_type_; +TAO_NS_EventType TAO_NS_AnyEvent_No_Copy::event_type_; -TAO_NS_AnyEvent::TAO_NS_AnyEvent (const CORBA::Any &event) - : event_ (event) +TAO_NS_AnyEvent_No_Copy::TAO_NS_AnyEvent_No_Copy (const CORBA::Any &event) + : event_ (&event) { } -TAO_NS_AnyEvent::~TAO_NS_AnyEvent () +TAO_NS_AnyEvent_No_Copy::~TAO_NS_AnyEvent_No_Copy () +{ +} + +TAO_NS_Event* +TAO_NS_AnyEvent_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) const { + TAO_NS_Event* copy; + + ACE_NEW_THROW_EX (copy, + TAO_NS_AnyEvent (*this->event_), + CORBA::NO_MEMORY ()); + + return copy; } const TAO_NS_EventType& -TAO_NS_AnyEvent::type (void) const +TAO_NS_AnyEvent_No_Copy::type (void) const { return this->event_type_; } void -TAO_NS_AnyEvent::convert (CosNotification::StructuredEvent& notification) +TAO_NS_AnyEvent_No_Copy::convert (CosNotification::StructuredEvent& notification) const { - TAO_NS_Event::translate (this->event_, notification); + TAO_NS_Event::translate (*this->event_, notification); } CORBA::Boolean -TAO_NS_AnyEvent::do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) +TAO_NS_AnyEvent_No_Copy::do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - " "TAO_Notify_AnyEvent::do_match ()\n")); - return filter->match(this->event_ ACE_ENV_ARG_PARAMETER); + return filter->match(*this->event_ ACE_ENV_ARG_PARAMETER); } void -TAO_NS_AnyEvent::push (TAO_NS_Consumer* consumer ACE_ENV_ARG_DECL) const +TAO_NS_AnyEvent_No_Copy::push (TAO_NS_Consumer* consumer ACE_ENV_ARG_DECL) const { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - " "TAO_Notify_AnyEvent::push \n")); - consumer->push (this->event_ ACE_ENV_ARG_PARAMETER); + consumer->push (*this->event_ ACE_ENV_ARG_PARAMETER); } void -TAO_NS_AnyEvent::push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) +TAO_NS_AnyEvent_No_Copy::push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const { CosNotification::StructuredEvent notification; - TAO_NS_Event::translate (this->event_, notification); + TAO_NS_Event::translate (*this->event_, notification); forwarder->forward_structured (notification ACE_ENV_ARG_PARAMETER); } void -TAO_NS_AnyEvent::push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) +TAO_NS_AnyEvent_No_Copy::push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const { CosNotification::StructuredEvent notification; - TAO_NS_Event::translate (this->event_, notification); + TAO_NS_Event::translate (*this->event_, notification); forwarder->forward_structured_no_filtering (notification ACE_ENV_ARG_PARAMETER); } void -TAO_NS_AnyEvent::push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) +TAO_NS_AnyEvent_No_Copy::push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const { - forwarder->forward_any (this->event_ ACE_ENV_ARG_PARAMETER); + forwarder->forward_any (*this->event_ ACE_ENV_ARG_PARAMETER); } void -TAO_NS_AnyEvent::push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) +TAO_NS_AnyEvent_No_Copy::push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const +{ + forwarder->forward_any_no_filtering (*this->event_ ACE_ENV_ARG_PARAMETER); +} + +/*****************************************************************************************************/ + +TAO_NS_AnyEvent::TAO_NS_AnyEvent (const CORBA::Any &event) + : TAO_NS_AnyEvent_No_Copy (event) + , any_copy_ (event) +{ + this->event_ = &any_copy_; +} + +TAO_NS_AnyEvent::~TAO_NS_AnyEvent () { - forwarder->forward_any_no_filtering (this->event_ ACE_ENV_ARG_PARAMETER); } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h index d77191e05b1..79896de3930 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Any/AnyEvent.h @@ -31,47 +31,72 @@ class TAO_NS_Consumer; * @brief * */ -class TAO_Notify_Export TAO_NS_AnyEvent : public TAO_NS_Event +class TAO_Notify_Export TAO_NS_AnyEvent_No_Copy : public TAO_NS_Event { friend class TAO_NS_Builder; public: /// Constuctor - TAO_NS_AnyEvent (const CORBA::Any &event); + TAO_NS_AnyEvent_No_Copy (const CORBA::Any &event); /// Destructor - ~TAO_NS_AnyEvent (); + ~TAO_NS_AnyEvent_No_Copy (); + + /// Copy the event. + virtual TAO_NS_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const; /// Get the event type. virtual const TAO_NS_EventType& type (void) const; - CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL); + CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const; /// Convert to CosNotification::Structured type - virtual void convert (CosNotification::StructuredEvent& notification); + virtual void convert (CosNotification::StructuredEvent& notification) const; /// Push event to consumer virtual void push (TAO_NS_Consumer* consumer ACE_ENV_ARG_DECL) const; /// Push event to the Event_Forwarder interface - virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL); + virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; /// Push event to the Event_Forwarder interface - virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL); + virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; /// Push event to the Event_Forwarder interface - virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL); + virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; /// Push event to the Event_Forwarder interface - virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL); + virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; protected: /// Any Event - CORBA::Any event_; + const CORBA::Any* event_; /// Our event type. static TAO_NS_EventType event_type_; }; +/*****************************************************************************************************/ + +/** + * @class TAO_NS_AnyEvent + * + * @brief AnyEvent implementation. + * + */ +class TAO_Notify_Export TAO_NS_AnyEvent : public TAO_NS_AnyEvent_No_Copy +{ +public: + /// Constuctor + TAO_NS_AnyEvent (const CORBA::Any &event); + + /// Destructor + ~TAO_NS_AnyEvent (); + +protected: + /// Copy of the Event. + CORBA::Any any_copy_; +}; + #if defined (__ACE_INLINE__) #include "AnyEvent.inl" #endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.cpp index 92576ba0b82..8290ea2ed97 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Any/CosEC_ProxyPushConsumer.cpp @@ -10,6 +10,8 @@ ACE_RCSID(Notify, TAO_NS_CosEC_ProxyPushConsumer, "$id$") #include "tao/debug.h" #include "../AdminProperties.h" +#include "../Method_request_Lookup.h" +#include "../Worker_Task.h" #include "AnyEvent.h" #include "PushSupplier.h" @@ -48,7 +50,7 @@ TAO_NS_CosEC_ProxyPushConsumer::push (TAO_NS_Event_var &/*event*/) } void -TAO_NS_CosEC_ProxyPushConsumer::push (const CORBA::Any& data ACE_ENV_ARG_DECL) +TAO_NS_CosEC_ProxyPushConsumer::push (const CORBA::Any& any ACE_ENV_ARG_DECL) ACE_THROW_SPEC (( CORBA::SystemException , CosEventComm::Disconnected @@ -64,11 +66,11 @@ TAO_NS_CosEC_ProxyPushConsumer::push (const CORBA::Any& data ACE_ENV_ARG_DECL) ACE_THROW (CosEventComm::Disconnected ()); } - // Convert - TAO_NS_Event_var event (new TAO_NS_AnyEvent (data)); + TAO_NS_AnyEvent_No_Copy event (any); - // Continue processing. - this->TAO_NS_ProxyConsumer::push (event); + TAO_NS_Method_Request_Lookup_No_Copy request (&event, this); + + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); } void diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.cpp index d09f50987a7..4f08b4e0551 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Any/ProxyPushConsumer.cpp @@ -10,6 +10,8 @@ ACE_RCSID(Notify, TAO_NS_ProxyPushConsumer, "$id$") #include "tao/debug.h" #include "../AdminProperties.h" +#include "../Method_request_Lookup.h" +#include "../Worker_Task.h" #include "AnyEvent.h" #include "PushSupplier.h" @@ -60,7 +62,7 @@ TAO_NS_ProxyPushConsumer::push (TAO_NS_Event_var &/*event*/) } void -TAO_NS_ProxyPushConsumer::push (const CORBA::Any& data ACE_ENV_ARG_DECL) +TAO_NS_ProxyPushConsumer::push (const CORBA::Any& any ACE_ENV_ARG_DECL) ACE_THROW_SPEC (( CORBA::SystemException , CosEventComm::Disconnected @@ -76,11 +78,11 @@ TAO_NS_ProxyPushConsumer::push (const CORBA::Any& data ACE_ENV_ARG_DECL) ACE_THROW (CosEventComm::Disconnected ()); } - // Convert - TAO_NS_Event_var event (new TAO_NS_AnyEvent (data)); + TAO_NS_AnyEvent_No_Copy event (any); - // Continue processing. - this->TAO_NS_ProxyConsumer::push (event); + TAO_NS_Method_Request_Lookup_No_Copy request (&event, this); + + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); } void diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp index ec6b2298fac..7a5b5d32d8d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.cpp @@ -46,6 +46,12 @@ TAO_NS_PushConsumer::release (void) } void +TAO_NS_PushConsumer::push_i (const TAO_NS_Event* event ACE_ENV_ARG_DECL) +{ + event->push (this ACE_ENV_ARG_PARAMETER); +} + +void TAO_NS_PushConsumer::push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL) { event->push (this ACE_ENV_ARG_PARAMETER); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.h index 7a3d5c7ed39..a5fbd384a91 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Any/PushConsumer.h @@ -44,7 +44,10 @@ public: virtual void release (void); /// Push <event> to this consumer. - void push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); + virtual void push_i (const TAO_NS_Event* event ACE_ENV_ARG_DECL); + + /// Push <event> to this consumer. + virtual void push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); /// Push <event> to this consumer. virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp index c030592d339..d2a5bdd3e7f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Buffering_Strategy.cpp @@ -6,7 +6,7 @@ #include "Buffering_Strategy.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Buffering_Strategy, "$id$") +ACE_RCSID(Notify, TAO_NS_Buffering_Strategy, "$Id$") #include "ace/Message_Queue.h" #include "orbsvcs/CosNotificationC.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Builder.cpp b/TAO/orbsvcs/orbsvcs/Notify/Builder.cpp index 85262621eb9..9efaf028d3f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Builder.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Builder.cpp @@ -419,7 +419,7 @@ TAO_NS_Builder::apply_thread_pool_concurrency (TAO_NS_Object& object, const Noti } void -TAO_NS_Builder::apply_lane_concurrency (TAO_NS_Object& object, const NotifyExt::ThreadPoolLanesParams& /*tpl_params*/ ACE_ENV_ARG_DECL) +TAO_NS_Builder::apply_lane_concurrency (TAO_NS_Object& /*object*/, const NotifyExt::ThreadPoolLanesParams& /*tpl_params*/ ACE_ENV_ARG_DECL) { // No lane support ACE_THROW (CORBA::NO_IMPLEMENT ()); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp index 2210c3ca7ad..d9b87c8befa 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.cpp @@ -30,38 +30,6 @@ TAO_NS_Consumer::proxy (void) } void -TAO_NS_Consumer::push (const TAO_NS_Event_var &event ACE_ENV_ARG_DECL) -{ - if (this->is_suspended_ == 1) // If we're suspended, queue for later delivery. - { - ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ()); - this->event_collection_->enqueue_head (event); - - return; - } - - ACE_TRY - { - this->push_i (event ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_exist) - { - this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::SystemException, sysex) - { - this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - } - ACE_ENDTRY; -} - -void TAO_NS_Consumer::dispatch_pending (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) { if (this->is_suspended_ == 1) @@ -77,7 +45,7 @@ TAO_NS_Consumer::dispatch_pending (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) TAO_NS_ProxySupplier* proxy_supplier = this->proxy_supplier (); - TAO_NS_Event_var event; + TAO_NS_Event_var event; while (!event_collection_copy.is_empty ()) { @@ -85,7 +53,7 @@ TAO_NS_Consumer::dispatch_pending (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) { proxy_supplier->push_no_filtering (event); } - } + } } void diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h index 9537e8f3398..f0d3ec1a54f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.h @@ -49,6 +49,9 @@ public: virtual TAO_NS_Proxy* proxy (void); /// Push <event> to this consumer. + void push (const TAO_NS_Event* event ACE_ENV_ARG_DECL); + + /// Push <event> to this consumer. void push (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); /// Push <event> to this consumer. @@ -76,6 +79,9 @@ protected: ACE_ENV_ARG_DECL); /// Push Implementation. + virtual void push_i (const TAO_NS_Event* event ACE_ENV_ARG_DECL) = 0; + + /// Push Implementation. virtual void push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL) = 0; /// Get the shared Proxy Lock diff --git a/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl b/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl index d2a5a104c85..9c5c391e6f9 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Consumer.inl @@ -25,3 +25,72 @@ TAO_NS_Consumer::suspend (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) { this->is_suspended_ = 1; } + +ACE_INLINE void +TAO_NS_Consumer::push (const TAO_NS_Event_var &event ACE_ENV_ARG_DECL) +{ + if (this->is_suspended_ == 1) // If we're suspended, queue for later delivery. + { + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ()); + + this->event_collection_->enqueue_head (event); + + return; + } + + ACE_TRY + { + this->push_i (event ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_exist) + { + this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::SystemException, sysex) + { + this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; +} + +ACE_INLINE void +TAO_NS_Consumer::push (const TAO_NS_Event* event ACE_ENV_ARG_DECL) +{ + if (this->is_suspended_ == 1) // If we're suspended, queue for later delivery. + { + ACE_GUARD (TAO_SYNCH_MUTEX, ace_mon, *this->proxy_lock ()); + + TAO_NS_Event* event_copy = event->copy (ACE_ENV_SINGLE_ARG_PARAMETER); + TAO_NS_Event_Copy_var event_var (event_copy); + + this->event_collection_->enqueue_head (event_var); + + return; + } + + ACE_TRY + { + this->push_i (event ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::OBJECT_NOT_EXIST, not_exist) + { + this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCH (CORBA::SystemException, sysex) + { + this->handle_dispatch_exception (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + } + ACE_ENDTRY; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp index e39392c49ef..bc1a36fc936 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.cpp @@ -104,7 +104,7 @@ CosNotifyChannelAdmin::ProxySupplier_ptr TAO_NS_ConsumerAdmin::obtain_notification_push_supplier_with_qos (CosNotifyChannelAdmin::ClientType ctype, CosNotifyChannelAdmin::ProxyID_out proxy_id, const CosNotification::QoSProperties & initial_qos - ACE_ENV_ARG_DECL_WITH_DEFAULTS + ACE_ENV_ARG_DECL ) ACE_THROW_SPEC (( CORBA::SystemException diff --git a/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.h b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.h index 3cc245baf8f..82dde1c4304 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.h +++ b/TAO/orbsvcs/orbsvcs/Notify/ConsumerAdmin.h @@ -62,7 +62,7 @@ protected: obtain_notification_push_supplier_with_qos (CosNotifyChannelAdmin::ClientType ctype, CosNotifyChannelAdmin::ProxyID_out proxy_id, const CosNotification::QoSProperties & initial_qos - ACE_ENV_ARG_DECL_WITH_DEFAULTS + ACE_ENV_ARG_DECL ) ACE_THROW_SPEC (( CORBA::SystemException diff --git a/TAO/orbsvcs/orbsvcs/Notify/Container_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Container_T.cpp index ad43477e2da..7cddc56764d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Container_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Container_T.cpp @@ -15,7 +15,7 @@ #include "Container_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Container_T, "$Id$") +ACE_RCSID(Notify, TAO_NS_Container_T, "$Id$") template<class TYPE> TAO_NS_Container_T<TYPE>::TAO_NS_Container_T (void) diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.cpp b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.cpp index 326efa455fd..2195dd652ae 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Initializer.cpp @@ -2,7 +2,7 @@ #include "CosNotify_Initializer.h" -ACE_RCSID(Notify, TAO_NS_CosNotify_Initializer, "$id$") +ACE_RCSID(Notify, TAO_NS_CosNotify_Initializer, "$Id$") #include "CosNotify_Service.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp index bec3fca7246..1e0a7cccacd 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.cpp @@ -11,7 +11,7 @@ #include "orbsvcs/NotifyExtC.h" #include "tao/debug.h" -ACE_RCSID(RT_Notify, TAO_CosNotify_Service, "$Id$") +ACE_RCSID(Notify, TAO_CosNotify_Service, "$Id$") TAO_CosNotify_Service::TAO_CosNotify_Service (void) : factory_ (0) @@ -91,7 +91,7 @@ TAO_CosNotify_Service::init (int argc, char *argv[]) properties->asynch_updates (1); } - else if (arg_shifter.cur_arg_strncasecmp (ACE_LIB_TEXT("-AllocateTaskperProxy")) == 0) + else if (arg_shifter.cur_arg_strncasecmp (ACE_LIB_TEXT("-AllocateTaskperProxy")) == 0) { task_per_proxy = 1; arg_shifter.consume_arg (); @@ -170,10 +170,6 @@ TAO_CosNotify_Service::init (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) void TAO_CosNotify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) { - /// first, init the main thread. - //this->init_main_thread (orb ACE_ENV_ARG_PARAMETER); - //ACE_CHECK; - // Obtain the Root POA CORBA::Object_var object = orb->resolve_initial_references("RootPOA" ACE_ENV_ARG_PARAMETER); @@ -181,89 +177,23 @@ TAO_CosNotify_Service::init_i (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL) if (CORBA::is_nil (object.in ())) ACE_ERROR ((LM_ERROR, - " (%P|%t) Unable to resolve the RootPOA.\n")); + " (%P|%t) Unable to resolve the RootPOA.\n")); PortableServer::POA_var default_poa = PortableServer::POA::_narrow (object.in () ACE_ENV_ARG_PARAMETER); ACE_CHECK; /// Set the properties - TAO_NS_Properties* properties = TAO_NS_PROPERTIES::instance(); - - properties->orb (orb); - properties->default_poa (default_poa.in ()); - properties->sched_policy (orb->orb_core ()->orb_params ()->sched_policy ()); - properties->scope_policy (orb->orb_core ()->orb_params ()->scope_policy ()); - - // Init the factory - this->init_factory (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - - this->init_builder (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; -} - -void -TAO_CosNotify_Service::init_main_thread (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL_NOT_USED) -{ - ACE_Sched_Params::Policy sched_policy; - long thr_sched_policy = orb->orb_core ()->orb_params ()->sched_policy (); - - //long thr_scope_policy = orb->orb_core ()->orb_params ()->scope_policy (); - - if (thr_sched_policy == THR_SCHED_FIFO) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_FIFO\n")); - - sched_policy = ACE_SCHED_FIFO; - } - else if (thr_sched_policy == THR_SCHED_RR) - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_RR\n")); - - sched_policy = ACE_SCHED_RR; - } - else - { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG, "Sched policy = THR_SCHED_OTHER\n")); - - sched_policy = ACE_SCHED_OTHER; - } + TAO_NS_Properties* properties = TAO_NS_PROPERTIES::instance(); - /// Check sched. - int min_priority = ACE_Sched_Params::priority_min (sched_policy); - int max_priority = ACE_Sched_Params::priority_max (sched_policy); + properties->orb (orb); + properties->default_poa (default_poa.in ()); - if (TAO_debug_level > 0) - { - ACE_DEBUG ((LM_DEBUG, "max_priority = %d, min_priority = %d\n", - max_priority, min_priority)); + // Init the factory + this->init_factory (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; - if (max_priority == min_priority) - { - ACE_DEBUG ((LM_DEBUG,"Detected max_priority == min_priority\n")); - } - } - - // Set the main thread to min priority... - int priority = min_priority; - - if (ACE_OS::sched_params (ACE_Sched_Params (sched_policy , - priority, - ACE_SCOPE_PROCESS)) != 0) - { - if (ACE_OS::last_error () == EPERM) - { - ACE_DEBUG ((LM_DEBUG, - "(%P|%t): user is not superuser, " - "test runs in time-shared class\n")); - } - else - ACE_ERROR ((LM_ERROR, - "(%P|%t): sched_params failed\n")); - } + this->init_builder (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; } void diff --git a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h index afbd64a3bf9..6a00ade8b66 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h +++ b/TAO/orbsvcs/orbsvcs/Notify/CosNotify_Service.h @@ -64,9 +64,6 @@ protected: /// Create the Builder for Notify objects. virtual void init_builder (ACE_ENV_SINGLE_ARG_DECL); - /// Apply ORB Scheduling policy to main thread and set its priority to the lowest available. - void init_main_thread (CORBA::ORB_ptr orb ACE_ENV_ARG_DECL); - /// Set thread options on <qos>. void set_threads (CosNotification::QoSProperties &qos, int threads); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.cpp index 0b618b12daf..4bb103ddd7d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Default_Factory.cpp @@ -6,7 +6,7 @@ #include "Default_Factory.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RN_Notify, TAO_NS_Default_Factory, "$Id$") +ACE_RCSID(Notify, TAO_NS_Default_Factory, "$Id$") #include "orbsvcs/ESF/ESF_Proxy_List.h" #include "orbsvcs/ESF/ESF_Copy_On_Write.h" @@ -224,30 +224,30 @@ template class TAO_ESF_Proxy_Collection<TAO_NS_Peer>; template class ACE_Unbounded_Set<int>; //template class ACE_Unbounded_Set<TAO_NS_EventType>; -template class ACE_Unbounded_Set<TAO_NS_ProxySupplier *>; +//template class ACE_Unbounded_Set<TAO_NS_ProxySupplier *>; template class ACE_Unbounded_Set_Const_Iterator<int>; template class ACE_Unbounded_Set_Iterator<TAO_NS_Proxy *>; -template class TAO_ESF_Copy_On_Write<TAO_NS_Proxy, TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Iterator<TAO_NS_Proxy *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write<TAO_NS_Peer, TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Iterator<TAO_NS_Peer *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write<TAO_NS_Consumer, TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Iterator<TAO_NS_Consumer *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write<TAO_NS_Supplier, TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Iterator<TAO_NS_Supplier *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write<TAO_NS_EventChannel, TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write<TAO_NS_ProxyConsumer, TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write<TAO_NS_ProxySupplier, TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write<TAO_NS_ConsumerAdmin, TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write<TAO_NS_SupplierAdmin, TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_Proxy, TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_Peer, TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_Consumer, TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_Supplier, TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_EventChannel, TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_ProxyConsumer, TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_ProxySupplier, TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_ConsumerAdmin, TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write<TAO_NS_SupplierAdmin, TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>,ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier*>,TAO_SYNCH_MUTEX>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_EventChannel>,ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel*>,TAO_SYNCH_MUTEX>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>,ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin*>,TAO_SYNCH_MUTEX>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>,ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin*>,TAO_SYNCH_MUTEX>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>,ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer*>,TAO_SYNCH_MUTEX>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Consumer>,ACE_Unbounded_Set_Iterator<TAO_NS_Consumer*>,TAO_SYNCH_MUTEX>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Supplier>,ACE_Unbounded_Set_Iterator<TAO_NS_Supplier*>,TAO_SYNCH_MUTEX>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Peer>,ACE_Unbounded_Set_Iterator<TAO_NS_Peer*>,TAO_SYNCH_MUTEX>; -template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Proxy>,ACE_Unbounded_Set_Iterator<TAO_NS_Proxy*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_EventChannel>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Consumer>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Supplier>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Peer>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer*>,TAO_SYNCH_MUTEX>; +template class TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Proxy>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy*>,TAO_SYNCH_MUTEX>; @@ -261,45 +261,48 @@ template class TAO_ESF_Proxy_List<TAO_NS_EventChannel>; template class TAO_ESF_Proxy_List<TAO_NS_Peer>; template class TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>; -template class ACE_Unbounded_Set<TAO_NS_Peer *>; -template class ACE_Unbounded_Set<TAO_NS_Supplier *>; -template class ACE_Unbounded_Set<TAO_NS_Consumer *>; -template class ACE_Unbounded_Set<TAO_NS_ProxyConsumer *>; -template class ACE_Unbounded_Set<TAO_NS_ConsumerAdmin *>; -template class ACE_Unbounded_Set<TAO_NS_SupplierAdmin *>; -template class ACE_Unbounded_Set<TAO_NS_EventChannel *>; -template class ACE_Unbounded_Set<TAO_NS_Proxy *>; - -template class ACE_Unbounded_Set_Iterator<TAO_NS_Peer *>; -template class ACE_Unbounded_Set_Iterator<TAO_NS_Supplier *>; -template class ACE_Unbounded_Set_Iterator<TAO_NS_Consumer *>; -template class ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer *>; -template class ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier *>; -template class ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin *>; -template class ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin *>; -template class ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_Peer *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_Supplier *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_Consumer *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_ProxyConsumer *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_ProxySupplier *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_ConsumerAdmin *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_SupplierAdmin *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_EventChannel *>; +template class ACE_Unbounded_Set_Ex<TAO_NS_Proxy *>; +//template class ACE_Unbounded_Set<int>; + +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer *>; +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier *>; +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer *>; +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer *>; +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier *>; +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin *>; +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin *>; +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel *>; +template class ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *>; template class ACE_Unbounded_Set_Iterator<int>; -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Iterator<TAO_NS_Proxy *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Iterator<TAO_NS_Peer *>, ACE_SYNCH>; - -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Iterator<TAO_NS_Consumer *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier *>, ACE_SYNCH>; -template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Iterator<TAO_NS_Supplier *>, ACE_SYNCH>; - -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer *> >; -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Iterator<TAO_NS_Supplier *> >; -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin *> >; -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin *> >; -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel *> >; -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Iterator<TAO_NS_Consumer *> >; -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Iterator<TAO_NS_Peer *> >; -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier *> >; -template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Iterator<TAO_NS_Proxy *> >; +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer *>, ACE_SYNCH>; + +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier *>, ACE_SYNCH>; +template class TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier *>, ACE_SYNCH>; + +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer *> >; +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier *> >; +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin *> >; +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin *> >; +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel *> >; +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer *> >; +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer *> >; +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier *> >; +template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *> >; #elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) @@ -333,29 +336,29 @@ template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Proxy> #pragma instantiate ACE_Unbounded_Set<int> #pragma instantiate ACE_Unbounded_Set<TAO_NS_EventType> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_ProxySupplier *> +//#pragma instantiate ACE_Unbounded_Set<TAO_NS_ProxySupplier *> #pragma instantiate ACE_Unbounded_Set_Const_Iterator<int> -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_Proxy *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_Proxy, TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Iterator<TAO_NS_Proxy *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_Peer, TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Iterator<TAO_NS_Peer *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_Consumer, TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Iterator<TAO_NS_Consumer *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_Supplier, TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Iterator<TAO_NS_Supplier *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_EventChannel, TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_ProxyConsumer, TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_ProxySupplier, TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_ConsumerAdmin, TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_SupplierAdmin, TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_Proxy, TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_Peer, TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_Consumer, TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_Supplier, TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_EventChannel, TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_ProxyConsumer, TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_ProxySupplier, TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_ConsumerAdmin, TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write<TAO_NS_SupplierAdmin, TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>,ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier*>,ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_EventChannel>,ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel*>,ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>,ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin*>,ACE_SYNCH>#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>,ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin*>,ACE_SYNCH> -#pragma instantitae TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>,ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer*>,ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Consumer>,ACE_Unbounded_Set_Iterator<TAO_NS_Consumer*>,ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Supplier>,ACE_Unbounded_Set_Iterator<TAO_NS_Supplier*>,ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Peer>,ACE_Unbounded_Set_Iterator<TAO_NS_Peer*>,ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Proxy>,ACE_Unbounded_Set_Iterator<TAO_NS_Proxy*>,ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier*>,ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_EventChannel>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel*>,ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin*>,ACE_SYNCH>#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin*>,ACE_SYNCH> +#pragma instantitae TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer*>,ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Consumer>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer*>,ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Supplier>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier*>,ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Peer>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer*>,ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Read_Guard<TAO_ESF_Proxy_List<TAO_NS_Proxy>,ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy*>,ACE_SYNCH> @@ -369,43 +372,45 @@ template class TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Proxy> #pragma instantiate TAO_ESF_Proxy_List<TAO_NS_Peer> #pragma instantiate TAO_ESF_Proxy_List<TAO_NS_ProxySupplier> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_Peer *> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_Supplier *> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_Consumer *> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_ProxyConsumer *> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_ConsumerAdmin *> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_SupplierAdmin *> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_EventChannel *> -#pragma instantiate ACE_Unbounded_Set<TAO_NS_Proxy *> - -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_Peer *> -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_Supplier *> -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_Consumer *> -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer *> -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier *> -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin *> -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin *> -#pragma instantiate ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_Peer *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_Supplier *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_Consumer *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_ProxyConsumer *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_ProxySupplier *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_ConsumerAdmin *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_SupplierAdmin *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_EventChannel *> +#pragma instantiate ACE_Unbounded_Set_Ex<TAO_NS_Proxy *> + +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel *> +#pragma instantiate ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *> #pragma instantiate ACE_Unbounded_Set_Iterator<int> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Iterator<TAO_NS_Proxy *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Iterator<TAO_NS_Peer *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Iterator<TAO_NS_Consumer *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier *>, ACE_SYNCH> -#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Iterator<TAO_NS_Supplier *>, ACE_SYNCH> - -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxyConsumer *> > -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Iterator<TAO_NS_Supplier *> > -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_ConsumerAdmin *> > -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Iterator<TAO_NS_SupplierAdmin *> > -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Iterator<TAO_NS_EventChannel *> > -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Iterator<TAO_NS_Consumer *> > -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Iterator<TAO_NS_Peer *> > -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Iterator<TAO_NS_ProxySupplier *> > -#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Iterator<TAO_NS_Proxy *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier *>, ACE_SYNCH> +#pragma instantiate TAO_ESF_Copy_On_Write_Write_Guard<TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier *>, ACE_SYNCH> + +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ProxyConsumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxyConsumer *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Supplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Supplier *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ConsumerAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ConsumerAdmin *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_SupplierAdmin>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_SupplierAdmin *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_EventChannel>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_EventChannel *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Consumer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Consumer *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Peer>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Peer *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_ProxySupplier>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_ProxySupplier *> > +#pragma instantiate TAO_ESF_Copy_On_Write_Collection<TAO_ESF_Proxy_List<TAO_NS_Proxy>, ACE_Unbounded_Set_Ex_Iterator<TAO_NS_Proxy *> > #endif /*ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp index 244cd57d7f5..1a099203d85 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_Filter.cpp @@ -6,7 +6,7 @@ #include "ETCL_Filter.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_ETCL_Filter, "$id$") +ACE_RCSID(Notify, TAO_NS_ETCL_Filter, "$Id$") #include "ace/Auto_Ptr.h" #include "tao/debug.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp b/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp index 91f08daa78f..f9a2d90f924 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ETCL_FilterFactory.cpp @@ -6,7 +6,7 @@ #include "ETCL_FilterFactory.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_ETCL_FilterFactory, "$id$") +ACE_RCSID(Notify, TAO_NS_ETCL_FilterFactory, "$Id$") #include "ETCL_Filter.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp index dba27e9dffd..3a7c79863f2 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Event.cpp @@ -6,7 +6,7 @@ #include "Event.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Event, "$Id$") +ACE_RCSID(Notify, TAO_NS_Event, "$Id$") #include "tao/debug.h" #include "orbsvcs/CosNotificationC.h" @@ -15,14 +15,14 @@ TAO_NS_Event::TAO_NS_Event (void) :priority_ (CosNotification::Priority, CosNotification::DefaultPriority), timeout_ (CosNotification::Timeout) { - if (TAO_debug_level > 0) - ACE_DEBUG ((LM_DEBUG,"event:%x created\n", this )); + // if (TAO_debug_level > 0) + // ACE_DEBUG ((LM_DEBUG,"event:%x created\n", this )); } TAO_NS_Event::~TAO_NS_Event () { - if (TAO_debug_level > 1) - ACE_DEBUG ((LM_DEBUG,"event:%x destroyed\n", this )); + // if (TAO_debug_level > 1) + // ACE_DEBUG ((LM_DEBUG,"event:%x destroyed\n", this )); } void diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.h b/TAO/orbsvcs/orbsvcs/Notify/Event.h index bbe45c870e3..8df90f806d8 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Event.h @@ -20,6 +20,7 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/Copy_Disabled.h" +#include "ace/Refcounted_Auto_Ptr.h" #include "orbsvcs/Event_ForwarderS.h" #include "orbsvcs/CosNotifyFilterC.h" #include "orbsvcs/CosNotificationC.h" @@ -44,6 +45,9 @@ public: /// Destructor virtual ~TAO_NS_Event (); + /// Copy the event. + virtual TAO_NS_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const = 0; + /// Translate Any to Structured static void translate (const CORBA::Any& any, CosNotification::StructuredEvent& notification); @@ -54,32 +58,32 @@ public: virtual const TAO_NS_EventType& type (void) const = 0; /// Returns true if the filter matches. - virtual CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) = 0; + virtual CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const = 0; /// Convert to CosNotification::Structured type - virtual void convert (CosNotification::StructuredEvent& notification) = 0; + virtual void convert (CosNotification::StructuredEvent& notification) const = 0; /// Push event to consumer virtual void push (TAO_NS_Consumer* consumer ACE_ENV_ARG_DECL) const = 0; /// Push event to the Event_Forwarder interface - virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) = 0; + virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0; /// Push event to the Event_Forwarder interface - virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) = 0; + virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0; /// Push event to the Event_Forwarder interface - virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) = 0; + virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0; /// Push event to the Event_Forwarder interface - virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) = 0; + virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const = 0; ///= Accessors /// Priority - TAO_NS_Property_Short& priority (void); + const TAO_NS_Property_Short& priority (void) const; /// Timeout - TAO_NS_Property_Time& timeout (void); + const TAO_NS_Property_Time& timeout (void) const; protected: /// = QoS properties @@ -91,9 +95,45 @@ protected: TAO_NS_Property_Time timeout_; }; -template <class X, class ACE_LOCK> class ACE_Refcounted_Auto_Ptr; +typedef ACE_Refcounted_Auto_Ptr<const TAO_NS_Event, TAO_SYNCH_MUTEX> TAO_NS_Event_var_Base; + +/** + * @class TAO_NS_Event_var + * + * @brief A Non-Copy version of the ACE_Refcounted_Auto_Ptr that hides the constructors. + * + */ +class TAO_NS_Event_var : public TAO_NS_Event_var_Base +{ +public: + /// Default Constructor + TAO_NS_Event_var (void); + +protected: + /// Constructor + TAO_NS_Event_var (TAO_NS_Event* event); +}; + +/** + * @class TAO_NS_Event + * + * @brief A version of the ACE_Refcounted_Auto_Ptr that allows construction from a TAO_NS_Event + * + */ +class TAO_NS_Event_Copy_var : public TAO_NS_Event_var +{ +public: + /// Default Constructor + TAO_NS_Event_Copy_var (void); + + /// Constructor + TAO_NS_Event_Copy_var (TAO_NS_Event* event); +}; + +/*template <class X, class ACE_LOCK> class ACE_Refcounted_Auto_Ptr; template <class T> class ACE_Unbounded_Queue; -typedef ACE_Refcounted_Auto_Ptr<TAO_NS_Event, TAO_SYNCH_MUTEX> TAO_NS_Event_var; +typedef ACE_Refcounted_Auto_Ptr<const TAO_NS_Event, TAO_SYNCH_MUTEX> TAO_NS_Event_var;*/ + typedef ACE_Unbounded_Queue<TAO_NS_Event_var> TAO_NS_Event_Collection; #if defined (__ACE_INLINE__) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event.inl b/TAO/orbsvcs/orbsvcs/Notify/Event.inl index 019194c78aa..fa6f0bb9622 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Event.inl @@ -1,13 +1,41 @@ // $Id$ -ACE_INLINE TAO_NS_Property_Short& -TAO_NS_Event::priority (void) +ACE_INLINE const TAO_NS_Property_Short& +TAO_NS_Event::priority (void) const { return this->priority_; } -ACE_INLINE TAO_NS_Property_Time& -TAO_NS_Event::timeout (void) +ACE_INLINE const TAO_NS_Property_Time& +TAO_NS_Event::timeout (void) const { return this->timeout_; } + +/**********************************************************/ + +ACE_INLINE +TAO_NS_Event_var::TAO_NS_Event_var (void) + : TAO_NS_Event_var_Base () +{ +} + +ACE_INLINE +TAO_NS_Event_var::TAO_NS_Event_var (TAO_NS_Event* event) + : TAO_NS_Event_var_Base (event) +{ +} + +/**********************************************************/ + +ACE_INLINE +TAO_NS_Event_Copy_var::TAO_NS_Event_Copy_var (void) + : TAO_NS_Event_var () +{ +} + +ACE_INLINE +TAO_NS_Event_Copy_var::TAO_NS_Event_Copy_var (TAO_NS_Event* event) + : TAO_NS_Event_var (event) +{ +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp index 2ad47c95f8c..1036ca62a8c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannel.cpp @@ -17,7 +17,7 @@ #include "Find_Worker_T.h" #include "Seq_Worker_T.h" -ACE_RCSID(RT_Notify, TAO_NS_EventChannel, "$Id$") +ACE_RCSID(Notify, TAO_NS_EventChannel, "$Id$") typedef TAO_NS_Find_Worker_T<TAO_NS_ConsumerAdmin , CosNotifyChannelAdmin::ConsumerAdmin diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp index e5efebbd2ac..f00ff387b37 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/EventChannelFactory.cpp @@ -6,7 +6,7 @@ #include "EventChannelFactory.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_EventChannelFactory, "$Id$") +ACE_RCSID(Notify, TAO_NS_EventChannelFactory, "$Id$") #include "ace/Dynamic_Service.h" #include "Properties.h" @@ -43,9 +43,6 @@ TAO_NS_EventChannelFactory::destroy (ACE_ENV_SINGLE_ARG_DECL) if (this->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER) == 1) return; - this->ec_container_->shutdown (ACE_ENV_SINGLE_ARG_PARAMETER); - ACE_CHECK; - TAO_NS_Properties* properties = TAO_NS_PROPERTIES::instance(); delete this->ec_container_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventType.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventType.cpp index 9ac68b89aad..ffd461a55d8 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventType.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/EventType.cpp @@ -6,7 +6,7 @@ #include "EventType.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_EventType, "$Id$") +ACE_RCSID(Notify, TAO_NS_EventType, "$Id$") TAO_NS_EventType TAO_NS_EventType::special (void) diff --git a/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.cpp b/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.cpp index ccd6389e10c..ff3e5ec41eb 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/EventTypeSeq.cpp @@ -6,7 +6,7 @@ #include "EventTypeSeq.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_EventTypeSeq, "$Id$") +ACE_RCSID(Notify, TAO_NS_EventTypeSeq, "$Id$") TAO_NS_EventTypeSeq::TAO_NS_EventTypeSeq (void) { diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.cpp index b18ce49fd22..e64aa52d8c1 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Manager.cpp @@ -7,7 +7,7 @@ #include "Event_Manager.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Event_Manager, "$Id$") +ACE_RCSID(Notify, TAO_NS_Event_Manager, "$Id$") #include "ProxyConsumer.h" #include "ProxySupplier.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.cpp index 53573dafa90..20dc084707c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_Entry_T.cpp @@ -9,7 +9,7 @@ #include "Event_Map_Entry_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Event_Map_Entry_T, "$id$") +ACE_RCSID(Notify, TAO_NS_Event_Map_Entry_T, "$Id$") #include "orbsvcs/ESF/ESF_Proxy_Collection.h" #include "Properties.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.cpp index fc2ba2f0c71..381b5233bf7 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Event_Map_T.cpp @@ -13,7 +13,7 @@ #include "Event_Map_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Event_Map_T, "$Id$") +ACE_RCSID(Notify, TAO_NS_Event_Map_T, "$Id$") template <class PROXY, class ACE_LOCK> TAO_NS_Event_Map_T<PROXY, ACE_LOCK>::TAO_NS_Event_Map_T (void) diff --git a/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.cpp b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.cpp index bf3798f31ab..56aa4fd48e2 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.cpp @@ -1,9 +1,15 @@ /* -*- C++ -*- $Id$ */ + #include "FilterAdmin.h" -#include "ace/Refcounted_Auto_Ptr.h" + +#if ! defined (__ACE_INLINE__) +#include "FilterAdmin.inl" +#endif /* __ACE_INLINE__ */ ACE_RCSID(Notify, FilterAdmin, "$Id$") +#include "ace/Refcounted_Auto_Ptr.h" + // Implementation skeleton constructor TAO_NS_FilterAdmin::TAO_NS_FilterAdmin (void) { @@ -14,38 +20,6 @@ TAO_NS_FilterAdmin::~TAO_NS_FilterAdmin (void) { } -CORBA::Boolean -TAO_NS_FilterAdmin::match (const TAO_NS_Event_var &event ACE_ENV_ARG_DECL) - ACE_THROW_SPEC (( - CORBA::SystemException, - CosNotifyFilter::UnsupportedFilterableData - )) -{ - ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, - CORBA::INTERNAL ()); - ACE_CHECK_RETURN (0); - - // If no filter is active, match is successfull. - if (this->filter_list_.current_size () == 0) - return 1; - - // We want to return true if atleast one constraint matches. - FILTER_LIST::ITERATOR iter (this->filter_list_); - FILTER_LIST::ENTRY *entry; - CORBA::Boolean ret_val = 0; - - for (; iter.next (entry); iter.advance ()) - { - ret_val = event->do_match (entry->int_id_.in () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - if (ret_val == 1) - return 1; - } - - return 0; -} - CosNotifyFilter::FilterID TAO_NS_FilterAdmin::add_filter (CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)) diff --git a/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h index 89998714834..9c0c2a52d3f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h +++ b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.h @@ -4,9 +4,6 @@ * * $Id$ * - * - * - * * @author Pradeep Gore <pradeep@cs.wustl.edu> */ //============================================================================= @@ -46,6 +43,14 @@ class TAO_Notify_Export TAO_NS_FilterAdmin CosNotifyFilter::UnsupportedFilterableData )); + // = match operation on all the filters + /// See if any of the filters match. + CORBA::Boolean match (const TAO_NS_Event* event ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException, + CosNotifyFilter::UnsupportedFilterableData + )); + virtual CosNotifyFilter::FilterID add_filter (CosNotifyFilter::Filter_ptr new_filter ACE_ENV_ARG_DECL) ACE_THROW_SPEC ((CORBA::SystemException)); @@ -84,5 +89,9 @@ class TAO_Notify_Export TAO_NS_FilterAdmin TAO_NS_ID_Factory filter_ids_; }; +#if defined (__ACE_INLINE__) +#include "FilterAdmin.inl" +#endif /* __ACE_INLINE__ */ + #include "ace/post.h" #endif /* NOTIFY_FILTERADMIN_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.inl b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.inl new file mode 100644 index 00000000000..a8c46da4aa6 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/FilterAdmin.inl @@ -0,0 +1,33 @@ +//$Id$ + +ACE_INLINE CORBA::Boolean +TAO_NS_FilterAdmin::match (const TAO_NS_Event* event ACE_ENV_ARG_DECL) + ACE_THROW_SPEC (( + CORBA::SystemException, + CosNotifyFilter::UnsupportedFilterableData + )) +{ + ACE_GUARD_THROW_EX (TAO_SYNCH_MUTEX, ace_mon, this->lock_, + CORBA::INTERNAL ()); + ACE_CHECK_RETURN (0); + + // If no filter is active, match is successfull. + if (this->filter_list_.current_size () == 0) + return 1; + + // We want to return true if atleast one constraint matches. + FILTER_LIST::ITERATOR iter (this->filter_list_); + FILTER_LIST::ENTRY *entry; + CORBA::Boolean ret_val = 0; + + for (; iter.next (entry); iter.advance ()) + { + ret_val = event->do_match (entry->int_id_.in () ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + if (ret_val == 1) + return 1; + } + + return 0; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp index 1c560a73503..4e1e9b102b7 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Find_Worker_T.cpp @@ -9,7 +9,7 @@ #include "Find_Worker_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Find_Worker_T, "$id$") +ACE_RCSID(Notify, TAO_NS_Find_Worker_T, "$Id$") template<class TYPE, class INTERFACE, class INTERFACE_PTR, class EXCEPTION> TAO_NS_Find_Worker_T<TYPE,INTERFACE,INTERFACE_PTR,EXCEPTION>::TAO_NS_Find_Worker_T (void) diff --git a/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.cpp index 466a2ea8fb4..42eb0bac2a8 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ID_Factory.cpp @@ -6,7 +6,7 @@ #include "ID_Factory.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_ID_Factory, "$Id$") +ACE_RCSID(Notify, TAO_NS_ID_Factory, "$Id$") TAO_NS_ID_Factory::TAO_NS_ID_Factory (void) { diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.cpp index 345c9da754e..5744f534186 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.cpp @@ -6,65 +6,4 @@ #include "Method_Request.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Method_Request, "$Id$") - -TAO_NS_Method_Request_Event::TAO_NS_Method_Request_Event (const TAO_NS_Event_var& event) - :event_ (event) -{ - // Set the parameters that affect queuing in the message queue. - // The ACE_Message_Block priorities go from 0 (lowest) to ULONG_MAX - // (highest), while the Notification Events go from -32767 (lowest, - // even though CORBA::Short goes to -32768) to 32767 (highest). - - // Convert to CORBA::Long to preserve the sign. Conversion to - // unsigned long will happen automatically and we do not have to worry - // about losing the number in the addition since priority () returns a - // CORBA::Short. - this->msg_priority ((CORBA::Long)this->event_->priority ().value () + - PRIORITY_BASE); - - // The deadline time for the message block is absolute, while the - // timeout for the event is relative to the time it was received. - // So, we do a little conversion and set it on the message block (us) - - TAO_NS_Property_Time& timeout = this->event_->timeout (); - - if (timeout.is_valid () && timeout != 0) - { - // I am multiplying timeout () by 1 because it returns a - // CORBA::ULongLong, which on some platforms doesn't automatically - // convert to the long that the ACE_Time_Value expects. The / - // operator returns a 32-bit integer. - ACE_Time_Value current = ACE_OS::gettimeofday () + -# if defined (ACE_CONFIG_WIN32_H) - ACE_Time_Value ( - ACE_static_cast (long, - timeout.value ())); -# else - ACE_Time_Value (timeout.value () / 1); -# endif /* ACE_CONFIG_WIN32_H */ - this->msg_deadline_time (current); - } -} - -TAO_NS_Method_Request_Event::~TAO_NS_Method_Request_Event () -{ -} - -int -TAO_NS_Method_Request_Event::execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) -{ - return -1; -} - -TAO_NS_Method_Request* -TAO_NS_Method_Request_Event::copy (void) -{ - return new TAO_NS_Method_Request_Event (this->event_); -} - -const TAO_NS_Event_var& -TAO_NS_Method_Request_Event::event (void) -{ - return this->event_; -} +ACE_RCSID(Notify, TAO_NS_Method_Request, "$Id$") diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.h index 4124b82b21e..3f1f404e823 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.h @@ -23,55 +23,43 @@ #include "ace/Refcounted_Auto_Ptr.h" #include "Event.h" +class TAO_NS_Method_Request; + /** - * @class TAO_NS_Method_Request + * @class TAO_NS_Method_Request_No_Copy * - * @brief Interface for NS method Requests + * @brief Base class for Method Requests that do not copy the event. * */ -class TAO_Notify_Export TAO_NS_Method_Request : public ACE_Message_Block +class TAO_Notify_Export TAO_NS_Method_Request_No_Copy { public: - enum {PRIORITY_BASE = 32768}; - /// Execute the Request virtual int execute (ACE_ENV_SINGLE_ARG_DECL) = 0; /// Create a copy of this object. - virtual TAO_NS_Method_Request* copy (void) = 0; + virtual TAO_NS_Method_Request* copy (ACE_ENV_SINGLE_ARG_DECL) = 0; }; /***********************************************************************/ /** - * @class TAO_NS_Method_Request_Event + * @class TAO_NS_Method_Request * - * @brief Base class for NS method Requests on Events. + * @brief Interface for NS method Requests * */ -class TAO_Notify_Export TAO_NS_Method_Request_Event : public TAO_NS_Method_Request +class TAO_Notify_Export TAO_NS_Method_Request : public ACE_Message_Block { public: - /// Constuctor - TAO_NS_Method_Request_Event (const TAO_NS_Event_var& event); + enum {PRIORITY_BASE = 32768}; - /// Destructor - virtual ~TAO_NS_Method_Request_Event (); + void init (const TAO_NS_Event_var& event); /// Execute the Request - virtual int execute (ACE_ENV_SINGLE_ARG_DECL); - - /// Create a copy of this object. - virtual TAO_NS_Method_Request* copy (void); - - /// Obtain the event. - const TAO_NS_Event_var& event (void); - -protected: - const TAO_NS_Event_var event_; + virtual int execute (ACE_ENV_SINGLE_ARG_DECL) = 0; }; - #if defined (__ACE_INLINE__) #include "Method_Request.inl" #endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.inl index cfa1da318d3..e015902690b 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request.inl @@ -1 +1,40 @@ // $Id$ + +ACE_INLINE void +TAO_NS_Method_Request::init (const TAO_NS_Event_var& event) +{ + // Set the parameters that affect queuing in the message queue. + // The ACE_Message_Block priorities go from 0 (lowest) to ULONG_MAX + // (highest), while the Notification Events go from -32767 (lowest, + // even though CORBA::Short goes to -32768) to 32767 (highest). + + // Convert to CORBA::Long to preserve the sign. Conversion to + // unsigned long will happen automatically and we do not have to worry + // about losing the number in the addition since priority () returns a + // CORBA::Short. + this->msg_priority ((CORBA::Long)event->priority ().value () + + PRIORITY_BASE); + + // The deadline time for the message block is absolute, while the + // timeout for the event is relative to the time it was received. + // So, we do a little conversion and set it on the message block (us) + + const TAO_NS_Property_Time& timeout = event->timeout (); + + if (timeout.is_valid () && timeout != 0) + { + // I am multiplying timeout () by 1 because it returns a + // CORBA::ULongLong, which on some platforms doesn't automatically + // convert to the long that the ACE_Time_Value expects. The / + // operator returns a 32-bit integer. + ACE_Time_Value current = ACE_OS::gettimeofday () + +# if defined (ACE_CONFIG_WIN32_H) + ACE_Time_Value ( + ACE_static_cast (long, + timeout.value ())); +# else + ACE_Time_Value (timeout.value () / 1); +# endif /* ACE_CONFIG_WIN32_H */ + this->msg_deadline_time (current); + } +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp index caa1d7de399..9f7502f78ea 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.cpp @@ -6,7 +6,7 @@ #include "Method_Request_Dispatch.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Method_Request_Dispatch, "$Id$") +ACE_RCSID(Notify, TAO_NS_Method_Request_Dispatch, "$Id$") #include "tao/debug.h" #include "ProxySupplier.h" @@ -14,58 +14,81 @@ ACE_RCSID(RT_Notify, TAO_NS_Method_Request_Dispatch, "$Id$") #include "Admin.h" #include "ConsumerAdmin.h" -TAO_NS_Method_Request_Dispatch::TAO_NS_Method_Request_Dispatch (const TAO_NS_Event_var& event, TAO_NS_ProxySupplier* proxy_supplier) - : TAO_NS_Method_Request_Event (event), proxy_supplier_ (proxy_supplier), refcountable_guard_ (*proxy_supplier) +TAO_NS_Method_Request_Dispatch::TAO_NS_Method_Request_Dispatch (const TAO_NS_Event_var& event, TAO_NS_ProxySupplier* proxy_supplier, CORBA::Boolean filtering) + : TAO_NS_Method_Request_Dispatch_Base (event, proxy_supplier, filtering) { + this->init (event); } TAO_NS_Method_Request_Dispatch::~TAO_NS_Method_Request_Dispatch () { } +int +TAO_NS_Method_Request_Dispatch::execute (ACE_ENV_SINGLE_ARG_DECL) +{ + return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +/*********************************************************************************************************/ + +TAO_NS_Method_Request_Dispatch_No_Copy::TAO_NS_Method_Request_Dispatch_No_Copy (const TAO_NS_Event* event, TAO_NS_ProxySupplier* proxy_supplier, CORBA::Boolean filtering) + : TAO_NS_Method_Request_Dispatch_No_Copy_Base (event, proxy_supplier, filtering) +{ +} + +TAO_NS_Method_Request_Dispatch_No_Copy:: ~TAO_NS_Method_Request_Dispatch_No_Copy () +{ +} + +int +TAO_NS_Method_Request_Dispatch_No_Copy::execute (ACE_ENV_SINGLE_ARG_DECL) +{ + return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + TAO_NS_Method_Request* -TAO_NS_Method_Request_Dispatch::copy (void) +TAO_NS_Method_Request_Dispatch_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) +{ + TAO_NS_Method_Request* request; + + TAO_NS_Event* event_copy = this->event_->copy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + TAO_NS_Event_Copy_var event_var (event_copy); + + ACE_NEW_THROW_EX (request, + TAO_NS_Method_Request_Dispatch (event_var, this->proxy_supplier_, this->filtering_), + CORBA::INTERNAL ()); + + return request; +} + +/*********************************************************************************************************/ + +TAO_NS_Method_Request_Dispatch_No_Copy_Ex::TAO_NS_Method_Request_Dispatch_No_Copy_Ex (const TAO_NS_Event_var& event, TAO_NS_ProxySupplier* proxy_supplier, CORBA::Boolean filtering) + : TAO_NS_Method_Request_Dispatch_No_Copy_Ex_Base (event, proxy_supplier, filtering) +{ +} + +TAO_NS_Method_Request_Dispatch_No_Copy_Ex:: ~TAO_NS_Method_Request_Dispatch_No_Copy_Ex () { - /// @@use factory - return new TAO_NS_Method_Request_Dispatch (this->event_, this->proxy_supplier_); } int -TAO_NS_Method_Request_Dispatch::execute (ACE_ENV_SINGLE_ARG_DECL) +TAO_NS_Method_Request_Dispatch_No_Copy_Ex::execute (ACE_ENV_SINGLE_ARG_DECL) +{ + return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +TAO_NS_Method_Request* +TAO_NS_Method_Request_Dispatch_No_Copy_Ex::copy (ACE_ENV_SINGLE_ARG_DECL) { - if (this->proxy_supplier_->has_shutdown ()) - return 0; // If we were shutdown while waiting in the queue, return with no action. - - TAO_NS_Admin* parent = this->proxy_supplier_->consumer_admin (); - - CORBA::Boolean val = this->proxy_supplier_->check_filters (this->event_, - parent->filter_admin (), - parent->filter_operator () - ACE_ENV_ARG_PARAMETER); - - if (TAO_debug_level > 1) - ACE_DEBUG ((LM_DEBUG, "Proxysupplier %x filter eval result = %d",this->proxy_supplier_ , val)); - - // Filter failed - do nothing. - if (val == 0) - return 0; - - ACE_TRY - { - TAO_NS_Consumer* consumer = this->proxy_supplier_->consumer (); - - if (consumer != 0) - { - consumer->push (this->event_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHANY - { - if (TAO_debug_level > 0) - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_NS_Method_Request_Dispatch::: error sending event. \n "); - } - ACE_ENDTRY; - - return 0; + TAO_NS_Method_Request* request; + + ACE_NEW_THROW_EX (request, + TAO_NS_Method_Request_Dispatch (this->event_, this->proxy_supplier_, this->filtering_), + CORBA::INTERNAL ()); + + return request; } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h index 862608c46a3..3b484b4c891 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch.h @@ -21,8 +21,8 @@ #include "Method_Request.h" #include "Refcountable.h" - -class TAO_NS_ProxySupplier; +#include "Method_Request_Dispatch_T.h" +#include "ProxySupplier.h" /** * @class TAO_NS_Method_Request_Dispatch @@ -30,27 +30,86 @@ class TAO_NS_ProxySupplier; * @brief Dispatchs an event to a proxy supplier. * */ -class TAO_Notify_Export TAO_NS_Method_Request_Dispatch : public TAO_NS_Method_Request_Event + +typedef TAO_NS_Method_Request_Dispatch_T<const TAO_NS_Event_var + , TAO_NS_ProxySupplier_Guard + , const TAO_NS_Event_var& + , TAO_NS_ProxySupplier*> TAO_NS_Method_Request_Dispatch_Base; + +class TAO_Notify_Export TAO_NS_Method_Request_Dispatch : public TAO_NS_Method_Request_Dispatch_Base + , public TAO_NS_Method_Request { public: /// Constuctor - TAO_NS_Method_Request_Dispatch (const TAO_NS_Event_var& event, TAO_NS_ProxySupplier* proxy_supplier); + TAO_NS_Method_Request_Dispatch (const TAO_NS_Event_var& event, TAO_NS_ProxySupplier* proxy_supplier, CORBA::Boolean filtering); /// Destructor ~TAO_NS_Method_Request_Dispatch (); - /// Create a copy of this object. - TAO_NS_Method_Request* copy (void); + /// Execute the Request + virtual int execute (ACE_ENV_SINGLE_ARG_DECL); +}; + +/*******************************************************************************************************/ + +/** + * @class TAO_NS_Method_Request_Dispatch_No_Copy + * + * @brief Dispatchs an event to a proxy supplier. + * + */ + +typedef TAO_NS_Method_Request_Dispatch_T<const TAO_NS_Event* + , TAO_NS_ProxySupplier* + , const TAO_NS_Event* + , TAO_NS_ProxySupplier*> TAO_NS_Method_Request_Dispatch_No_Copy_Base; + +class TAO_Notify_Export TAO_NS_Method_Request_Dispatch_No_Copy : public TAO_NS_Method_Request_Dispatch_No_Copy_Base + , public TAO_NS_Method_Request_No_Copy +{ +public: + /// Constuctor + TAO_NS_Method_Request_Dispatch_No_Copy (const TAO_NS_Event* event, TAO_NS_ProxySupplier* proxy_supplier, CORBA::Boolean filtering); + + /// Destructor + ~TAO_NS_Method_Request_Dispatch_No_Copy (); /// Execute the Request virtual int execute (ACE_ENV_SINGLE_ARG_DECL); -private: - /// Proxy Supplier that we use. - TAO_NS_ProxySupplier* proxy_supplier_; + /// Create a copy of this object. + virtual TAO_NS_Method_Request* copy (ACE_ENV_SINGLE_ARG_DECL); +}; + +/*******************************************************************************************************/ + +/** + * @class TAO_NS_Method_Request_Dispatch_No_Copy_Ex + * + * @brief Dispatchs an event to a proxy supplier. + * + */ + +typedef TAO_NS_Method_Request_Dispatch_T<const TAO_NS_Event_var& + , TAO_NS_ProxySupplier* + , const TAO_NS_Event_var& + , TAO_NS_ProxySupplier*> TAO_NS_Method_Request_Dispatch_No_Copy_Ex_Base; - /// Guard to automatically inc/decr ref count on the proxy. - TAO_NS_Refcountable_Guard refcountable_guard_; +class TAO_Notify_Export TAO_NS_Method_Request_Dispatch_No_Copy_Ex : public TAO_NS_Method_Request_Dispatch_No_Copy_Ex_Base + , public TAO_NS_Method_Request_No_Copy +{ +public: + /// Constuctor + TAO_NS_Method_Request_Dispatch_No_Copy_Ex (const TAO_NS_Event_var& event, TAO_NS_ProxySupplier* proxy_supplier, CORBA::Boolean filtering); + + /// Destructor + ~TAO_NS_Method_Request_Dispatch_No_Copy_Ex (); + + /// Execute the Request + virtual int execute (ACE_ENV_SINGLE_ARG_DECL); + + /// Create a copy of this object. + virtual TAO_NS_Method_Request* copy (ACE_ENV_SINGLE_ARG_DECL); }; #if defined (__ACE_INLINE__) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.cpp deleted file mode 100644 index 83626a87a1c..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// $Id$ - -#include "Method_Request_Dispatch_No_Filtering.h" - -#if ! defined (__ACE_INLINE__) -#include "Method_Request_Dispatch_No_Filtering.inl" -#endif /* __ACE_INLINE__ */ - -ACE_RCSID(RT_Notify, TAO_NS_Method_Request_Dispatch_No_Filtering, "$Id$") - -#include "tao/debug.h" -#include "ProxySupplier.h" -#include "Consumer.h" - -TAO_NS_Method_Request_Dispatch_No_Filtering::TAO_NS_Method_Request_Dispatch_No_Filtering (const TAO_NS_Event_var& event, TAO_NS_ProxySupplier* proxy_supplier) - : TAO_NS_Method_Request_Event (event), proxy_supplier_ (proxy_supplier), refcountable_guard_ (*proxy_supplier) -{ -} - -TAO_NS_Method_Request_Dispatch_No_Filtering::~TAO_NS_Method_Request_Dispatch_No_Filtering () -{ -} - -TAO_NS_Method_Request* -TAO_NS_Method_Request_Dispatch_No_Filtering::copy (void) -{ - /// @@use factory - return new TAO_NS_Method_Request_Dispatch_No_Filtering (this->event_, this->proxy_supplier_); -} - -int -TAO_NS_Method_Request_Dispatch_No_Filtering::execute (ACE_ENV_SINGLE_ARG_DECL) -{ - if (this->proxy_supplier_->has_shutdown ()) - return 0; // If we were shutdown while waiting in the queue, return with no action. - - ACE_TRY - { - this->proxy_supplier_->consumer ()->push (this->event_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - ACE_CATCH (CORBA::UserException, ue) - { - ACE_PRINT_EXCEPTION (ue, - "TAO_NS_Method_Request_Dispatch_No_Filtering::: error sending event. "); - //ACE_RE_THROW; - } - ACE_CATCH (CORBA::SystemException, se) - { - ACE_PRINT_EXCEPTION (se, - "TAO_NS_Method_Request_Dispatch_No_Filtering::: error sending event. "); - //ACE_RE_THROW; - } - ACE_ENDTRY; - - return 0; -} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.h deleted file mode 100644 index 153caadc5d5..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- C++ -*- */ -/** - * @file Method_Request_Dispatch_No_Filtering.h - * - * $Id$ - * - * @author Pradeep Gore <pradeep@oomworks.com> - * - * - */ - -#ifndef TAO_NS_DISPATCH_METHOD_REQUEST_NO_FILTERING_H -#define TAO_NS_DISPATCH_METHOD_REQUEST_NO_FILTERING_H -#include "ace/pre.h" - -#include "notify_export.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "Method_Request.h" -#include "Refcountable.h" - -class TAO_NS_ProxySupplier; - -/** - * @class TAO_NS_Method_Request_Dispatch_No_Filtering - * - * @brief Dispatchs an event to a proxy supplier but does NOT perform filtering. - * - */ -class TAO_Notify_Export TAO_NS_Method_Request_Dispatch_No_Filtering : public TAO_NS_Method_Request_Event -{ -public: - /// Constuctor - TAO_NS_Method_Request_Dispatch_No_Filtering (const TAO_NS_Event_var& event, TAO_NS_ProxySupplier* proxy_supplier); - - /// Destructor - ~TAO_NS_Method_Request_Dispatch_No_Filtering (); - - /// Create a copy of this object. - TAO_NS_Method_Request* copy (void); - - /// Execute the Request - virtual int execute (ACE_ENV_SINGLE_ARG_DECL); - -private: - /// Proxy Supplier that we use. - TAO_NS_ProxySupplier* proxy_supplier_; - - /// Guard to automatically inc/decr ref count on the proxy. - TAO_NS_Refcountable_Guard refcountable_guard_; -}; - -#if defined (__ACE_INLINE__) -#include "Method_Request_Dispatch_No_Filtering.inl" -#endif /* __ACE_INLINE__ */ - -#include "ace/post.h" -#endif /* TAO_NS_DISPATCH_METHOD_REQUEST_NO_FILTERING_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.inl deleted file mode 100644 index cfa1da318d3..00000000000 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_No_Filtering.inl +++ /dev/null @@ -1 +0,0 @@ -// $Id$ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp new file mode 100644 index 00000000000..07a8a2b78d4 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.cpp @@ -0,0 +1,24 @@ +// $Id$ +#ifndef TAO_NS_Method_Request_Dispatch_T_CPP +#define TAO_NS_Method_Request_Dispatch_T_CPP + +#include "Method_Request_Dispatch_T.h" + +#if ! defined (__ACE_INLINE__) +#include "Method_Request_Dispatch_T.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(Notify, TAO_NS_Method_Request_Dispatch_T, "$id$") + +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> +TAO_NS_Method_Request_Dispatch_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::TAO_NS_Method_Request_Dispatch_T (EVENT_PARAM event, PROXY_PARAM proxy_supplier, CORBA::Boolean filtering) + :event_ (event), proxy_supplier_ (proxy_supplier), filtering_ (filtering) +{ +} + +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> +TAO_NS_Method_Request_Dispatch_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::~TAO_NS_Method_Request_Dispatch_T () +{ +} + +#endif /* TAO_NS_Method_Request_Dispatch_T_CPP */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h new file mode 100644 index 00000000000..d7166fadf58 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.h @@ -0,0 +1,67 @@ +/* -*- C++ -*- */ +/** + * @file Method_Request_Dispatch_T.h + * + * $Id$ + * + * @author Pradeep Gore <pradeep@oomworks.com> + * + * + */ + +#ifndef TAO_NS_METHOD_REQUEST_DISPATCH_T_H +#define TAO_NS_METHOD_REQUEST_DISPATCH_T_H +#include "ace/pre.h" + +#include "notify_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/corba.h" + +/** + * @class TAO_NS_Method_Request_Dispatch_T + * + * @brief + * + */ +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> +class TAO_Notify_Export TAO_NS_Method_Request_Dispatch_T +{ +public: + /// Constuctor + TAO_NS_Method_Request_Dispatch_T (EVENT_PARAM event, PROXY_PARAM proxy, CORBA::Boolean filtering); + + /// Destructor + ~TAO_NS_Method_Request_Dispatch_T (); + + /// Execute the dispatch operation. + int execute_i (ACE_ENV_SINGLE_ARG_DECL); + +protected: + /// The Event + EVENT event_; + + /// The Proxy + PROXY proxy_supplier_; + + /// Flag is true if we want to do fintering else false. + CORBA::Boolean filtering_; +}; + +#if defined (__ACE_INLINE__) +#include "Method_Request_Dispatch_T.inl" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Method_Request_Dispatch_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Method_Request_Dispatch_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include "ace/post.h" +#endif /* TAO_NS_METHOD_REQUEST_DISPATCH_T_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl new file mode 100644 index 00000000000..d1e6b8fb512 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Dispatch_T.inl @@ -0,0 +1,45 @@ +// $Id$ + + +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> ACE_INLINE int +TAO_NS_Method_Request_Dispatch_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::execute_i (ACE_ENV_SINGLE_ARG_DECL) +{ + if (this->proxy_supplier_->has_shutdown ()) + return 0; // If we were shutdown while waiting in the queue, return with no action. + + if (this->filtering_ == 1) + { + TAO_NS_Admin* parent = this->proxy_supplier_->consumer_admin (); + + CORBA::Boolean val = this->proxy_supplier_->check_filters (this->event_, + parent->filter_admin (), + parent->filter_operator () + ACE_ENV_ARG_PARAMETER); + + if (TAO_debug_level > 1) + ACE_DEBUG ((LM_DEBUG, "Proxysupplier %x filter eval result = %d",this->proxy_supplier_ , val)); + + // Filter failed - do nothing. + if (val == 0) + return 0; + } + + ACE_TRY + { + TAO_NS_Consumer* consumer = this->proxy_supplier_->consumer (); + + if (consumer != 0) + { + consumer->push (this->event_ ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + } + ACE_CATCHANY + { + if (TAO_debug_level > 0) + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_NS_Method_Request_Dispatch::: error sending event. \n "); + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.cpp new file mode 100644 index 00000000000..37445904795 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.cpp @@ -0,0 +1,30 @@ +// $Id$ + +#include "Method_Request_Event.h" + +#if ! defined (__ACE_INLINE__) +#include "Method_Request_Event.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(Notify, TAO_NS_Method_Request_Event, "$id$") + +TAO_NS_Method_Request_Event::TAO_NS_Method_Request_Event (const TAO_NS_Event_var& event) + :event_ (event) +{ + this->init (event); +} + +TAO_NS_Method_Request_Event::~TAO_NS_Method_Request_Event () +{ +} +int +TAO_NS_Method_Request_Event::execute (ACE_ENV_SINGLE_ARG_DECL_NOT_USED) +{ + return -1; +} + +const TAO_NS_Event_var& +TAO_NS_Method_Request_Event::event (void) +{ + return this->event_; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.h new file mode 100644 index 00000000000..7ed65552474 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.h @@ -0,0 +1,55 @@ +/* -*- C++ -*- */ +/** + * @file Method_Request_Event.h + * + * $Id$ + * + * @author Pradeep Gore <pradeep@oomworks.com> + * + * + */ + +#ifndef TAO_NS_METHOD_REQUEST_EVENT_H +#define TAO_NS_METHOD_REQUEST_EVENT_H +#include "ace/pre.h" + +#include "notify_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "Method_Request.h" + +/** + * @class TAO_NS_Method_Request_Event + * + * @brief A method request for storing events. + * + */ +class TAO_Notify_Export TAO_NS_Method_Request_Event : public TAO_NS_Method_Request +{ +public: + /// Constuctor + TAO_NS_Method_Request_Event (const TAO_NS_Event_var& event); + + /// Destructor + virtual ~TAO_NS_Method_Request_Event (); + + /// Execute the Request + virtual int execute (ACE_ENV_SINGLE_ARG_DECL); + + /// Obtain the event. + const TAO_NS_Event_var& event (void); + +protected: + /// The event. + const TAO_NS_Event_var event_; +}; + +#if defined (__ACE_INLINE__) +#include "Method_Request_Event.inl" +#endif /* __ACE_INLINE__ */ + +#include "ace/post.h" +#endif /* TAO_NS_METHOD_REQUEST_EVENT_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.inl new file mode 100644 index 00000000000..594304747ec --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Event.inl @@ -0,0 +1,3 @@ +// $Id$ + +#include "Method_Request_Event.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp index 5dc8208a752..618adc93eb4 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.cpp @@ -6,7 +6,7 @@ #include "Method_Request_Lookup.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Method_Request_Lookup, "$Id$") +ACE_RCSID(Notify, TAO_NS_Method_Request_Lookup, "$Id$") #include "tao/debug.h" #include "Consumer_Map.h" @@ -16,69 +16,52 @@ ACE_RCSID(RT_Notify, TAO_NS_Method_Request_Lookup, "$Id$") #include "Admin.h" #include "SupplierAdmin.h" -TAO_NS_Method_Request_Lookup::TAO_NS_Method_Request_Lookup (const TAO_NS_Event_var& event, TAO_NS_ProxyConsumer* proxy_consumer, TAO_NS_Consumer_Map* map) - : TAO_NS_Method_Request_Event (event), proxy_consumer_ (proxy_consumer), map_ (map), - refcountable_guard_ (*proxy_consumer) +TAO_NS_Method_Request_Lookup::TAO_NS_Method_Request_Lookup (const TAO_NS_Event_var& event, TAO_NS_ProxyConsumer* proxy_consumer) + : TAO_NS_Method_Request_Lookup_Base (event, proxy_consumer) { + this->init (event); } TAO_NS_Method_Request_Lookup::~TAO_NS_Method_Request_Lookup () { } -TAO_NS_Method_Request* -TAO_NS_Method_Request_Lookup::copy (void) -{ - /// @@use factory - return new TAO_NS_Method_Request_Lookup (this->event_, this->proxy_consumer_, this->map_); -} - int TAO_NS_Method_Request_Lookup::execute (ACE_ENV_SINGLE_ARG_DECL) { - if (this->proxy_consumer_->has_shutdown ()) - return 0; // If we were shutdown while waiting in the queue, return with no action. - - TAO_NS_Admin* parent = this->proxy_consumer_->supplier_admin (); - - CORBA::Boolean val = this->proxy_consumer_->check_filters (this->event_, - parent->filter_admin (), - parent->filter_operator () - ACE_ENV_ARG_PARAMETER); - - if (TAO_debug_level > 1) - ACE_DEBUG ((LM_DEBUG, "Proxyconsumer %x filter eval result = %d",this->proxy_consumer_ , val)); - - // Filter failed - do nothing. - if (val == 0) - return 0; + return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} - TAO_NS_Consumer_Map::ENTRY* entry = map_->find (this->event_->type () ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); +/******************************************************************************************************/ - TAO_NS_ProxySupplier_Collection* consumers = 0; +TAO_NS_Method_Request_Lookup_No_Copy::TAO_NS_Method_Request_Lookup_No_Copy (const TAO_NS_Event* event, TAO_NS_ProxyConsumer* proxy_consumer) + : TAO_NS_Method_Request_Lookup_No_Copy_Base (event, proxy_consumer) +{ +} - if (entry != 0) - { - consumers = entry->collection (); +TAO_NS_Method_Request_Lookup_No_Copy::~TAO_NS_Method_Request_Lookup_No_Copy () +{ +} - if (consumers != 0) - consumers->for_each (this ACE_ENV_ARG_PARAMETER); +int +TAO_NS_Method_Request_Lookup_No_Copy::execute (ACE_ENV_SINGLE_ARG_DECL) +{ + return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} - this->map_->release (entry); - } +TAO_NS_Method_Request* +TAO_NS_Method_Request_Lookup_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) +{ + TAO_NS_Method_Request* request; - // Get the default consumers - consumers = map_->broadcast_collection (); + TAO_NS_Event* event_copy = this->event_->copy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; - if (consumers != 0) - consumers->for_each (this ACE_ENV_ARG_PARAMETER); + TAO_NS_Event_Copy_var event_var (event_copy); - return 0; -} + ACE_NEW_THROW_EX (request, + TAO_NS_Method_Request_Lookup (event_var, this->proxy_consumer_), + CORBA::INTERNAL ()); -void -TAO_NS_Method_Request_Lookup::work (TAO_NS_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL_NOT_USED) -{ - proxy_supplier->push (this->event_); + return request; } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h index 4de8749c7e9..8aa5af10287 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup.h @@ -21,44 +21,65 @@ #include "orbsvcs/ESF/ESF_Worker.h" #include "Method_Request.h" -#include "ProxySupplier.h" +#include "ProxyConsumer.h" #include "Consumer_Map.h" +#include "Method_Request_Lookup_T.h" class TAO_NS_ProxyConsumer; +typedef TAO_NS_Method_Request_Lookup_T<const TAO_NS_Event_var + , TAO_NS_ProxyConsumer_Guard + , const TAO_NS_Event_var& + , TAO_NS_ProxyConsumer*> TAO_NS_Method_Request_Lookup_Base; + /** * @class TAO_NS_Method_Request_Lookup * * @brief Lookup command object looks up the event type of the given event in the consumer map and send the event to each proxysupplier. * */ -class TAO_Notify_Export TAO_NS_Method_Request_Lookup : public TAO_NS_Method_Request_Event, public TAO_ESF_Worker<TAO_NS_ProxySupplier> +class TAO_Notify_Export TAO_NS_Method_Request_Lookup : public TAO_NS_Method_Request_Lookup_Base + , public TAO_NS_Method_Request { public: /// Constuctor - TAO_NS_Method_Request_Lookup (const TAO_NS_Event_var& event, TAO_NS_ProxyConsumer* proxy_consumer, TAO_NS_Consumer_Map* map); + TAO_NS_Method_Request_Lookup (const TAO_NS_Event_var& event, TAO_NS_ProxyConsumer* proxy_consumer); /// Destructor ~TAO_NS_Method_Request_Lookup (); - /// Create a copy of this object. - TAO_NS_Method_Request* copy (void); - /// Execute the Request virtual int execute (ACE_ENV_SINGLE_ARG_DECL); +}; + +/*****************************************************************************************************************************/ - ///= TAO_ESF_Worker method - void work (TAO_NS_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL); +typedef TAO_NS_Method_Request_Lookup_T<const TAO_NS_Event* + , TAO_NS_ProxyConsumer* + , const TAO_NS_Event* + , TAO_NS_ProxyConsumer*> TAO_NS_Method_Request_Lookup_No_Copy_Base; + +/** + * @class TAO_NS_Method_Request_Lookup_No_Copy + * + * @brief Lookup command object looks up the event type of the given event in the consumer map and send the event to each proxysupplier. + * + */ +class TAO_Notify_Export TAO_NS_Method_Request_Lookup_No_Copy : public TAO_NS_Method_Request_Lookup_No_Copy_Base + , public TAO_NS_Method_Request_No_Copy +{ +public: + /// Constuctor + TAO_NS_Method_Request_Lookup_No_Copy (const TAO_NS_Event* event, TAO_NS_ProxyConsumer* proxy_consumer); -private: - /// ProxyConsumer supplying event. - TAO_NS_ProxyConsumer* proxy_consumer_; + /// Destructor + ~TAO_NS_Method_Request_Lookup_No_Copy (); - /// The map of subscriptions. - TAO_NS_Consumer_Map* map_; + /// Execute the Request + virtual int execute (ACE_ENV_SINGLE_ARG_DECL); - /// Guard to automatically inc/decr ref count on the proxy. - TAO_NS_Refcountable_Guard refcountable_guard_; + /// Create a copy of this object. + virtual TAO_NS_Method_Request* copy (ACE_ENV_SINGLE_ARG_DECL); }; #if defined (__ACE_INLINE__) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp new file mode 100644 index 00000000000..bf9f1220aa9 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.cpp @@ -0,0 +1,31 @@ +// $Id$ +#ifndef TAO_NS_Method_Request_Lookup_T_CPP +#define TAO_NS_Method_Request_Lookup_T_CPP + +#include "Method_Request_Lookup_T.h" + +#if ! defined (__ACE_INLINE__) +#include "Method_Request_Lookup_T.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(Notify, TAO_NS_Method_Request_Lookup_T, "$id$") + +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> +TAO_NS_Method_Request_Lookup_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::TAO_NS_Method_Request_Lookup_T (EVENT_PARAM event, PROXY_PARAM proxy_consumer) + :event_ (event), proxy_consumer_ (proxy_consumer) +{ +} + +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> +TAO_NS_Method_Request_Lookup_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::~TAO_NS_Method_Request_Lookup_T () +{ +} + + +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> void +TAO_NS_Method_Request_Lookup_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::work (TAO_NS_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL) +{ + proxy_supplier->push (this->event_ ACE_ENV_ARG_PARAMETER); +} + +#endif /* TAO_NS_Method_Request_Lookup_T_CPP */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h new file mode 100644 index 00000000000..a713392a392 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.h @@ -0,0 +1,68 @@ +/* -*- C++ -*- */ +/** + * @file Method_Request_Lookup_T.h + * + * $Id$ + * + * @author Pradeep Gore <pradeep@oomworks.com> + * + * + */ + +#ifndef TAO_NS_METHOD_REQUEST_LOOKUP_T_H +#define TAO_NS_METHOD_REQUEST_LOOKUP_T_H +#include "ace/pre.h" + +#include "notify_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "orbsvcs/ESF/ESF_Worker.h" +#include "ProxySupplier.h" + +/** + * @class TAO_NS_Method_Request_Lookup_T + * + * @brief + * + */ +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> +class TAO_Notify_Export TAO_NS_Method_Request_Lookup_T : public TAO_ESF_Worker<TAO_NS_ProxySupplier> +{ +public: + /// Constuctor + TAO_NS_Method_Request_Lookup_T (EVENT_PARAM event, PROXY_PARAM proxy); + + /// Destructor + ~TAO_NS_Method_Request_Lookup_T (); + + /// Execute the dispatch operation. + int execute_i (ACE_ENV_SINGLE_ARG_DECL); + +protected: + ///= TAO_ESF_Worker method + virtual void work (TAO_NS_ProxySupplier* proxy_supplier ACE_ENV_ARG_DECL); + + /// The Event + EVENT event_; + + /// The Proxy + PROXY proxy_consumer_; +}; + +#if defined (__ACE_INLINE__) +#include "Method_Request_Lookup_T.inl" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Method_Request_Lookup_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Method_Request_Lookup_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include "ace/post.h" +#endif /* TAO_NS_METHOD_REQUEST_LOOKUP_T_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl new file mode 100644 index 00000000000..dd8b76324c6 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Lookup_T.inl @@ -0,0 +1,50 @@ +// $Id$ + +#include "Event_Manager.h" + +template <class EVENT, class PROXY, class EVENT_PARAM, class PROXY_PARAM> ACE_INLINE int +TAO_NS_Method_Request_Lookup_T<EVENT, PROXY, EVENT_PARAM, PROXY_PARAM>::execute_i (ACE_ENV_SINGLE_ARG_DECL) +{ + if (this->proxy_consumer_->has_shutdown ()) + return 0; // If we were shutdown while waiting in the queue, return with no action. + + TAO_NS_Admin* parent = this->proxy_consumer_->supplier_admin (); + + CORBA::Boolean val = this->proxy_consumer_->check_filters ((EVENT)this->event_, + parent->filter_admin (), + parent->filter_operator () + ACE_ENV_ARG_PARAMETER); + + if (TAO_debug_level > 1) + ACE_DEBUG ((LM_DEBUG, "Proxyconsumer %x filter eval result = %d",this->proxy_consumer_ , val)); + + // Filter failed - do nothing. + if (val == 0) + return 0; + + // The map of subscriptions. + TAO_NS_Consumer_Map* map = this->proxy_consumer_->event_manager ()->consumer_map (); + + TAO_NS_Consumer_Map::ENTRY* entry = map->find (this->event_->type () ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + TAO_NS_ProxySupplier_Collection* consumers = 0; + + if (entry != 0) + { + consumers = entry->collection (); + + if (consumers != 0) + consumers->for_each (this ACE_ENV_ARG_PARAMETER); + + map->release (entry); + } + + // Get the default consumers + consumers = map->broadcast_collection (); + + if (consumers != 0) + consumers->for_each (this ACE_ENV_ARG_PARAMETER); + + return 0; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.cpp index cc52c47852f..db6d4335d50 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Shutdown.cpp @@ -7,7 +7,7 @@ #include "Method_Request_Shutdown.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Method_Request_Shutdown, "$Id$") +ACE_RCSID(Notify, TAO_NS_Method_Request_Shutdown, "$Id$") TAO_NS_Method_Request_Shutdown::TAO_NS_Method_Request_Shutdown (TAO_NS_ThreadPool_Task* task) : task_ (task) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.cpp index 60049cf0bef..58284285aac 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.cpp @@ -6,14 +6,14 @@ #include "Method_Request_Updates.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Method_Request_Updates, "$id$") +ACE_RCSID(Notify, TAO_NS_Method_Request_Updates, "$Id$") #include "tao/debug.h" #include "Proxy.h" #include "Peer.h" TAO_NS_Method_Request_Updates::TAO_NS_Method_Request_Updates (const TAO_NS_EventTypeSeq& added, const TAO_NS_EventTypeSeq& removed, TAO_NS_Proxy* proxy) - :added_ (added), removed_ (removed), proxy_ (proxy), refcountable_guard_ (*proxy) + : TAO_NS_Method_Request_Updates_Base (added, removed, proxy) { } @@ -21,35 +21,38 @@ TAO_NS_Method_Request_Updates::~TAO_NS_Method_Request_Updates () { } +int +TAO_NS_Method_Request_Updates::execute (ACE_ENV_SINGLE_ARG_DECL) +{ + return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER); +} + +/********************************************************************************************************/ + +TAO_NS_Method_Request_Updates_No_Copy::TAO_NS_Method_Request_Updates_No_Copy (const TAO_NS_EventTypeSeq& added + , const TAO_NS_EventTypeSeq& removed, TAO_NS_Proxy* proxy) + : TAO_NS_Method_Request_Updates_No_Copy_Base (added, removed, proxy) +{ +} + +TAO_NS_Method_Request_Updates_No_Copy::~TAO_NS_Method_Request_Updates_No_Copy () +{ +} + TAO_NS_Method_Request* -TAO_NS_Method_Request_Updates::copy (void) +TAO_NS_Method_Request_Updates_No_Copy::copy (void) { - /// @@use factory - return new TAO_NS_Method_Request_Updates (this->added_, this->removed_, this->proxy_); + TAO_NS_Method_Request* request; + + ACE_NEW_THROW_EX (request, + TAO_NS_Method_Request_Updates (this->added_, this->removed_, this->proxy_), + CORBA::INTERNAL ()); + + return request; } int -TAO_NS_Method_Request_Updates::execute (ACE_ENV_SINGLE_ARG_DECL) +TAO_NS_Method_Request_Updates_No_Copy::execute (ACE_ENV_SINGLE_ARG_DECL) { - if (this->proxy_->has_shutdown ()) - return 0; // If we were shutdown while waiting in the queue, return with no action. - - ACE_TRY - { - TAO_NS_Peer* peer = this->proxy_->peer(); - - if (peer != 0) - { - peer->dispatch_updates (this->added_, this->removed_ ACE_ENV_ARG_PARAMETER); - ACE_TRY_CHECK; - } - } - ACE_CATCHANY - { - if (TAO_debug_level > 0) - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_NS_Method_Request_Updates::execute error sending updates\n "); - } - ACE_ENDTRY; - - return 0; + return this->execute_i (ACE_ENV_SINGLE_ARG_PARAMETER); } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.h index 282b5df3097..c2629eee5c1 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates.h @@ -19,11 +19,16 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "Method_Request_Updates_T.h" #include "Method_Request.h" #include "EventTypeSeq.h" -#include "Refcountable.h" +#include "Proxy.h" -class TAO_NS_Proxy; +typedef TAO_NS_Method_Request_Updates_T<const TAO_NS_EventTypeSeq + , TAO_NS_Proxy_Guard + , const TAO_NS_EventTypeSeq& + , TAO_NS_Proxy* + > TAO_NS_Method_Request_Updates_Base; /** * @class TAO_NS_Method_Request_Updates @@ -31,7 +36,8 @@ class TAO_NS_Proxy; * @brief Command Object to send updates to proxys. * */ -class TAO_Notify_Export TAO_NS_Method_Request_Updates : public TAO_NS_Method_Request +class TAO_Notify_Export TAO_NS_Method_Request_Updates : public TAO_NS_Method_Request_Updates_Base + ,public TAO_NS_Method_Request { public: /// Constuctor @@ -40,22 +46,39 @@ public: /// Destructor ~TAO_NS_Method_Request_Updates (); - /// Create a copy of this object. - TAO_NS_Method_Request* copy (void); - /// Execute the Request virtual int execute (ACE_ENV_SINGLE_ARG_DECL); +}; + +/***********************************************************************************************************************/ + +typedef TAO_NS_Method_Request_Updates_T<const TAO_NS_EventTypeSeq& + , TAO_NS_Proxy* + , const TAO_NS_EventTypeSeq& + , TAO_NS_Proxy* + > TAO_NS_Method_Request_Updates_No_Copy_Base; + +/** + * @class TAO_NS_Method_Request_Updates_No_Copy + * + * @brief Command Object to send updates to proxys. + * + */ +class TAO_Notify_Export TAO_NS_Method_Request_Updates_No_Copy : public TAO_NS_Method_Request_Updates_No_Copy_Base + ,public TAO_NS_Method_Request_No_Copy +{ +public: + /// Constuctor + TAO_NS_Method_Request_Updates_No_Copy (const TAO_NS_EventTypeSeq& added, const TAO_NS_EventTypeSeq& removed, TAO_NS_Proxy* proxy); -private: - /// The Updates - const TAO_NS_EventTypeSeq added_; - const TAO_NS_EventTypeSeq removed_; + /// Destructor + ~TAO_NS_Method_Request_Updates_No_Copy (); - /// The proxy that will receive the updates. - TAO_NS_Proxy* proxy_; + /// Create a copy of this object. + TAO_NS_Method_Request* copy (void); - /// Guard to automatically inc/decr ref count on the proxy. - TAO_NS_Refcountable_Guard refcountable_guard_; + /// Execute the Request + virtual int execute (ACE_ENV_SINGLE_ARG_DECL); }; #if defined (__ACE_INLINE__) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.cpp new file mode 100644 index 00000000000..e191e7edb85 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.cpp @@ -0,0 +1,25 @@ +// $Id$ +#ifndef TAO_NS_Method_Request_Updates_T_CPP +#define TAO_NS_Method_Request_Updates_T_CPP + +#include "Method_Request_Updates_T.h" + +#if ! defined (__ACE_INLINE__) +#include "Method_Request_Updates_T.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(Notify, TAO_NS_Method_Request_Updates_T, "$id$") + +template <class SEQ, class PROXY, class SEQ_PARAM, class PROXY_PARAM> +TAO_NS_Method_Request_Updates_T<SEQ, PROXY, SEQ_PARAM, PROXY_PARAM>::TAO_NS_Method_Request_Updates_T (SEQ_PARAM added, SEQ_PARAM removed, + PROXY_PARAM proxy) + : added_ (added), removed_ (removed), proxy_ (proxy) +{ +} + +template <class SEQ, class PROXY, class SEQ_PARAM, class PROXY_PARAM> +TAO_NS_Method_Request_Updates_T<SEQ, PROXY, SEQ_PARAM, PROXY_PARAM>::~TAO_NS_Method_Request_Updates_T () +{ +} + +#endif /* TAO_NS_Method_Request_Updates_T_CPP */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.h b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.h new file mode 100644 index 00000000000..c2297083ba9 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.h @@ -0,0 +1,67 @@ +/* -*- C++ -*- */ +/** + * @file Method_Request_Updates_T.h + * + * $Id$ + * + * @author Pradeep Gore <pradeep@oomworks.com> + * + * + */ + +#ifndef TAO_NS_METHOD_REQUEST_UPDATES_T_H +#define TAO_NS_METHOD_REQUEST_UPDATES_T_H +#include "ace/pre.h" + +#include "notify_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/corba.h" + +/** + * @class TAO_NS_Method_Request_Updates_T + * + * @brief + * + */ +template <class SEQ, class PROXY, class SEQ_PARAM, class PROXY_PARAM> +class TAO_Notify_Export TAO_NS_Method_Request_Updates_T +{ +public: + /// Constuctor + TAO_NS_Method_Request_Updates_T (SEQ_PARAM added, SEQ_PARAM removed, PROXY_PARAM proxy); + + /// Destructor + ~TAO_NS_Method_Request_Updates_T (); + + /// Execute the Request + int execute_i (ACE_ENV_SINGLE_ARG_DECL); + +protected: + /// Update Added + SEQ added_; + + /// Update Removed + SEQ removed_; + + /// The Proxy that will receive the updates. + PROXY proxy_; +}; + +#if defined (__ACE_INLINE__) +#include "Method_Request_Updates_T.inl" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Method_Request_Updates_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Method_Request_Updates_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include "ace/post.h" +#endif /* TAO_NS_METHOD_REQUEST_UPDATES_T_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.inl new file mode 100644 index 00000000000..132489ae250 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Method_Request_Updates_T.inl @@ -0,0 +1,27 @@ +// $Id$ + +template <class SEQ, class PROXY, class SEQ_PARAM, class PROXY_PARAM> ACE_INLINE int +TAO_NS_Method_Request_Updates_T<SEQ, PROXY, SEQ_PARAM, PROXY_PARAM>::execute_i (ACE_ENV_SINGLE_ARG_DECL) +{ + if (this->proxy_->has_shutdown ()) + return 0; // If we were shutdown while waiting in the queue, return with no action. + + ACE_TRY + { + TAO_NS_Peer* peer = this->proxy_->peer(); + + if (peer != 0) + { + peer->dispatch_updates (this->added_, this->removed_ ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + } + ACE_CATCHANY + { + if (TAO_debug_level > 0) + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "TAO_NS_Method_Request_Updates::execute error sending updates\n "); + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.h index 03ca6f6d4f4..e603de0139c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Interpreter.h @@ -6,8 +6,6 @@ * $Id$ * * - * - * * @author Pradeep Gore <pradeep@cs.wustl.edu> */ //============================================================================= diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.cpp index e7224c069a0..bcc037cbbf1 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.cpp @@ -1,4 +1,3 @@ -/* -*- C++ -*- */ /* $Id$ */ #include "Notify_Constraint_Visitors.h" @@ -246,9 +245,17 @@ TAO_NS_Constraint_Visitor::visit_union_pos ( { TAO_OutputCDR cdr; cdr.write_ulong ((CORBA::ULong) disc_val); - disc_any._tao_replace (disc_tc.in (), - TAO_ENCAP_BYTE_ORDER, - cdr.begin ()); + + TAO::Unknown_IDL_Type *unk = 0; + ACE_NEW_RETURN (unk, + TAO::Unknown_IDL_Type ( + disc_tc.in (), + cdr.begin (), + TAO_ENCAP_BYTE_ORDER + ), + -1); + + disc_any.replace (unk); break; } // @@@ (JP) I don't think ETCL handles 64-bit diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.h index 4b356c9945f..5a70d17a6f8 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Constraint_Visitors.h @@ -6,8 +6,6 @@ * $Id$ * * - * - * * @author Pradeep Gore <pradeep@cs.wustl.edu> * @author Jeff Parsons <parsons@cs.wustl.edu> */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h index 89bf1bf98c9..fd39bddfd6f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_EventChannelFactory_i.h @@ -4,7 +4,6 @@ * * $Id$ * - * * @author Pradeep Gore <pradeep@cs.wustl.edu> */ //============================================================================= diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.cpp index 3768d3b8f42..d6c5c0d869f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Extensions.cpp @@ -1,4 +1,3 @@ -// -*- C++ -*- // $Id$ #include "Notify_Extensions.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Object.cpp b/TAO/orbsvcs/orbsvcs/Notify/Object.cpp index 825f6ab6075..d228fe793e7 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Object.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Object.cpp @@ -13,7 +13,7 @@ #include "Object.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Object, "$Id$") +ACE_RCSID(Notify, TAO_NS_Object, "$Id$") TAO_NS_Object::TAO_NS_Object (void) : event_manager_ (0) @@ -36,6 +36,9 @@ TAO_NS_Object::~TAO_NS_Object () { if (TAO_debug_level > 2 ) ACE_DEBUG ((LM_DEBUG,"object:%x destroyed\n", this )); + + this->shutdown_proxy_poa (); + this->shutdown_object_poa (); } void @@ -66,7 +69,21 @@ TAO_NS_Object::activate (PortableServer::Servant servant ACE_ENV_ARG_DECL) void TAO_NS_Object::deactivate (ACE_ENV_SINGLE_ARG_DECL) { - this->poa_->deactivate (this->id_ ACE_ENV_ARG_PARAMETER); + ACE_TRY + { + this->poa_->deactivate (this->id_ ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + if (TAO_debug_level > 2) + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "(%P|%t)\n"); + ACE_DEBUG ((LM_DEBUG, "Could not deactivate object %d\n", this->id_)); + } + // Do not propagate any exceptions + } + ACE_ENDTRY; } int @@ -84,7 +101,6 @@ TAO_NS_Object::shutdown (ACE_ENV_SINGLE_ARG_DECL) this->deactivate (ACE_ENV_SINGLE_ARG_PARAMETER); this->shutdown_worker_task (); - this->shutdown_proxy_poa (); return 0; } @@ -117,7 +133,7 @@ TAO_NS_Object::shutdown_proxy_poa (void) { this->proxy_poa_->destroy (ACE_ENV_SINGLE_ARG_PARAMETER); ACE_TRY_CHECK; - + delete this->proxy_poa_; } ACE_CATCHANY diff --git a/TAO/orbsvcs/orbsvcs/Notify/Object.h b/TAO/orbsvcs/orbsvcs/Notify/Object.h index 43c2906996b..7c8dc3bf41f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Object.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Object.h @@ -101,6 +101,9 @@ public: /// shutdown. Returns 1 ifif the shutdown was already run once before. virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL); + /// Accessor for the Event Manager + TAO_NS_Event_Manager* event_manager (void); + protected: /// Init this object with data from <rhs>. void init (TAO_NS_Object* parent); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Object.inl b/TAO/orbsvcs/orbsvcs/Notify/Object.inl index 251c0655e6d..5cf10b3b1c9 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Object.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Object.inl @@ -35,3 +35,9 @@ TAO_NS_Object::has_shutdown (void) { return this->shutdown_; } + +ACE_INLINE TAO_NS_Event_Manager* +TAO_NS_Object::event_manager (void) +{ + return this->event_manager_; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Peer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Peer.cpp index 4a26d732d85..652645184ee 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Peer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Peer.cpp @@ -6,7 +6,7 @@ #include "Peer.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Peer, "$id$") +ACE_RCSID(Notify, TAO_NS_Peer, "$Id$") #include "tao/debug.h" #include "Proxy.h" @@ -82,7 +82,7 @@ TAO_NS_Peer::dispatch_updates (const TAO_NS_EventTypeSeq & added, const TAO_NS_E if (cos_added.length () != 0 || cos_removed.length () != 0) { - TAO_NS_Refcountable_Guard ref_guard(*this->proxy ()); // Protect this object from being destroyed in this scope. + TAO_NS_Proxy_Guard proxy_guard(this->proxy ()); // Protect this object from being destroyed in this scope. this->dispatch_updates_i (cos_added, cos_removed ACE_ENV_ARG_PARAMETER); ACE_TRY_CHECK; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp index 421fd42a00a..f8faf3ac96d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.cpp @@ -8,13 +8,11 @@ #include "Properties.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Properties, "$Id$") +ACE_RCSID (Notify, TAO_NS_Properties, "$Id$") TAO_NS_Properties::TAO_NS_Properties (void) : factory_ (0) , builder_ (0) - , thr_sched_policy_ (THR_SCHED_DEFAULT) - , thr_scope_policy_ (THR_SCOPE_PROCESS) , asynch_updates_ (0) { // In case no conf. file is specified, the EC will default to reactive concurrency. diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.h b/TAO/orbsvcs/orbsvcs/Notify/Properties.h index 4a0a6a03ffc..5eb3d1a6e2e 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Properties.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.h @@ -57,12 +57,6 @@ public: PortableServer::POA_ptr default_poa (void); void default_poa (PortableServer::POA_ptr default_poa); - long scope_policy (void); - void scope_policy (long scope_policy); - - long sched_policy (void); - void sched_policy (long sched_policy); - CORBA::Boolean asynch_updates (void); void asynch_updates (CORBA::Boolean asynch_updates); @@ -109,12 +103,6 @@ protected: // POA PortableServer::POA_var default_poa_; - /// Sched policy - long thr_sched_policy_; - - /// Scope policy - long thr_scope_policy_; - /// True if send asynch updates. CORBA::Boolean asynch_updates_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Properties.inl b/TAO/orbsvcs/orbsvcs/Notify/Properties.inl index a066c3907a5..5265fdc82c5 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Properties.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Properties.inl @@ -48,30 +48,6 @@ TAO_NS_Properties::default_poa (PortableServer::POA_ptr default_poa) this->default_poa_ = PortableServer::POA::_duplicate (default_poa); } -ACE_INLINE long -TAO_NS_Properties::scope_policy (void) -{ - return thr_scope_policy_; -} - -ACE_INLINE void -TAO_NS_Properties::scope_policy (long scope_policy) -{ - thr_scope_policy_ = scope_policy; -} - -ACE_INLINE long -TAO_NS_Properties::sched_policy (void) -{ - return thr_sched_policy_; -} - -ACE_INLINE void -TAO_NS_Properties::sched_policy (long sched_policy) -{ - thr_sched_policy_ = sched_policy; -} - ACE_INLINE CORBA::Boolean TAO_NS_Properties::asynch_updates (void) { diff --git a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.cpp b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.cpp index ad5042b9e87..06fa1cf9747 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.cpp @@ -6,7 +6,7 @@ #include "PropertySeq.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_PropertySeq, "$id$") +ACE_RCSID(Notify, TAO_NS_PropertySeq, "$Id$") TAO_NS_PropertySeq::TAO_NS_PropertySeq (void) { diff --git a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.h b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.h index 4371aea34f9..729742add8d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.h +++ b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.h @@ -42,7 +42,7 @@ public: int init (const CosNotification::PropertySeq& prop_seq); /// Find the <value> for property <name>. Returns 0 on success. - int find (const ACE_CString& name, CosNotification::PropertyValue& value) const; + int find (const char* name, CosNotification::PropertyValue& value) const; /// Return -1 on error. int populate (CosNotification::PropertySeq_var& prop_seq); diff --git a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.inl b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.inl index 271543a2f82..ade45a1057e 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/PropertySeq.inl @@ -1,7 +1,8 @@ // $Id$ ACE_INLINE int -TAO_NS_PropertySeq::find (const ACE_CString& name, CosNotification::PropertyValue& value) const +TAO_NS_PropertySeq::find (const char* name, CosNotification::PropertyValue& value) const { - return this->property_map_.find (name, value); + ACE_CString str_name (name); + return this->property_map_.find (str_name, value); } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.cpp b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.cpp index 4c240b12bd9..5615477c391 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.cpp @@ -6,16 +6,16 @@ #include "Property_Boolean.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Property_Boolean, "$id$") +ACE_RCSID(Notify, TAO_NS_Property_Boolean, "$Id$") #include "PropertySeq.h" -TAO_NS_Property_Boolean::TAO_NS_Property_Boolean (const ACE_CString& name) +TAO_NS_Property_Boolean::TAO_NS_Property_Boolean (const char* name) :name_ (name), valid_(0) { } -TAO_NS_Property_Boolean::TAO_NS_Property_Boolean (const ACE_CString& name, CORBA::Boolean initial) +TAO_NS_Property_Boolean::TAO_NS_Property_Boolean (const char* name, CORBA::Boolean initial) :name_ (name), value_ (initial), valid_ (1) { } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.h b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.h index 1ddb447f418..9dc617f2493 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Property_Boolean.h @@ -35,10 +35,10 @@ class TAO_Notify_Export TAO_NS_Property_Boolean { public: /// Constuctor - TAO_NS_Property_Boolean (const ACE_CString& name, CORBA::Boolean initial); + TAO_NS_Property_Boolean (const char* name, CORBA::Boolean initial); /// Constuctor - TAO_NS_Property_Boolean (const ACE_CString& name); + TAO_NS_Property_Boolean (const char* name); /// Assignment from TAO_NS_Property_Boolean TAO_NS_Property_Boolean& operator= (const TAO_NS_Property_Boolean& rhs); @@ -64,7 +64,7 @@ public: protected: /// The Property name. - ACE_CString name_; + const char* name_; /// The value CORBA::Boolean value_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp index 051345844c1..a124c957046 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Property_T.cpp @@ -9,30 +9,31 @@ #include "Property_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Property_T, "$id$") +ACE_RCSID(Notify, TAO_NS_Property_T, "$Id$") #include "PropertySeq.h" /*******************************************************************************/ template <class TYPE> -TAO_NS_PropertyBase_T<TYPE>::TAO_NS_PropertyBase_T (const ACE_CString& name) +TAO_NS_PropertyBase_T<TYPE>::TAO_NS_PropertyBase_T (const char* name) :name_ (name), valid_(0) { } template <class TYPE> -TAO_NS_PropertyBase_T<TYPE>::TAO_NS_PropertyBase_T (const ACE_CString& name, const TYPE& initial) +TAO_NS_PropertyBase_T<TYPE>::TAO_NS_PropertyBase_T (const char* name, const TYPE& initial) :name_ (name), value_ (initial), valid_ (1) { } template <class TYPE> TAO_NS_PropertyBase_T<TYPE>::TAO_NS_PropertyBase_T (const TAO_NS_PropertyBase_T &rhs) +:name_ (rhs.name_), + value_ (rhs.value_), + valid_ (rhs.valid_) { - this->name_ = rhs.name_; - this->value_ = rhs.value_; - this->valid_ = rhs.valid_; + } template <class TYPE> @@ -52,13 +53,13 @@ TAO_NS_PropertyBase_T<TYPE>::get (CosNotification::PropertySeq& prop_seq) /*******************************************************************************/ template <class TYPE> -TAO_NS_Property_T<TYPE>::TAO_NS_Property_T (const ACE_CString& name) +TAO_NS_Property_T<TYPE>::TAO_NS_Property_T (const char* name) :TAO_NS_PropertyBase_T <TYPE> (name) { } template <class TYPE> -TAO_NS_Property_T<TYPE>::TAO_NS_Property_T (const ACE_CString& name, const TYPE& initial) +TAO_NS_Property_T<TYPE>::TAO_NS_Property_T (const char* name, const TYPE& initial) :TAO_NS_PropertyBase_T <TYPE> (name, initial) { } @@ -68,29 +69,38 @@ TAO_NS_Property_T<TYPE>::set (const TAO_NS_PropertySeq& property_seq) { CosNotification::PropertyValue value; - if (property_seq.find (this->name_, value) == -1) + if (property_seq.find (this->name_, value) == 0 && (value >>= this->value_)) { - this->valid_ = 0; - return -1; + this->valid_ = 1; + return 0; } - value >>= this->value_; + this->valid_ = 0; + return -1; +} - this->valid_ = 1; +template <class TYPE> int +TAO_NS_Property_T<TYPE>::set(const CosNotification::PropertyValue &value) +{ + if (value >>= this->value_) + { + this->valid_ = 1; + return 0; + } - return 0; + return -1; } /*******************************************************************************/ template <class TYPE> -TAO_NS_StructProperty_T<TYPE>::TAO_NS_StructProperty_T (const ACE_CString& name) +TAO_NS_StructProperty_T<TYPE>::TAO_NS_StructProperty_T (const char* name) :name_ (name), valid_(0) { } template <class TYPE> -TAO_NS_StructProperty_T<TYPE>::TAO_NS_StructProperty_T (const ACE_CString& name, const TYPE& initial) +TAO_NS_StructProperty_T<TYPE>::TAO_NS_StructProperty_T (const char* name, const TYPE& initial) :name_ (name), value_ (initial), valid_ (1) { } @@ -100,20 +110,20 @@ TAO_NS_StructProperty_T<TYPE>::set (const TAO_NS_PropertySeq& property_seq) { CosNotification::PropertyValue value; - if (property_seq.find (this->name_, value) == -1) + if (property_seq.find (this->name_, value) == 0) { - this->valid_ = 0; - return -1; + TYPE* extract_type = 0; + + if ((value >>= extract_type) && extract_type != 0) // make sure we get something valid. + { + this->value_ = *extract_type; // copy + this->valid_ = 1; + return 0; + } } - TYPE* extract_type; - value >>= extract_type; - - this->value_ = *extract_type; // copy - - this->valid_ = 1; - - return 0; + this->valid_ = 0; + return -1; } #endif /* TAO_NS_PROPERTY_T_CPP */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_T.h b/TAO/orbsvcs/orbsvcs/Notify/Property_T.h index 5b05d472b9f..2d35ac4f475 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Property_T.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Property_T.h @@ -35,10 +35,10 @@ class TAO_NS_PropertyBase_T { public: /// Constuctor - TAO_NS_PropertyBase_T (const ACE_CString& name, const TYPE& initial); + TAO_NS_PropertyBase_T (const char* name, const TYPE& initial); /// Constuctor - TAO_NS_PropertyBase_T (const ACE_CString& name); + TAO_NS_PropertyBase_T (const char* name); /// Copy Constuctor TAO_NS_PropertyBase_T (const TAO_NS_PropertyBase_T &rhs); @@ -47,7 +47,7 @@ public: ~TAO_NS_PropertyBase_T (); /// Assignment from TAO_NS_PropertyBase_T - TAO_NS_PropertyBase_T& operator= (const TAO_NS_PropertyBase_T& rhs); + // TAO_NS_PropertyBase_T& operator= (const TAO_NS_PropertyBase_T& rhs); /// Assignment from TYPE TAO_NS_PropertyBase_T& operator= (const TYPE& rhs); @@ -72,13 +72,16 @@ public: protected: /// The Property name. - ACE_CString name_; + const char* name_; /// The value TYPE value_; /// Is the value valid CORBA::Boolean valid_; + +private: + ACE_UNIMPLEMENTED_FUNC (TAO_NS_PropertyBase_T& operator= (const TAO_NS_PropertyBase_T& rhs)) }; @@ -94,10 +97,10 @@ class TAO_NS_Property_T : public TAO_NS_PropertyBase_T<TYPE> { public: /// Constuctor - TAO_NS_Property_T (const ACE_CString& name, const TYPE& initial); + TAO_NS_Property_T (const char* name, const TYPE& initial); /// Constuctor - TAO_NS_Property_T (const ACE_CString& name); + TAO_NS_Property_T (const char* name); /// Assignment from TYPE TAO_NS_Property_T& operator= (const TYPE& rhs); @@ -105,6 +108,10 @@ public: /// Init this Property from the sequence. /// Returns 0 on success, -1 on error int set (const TAO_NS_PropertySeq& property_seq); + + /// Init this Property from the CosNotification::PropertyValue + /// Returns 0 on success, -1 on error + int set (const CosNotification::PropertyValue &value); }; /*******************************************************************************/ @@ -119,10 +126,10 @@ class TAO_NS_StructProperty_T { public: /// Constuctor - TAO_NS_StructProperty_T (const ACE_CString& name, const TYPE& initial); + TAO_NS_StructProperty_T (const char* name, const TYPE& initial); /// Constuctor - TAO_NS_StructProperty_T (const ACE_CString& name); + TAO_NS_StructProperty_T (const char* name); /// Init this Property from the sequence. /// Returns 0 on success, -1 on error @@ -136,7 +143,7 @@ public: protected: /// The Property name. - ACE_CString name_; + const char* name_; /// The value TYPE value_; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Property_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Property_T.inl index 3442b0fe7c4..ab195431b22 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Property_T.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Property_T.inl @@ -25,22 +25,6 @@ TAO_NS_PropertyBase_T<TYPE>::operator!= (const TYPE &rhs) const } template <class TYPE> ACE_INLINE TAO_NS_PropertyBase_T<TYPE>& -TAO_NS_PropertyBase_T<TYPE>::operator= (const TAO_NS_PropertyBase_T<TYPE>& rhs) -{ - if (this == &rhs) - return *this; - - if (rhs.is_valid ()) - { - this->name_ = rhs.name_; - this->value_ = rhs.value_; - this->valid_ = rhs.valid_; - } - - return *this; -} - -template <class TYPE> ACE_INLINE TAO_NS_PropertyBase_T<TYPE>& TAO_NS_PropertyBase_T<TYPE>::operator=(const TYPE& value) { this->value_ = value; diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.cpp b/TAO/orbsvcs/orbsvcs/Notify/Proxy.cpp index f8a9d298565..5e29ea6fdc6 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Proxy.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.cpp @@ -51,46 +51,18 @@ TAO_NS_Proxy::subscribed_types (TAO_NS_EventTypeSeq& subscribed_types ACE_ENV_AR } void -TAO_NS_Proxy::types_changed (const TAO_NS_EventTypeSeq& added, const TAO_NS_EventTypeSeq& removed ACE_ENV_ARG_DECL_NOT_USED) +TAO_NS_Proxy::types_changed (const TAO_NS_EventTypeSeq& added, const TAO_NS_EventTypeSeq& removed ACE_ENV_ARG_DECL) { - TAO_NS_Method_Request_Updates request (added, removed, this); + TAO_NS_Method_Request_Updates_No_Copy request (added, removed, this); if (TAO_NS_PROPERTIES::instance()->asynch_updates () == 1) // if we should send the updates synchronously. { - this->worker_task ()->exec (request); + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); } else // execute in the current thread context. { - ACE_DECLARE_NEW_CORBA_ENV; request.execute (ACE_ENV_SINGLE_ARG_PARAMETER); - } -} - -CORBA::Boolean -TAO_NS_Proxy::check_filters (const TAO_NS_Event_var &event - , TAO_NS_FilterAdmin& parent_filter_admin - , CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator - ACE_ENV_ARG_DECL) -{ - // check if it passes the parent filter. - CORBA::Boolean parent_val = - parent_filter_admin.match (event ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - - CORBA::Boolean val = 0; - - if (filter_operator == CosNotifyChannelAdmin::AND_OP) - { - val = parent_val && this->filter_admin_.match (event ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); } - else - { - val = parent_val || this->filter_admin_.match (event ACE_ENV_ARG_PARAMETER); - ACE_CHECK_RETURN (0); - } - - return val; } CosNotification::EventTypeSeq* diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.h b/TAO/orbsvcs/orbsvcs/Notify/Proxy.h index 454235ab477..9e767d25f4f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Proxy.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.h @@ -23,6 +23,7 @@ #include "EventTypeSeq.h" #include "FilterAdmin.h" #include "Admin.h" +#include "Refcountable_Guard_T.h" class TAO_NS_Admin; class TAO_NS_Peer; @@ -57,6 +58,12 @@ public: void subscribed_types (TAO_NS_EventTypeSeq& subscribed_types ACE_ENV_ARG_DECL); /// Check if this event passes the admin and proxy filters. + CORBA::Boolean check_filters (const TAO_NS_Event* event + , TAO_NS_FilterAdmin& parent_filter_admin + , CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator + ACE_ENV_ARG_DECL); + + /// Check if this event passes the admin and proxy filters. CORBA::Boolean check_filters (const TAO_NS_Event_var &event , TAO_NS_FilterAdmin& parent_filter_admin , CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator @@ -101,6 +108,8 @@ protected: CORBA::Boolean updates_off_; }; +typedef TAO_NS_Refcountable_Guard_T<TAO_NS_Proxy> TAO_NS_Proxy_Guard; + #if defined (__ACE_INLINE__) #include "Proxy.inl" #endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl b/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl index 3610f2b3167..1d74171a622 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy.inl @@ -5,3 +5,39 @@ TAO_NS_Proxy::updates_off (void) { return this->updates_off_; } + +ACE_INLINE CORBA::Boolean +TAO_NS_Proxy::check_filters (const TAO_NS_Event_var &event + , TAO_NS_FilterAdmin& parent_filter_admin + , CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator + ACE_ENV_ARG_DECL) +{ + return this->check_filters (event.get (), parent_filter_admin, filter_operator ACE_ENV_ARG_PARAMETER); +} + +ACE_INLINE CORBA::Boolean +TAO_NS_Proxy::check_filters (const TAO_NS_Event* event + , TAO_NS_FilterAdmin& parent_filter_admin + , CosNotifyChannelAdmin::InterFilterGroupOperator filter_operator + ACE_ENV_ARG_DECL) +{ + // check if it passes the parent filter. + CORBA::Boolean parent_val = + parent_filter_admin.match (event ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + + CORBA::Boolean val = 0; + + if (filter_operator == CosNotifyChannelAdmin::AND_OP) + { + val = parent_val && this->filter_admin_.match (event ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + } + else + { + val = parent_val || this->filter_admin_.match (event ACE_ENV_ARG_PARAMETER); + ACE_CHECK_RETURN (0); + } + + return val; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp index 86bba03d3d1..0410d356154 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.cpp @@ -141,11 +141,3 @@ TAO_NS_ProxyConsumer::destroy (ACE_ENV_SINGLE_ARG_DECL) this->supplier_admin_->remove (this ACE_ENV_ARG_PARAMETER); ACE_CHECK; } - -void -TAO_NS_ProxyConsumer::push (TAO_NS_Event_var &event) -{ - TAO_NS_Method_Request_Lookup request (event, this, this->event_manager_->consumer_map ()); - - this->worker_task ()->exec (request); -} diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h index 807bcf152f3..90b556fd55c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer.h @@ -20,9 +20,11 @@ # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "orbsvcs/CosEventChannelAdminC.h" +#include "Refcountable_Guard_T.h" #include "Event.h" #include "Proxy.h" -#include "orbsvcs/CosEventChannelAdminC.h" + class TAO_NS_SupplierAdmin; class TAO_NS_Supplier; @@ -61,9 +63,6 @@ public: /// Destroy this object. virtual void destroy (ACE_ENV_SINGLE_ARG_DECL); - /// Start event propagation. - virtual void push (TAO_NS_Event_var &event); - /// Access our Peer. virtual TAO_NS_Peer* peer (void); @@ -85,6 +84,8 @@ protected: TAO_NS_Supplier* supplier_; }; +typedef TAO_NS_Refcountable_Guard_T<TAO_NS_ProxyConsumer> TAO_NS_ProxyConsumer_Guard; + #if defined (__ACE_INLINE__) #include "ProxyConsumer.inl" #endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.cpp index 7c75dd56b49..59ea1b47f4a 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxyConsumer_T.cpp @@ -10,7 +10,7 @@ #include "ProxyConsumer_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_ProxyConsumer_T, "$id$") +ACE_RCSID(Notify, TAO_NS_ProxyConsumer_T, "$Id$") #include "Event_Manager.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp index 1937f983ed6..943786e9306 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.cpp @@ -8,7 +8,6 @@ ACE_RCSID(RT_Notify, TAO_NS_ProxySupplier, "$Id$") -#include "Method_Request_Dispatch_No_Filtering.h" #include "Event_Manager.h" #include "AdminProperties.h" #include "Consumer.h" @@ -140,19 +139,35 @@ TAO_NS_ProxySupplier::destroy (ACE_ENV_SINGLE_ARG_DECL) } void -TAO_NS_ProxySupplier::push (const TAO_NS_Event_var &event) +TAO_NS_ProxySupplier::push (const TAO_NS_Event* event ACE_ENV_ARG_DECL) { - TAO_NS_Method_Request_Dispatch request (event, this); + TAO_NS_Method_Request_Dispatch_No_Copy request (event, this, 1); - this->worker_task ()->exec (request); + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); } void -TAO_NS_ProxySupplier::push_no_filtering (const TAO_NS_Event_var &event) +TAO_NS_ProxySupplier::push (const TAO_NS_Event_var &event ACE_ENV_ARG_DECL) { - TAO_NS_Method_Request_Dispatch_No_Filtering request (event, this); + TAO_NS_Method_Request_Dispatch_No_Copy_Ex request (event, this, 1); - this->worker_task ()->exec (request); + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_ProxySupplier::push_no_filtering (const TAO_NS_Event* event ACE_ENV_ARG_DECL) +{ + TAO_NS_Method_Request_Dispatch_No_Copy request (event, this, 0); // No filtering. + + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_ProxySupplier::push_no_filtering (const TAO_NS_Event_var &event ACE_ENV_ARG_DECL) +{ + TAO_NS_Method_Request_Dispatch_No_Copy_Ex request (event, this, 0); // No filtering. + + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); } void diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h index dfb5bb590b9..1e8ee3c7bed 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier.h @@ -21,6 +21,7 @@ #include "Event.h" #include "Proxy.h" +#include "Refcountable_Guard_T.h" #include "orbsvcs/CosEventChannelAdminC.h" class TAO_NS_Consumer; @@ -56,10 +57,16 @@ public: void disconnect (ACE_ENV_SINGLE_ARG_DECL); /// Dispatch Event to consumer - virtual void push (const TAO_NS_Event_var &event); + virtual void push (const TAO_NS_Event* event ACE_ENV_ARG_DECL); + + /// Dispatch Event to consumer + virtual void push (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); /// Dispatch Event to consumer, no filtering - virtual void push_no_filtering (const TAO_NS_Event_var &event); + virtual void push_no_filtering (const TAO_NS_Event* event ACE_ENV_ARG_DECL); + + /// Dispatch Event to consumer, no filtering + virtual void push_no_filtering (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); /// Override TAO_NS_Container_T::shutdown method virtual int shutdown (ACE_ENV_SINGLE_ARG_DECL); @@ -92,6 +99,8 @@ protected: TAO_NS_Consumer* consumer_; }; +typedef TAO_NS_Refcountable_Guard_T<TAO_NS_ProxySupplier> TAO_NS_ProxySupplier_Guard; + #if defined (__ACE_INLINE__) #include "ProxySupplier.inl" #endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.cpp index 04db7d0d999..c8ba03e66ab 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ProxySupplier_T.cpp @@ -9,14 +9,13 @@ #include "ProxySupplier_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_ProxySupplier_T, "$id$") +ACE_RCSID(Notify, TAO_NS_ProxySupplier_T, "$Id$") #include "Consumer.h" #include "Structured/StructuredEvent.h" #include "Any/AnyEvent.h" #include "Method_Request_Dispatch.h" -#include "Method_Request_Dispatch_No_Filtering.h" #include "Worker_Task.h" #include "Event_Manager.h" #include "ConsumerAdmin.h" @@ -46,50 +45,50 @@ TAO_NS_ProxySupplier_T<SERVANT_TYPE>::forward_structured (const CosNotification: CORBA::SystemException )) { - TAO_NS_Event_var event (new TAO_NS_StructuredEvent (notification)); + TAO_NS_StructuredEvent_No_Copy event (notification); - TAO_NS_Method_Request_Dispatch request (event, this); + TAO_NS_Method_Request_Dispatch_No_Copy request (&event, this, 1); - this->worker_task ()->exec (request); + this->worker_task ()->execute (request ACE_ENV_ARG_DECL); } template <class SERVANT_TYPE> void -TAO_NS_ProxySupplier_T<SERVANT_TYPE>::forward_structured_no_filtering (const CosNotification::StructuredEvent& notification ACE_ENV_ARG_DECL_NOT_USED) +TAO_NS_ProxySupplier_T<SERVANT_TYPE>::forward_structured_no_filtering (const CosNotification::StructuredEvent& notification ACE_ENV_ARG_DECL) ACE_THROW_SPEC (( CORBA::SystemException )) { - TAO_NS_Event_var event (new TAO_NS_StructuredEvent (notification)); + TAO_NS_StructuredEvent_No_Copy event(notification); - TAO_NS_Method_Request_Dispatch_No_Filtering request (event, this); + TAO_NS_Method_Request_Dispatch_No_Copy request (&event, this, 0); - this->worker_task ()->exec (request); + this->worker_task ()->execute (request ACE_ENV_ARG_DECL); } template <class SERVANT_TYPE> void -TAO_NS_ProxySupplier_T<SERVANT_TYPE>::forward_any (const CORBA::Any & data ACE_ENV_ARG_DECL_NOT_USED) +TAO_NS_ProxySupplier_T<SERVANT_TYPE>::forward_any (const CORBA::Any & any ACE_ENV_ARG_DECL_NOT_USED) ACE_THROW_SPEC (( CORBA::SystemException )) { - TAO_NS_Event_var event (new TAO_NS_AnyEvent (data)); + TAO_NS_AnyEvent_No_Copy event (any); - TAO_NS_Method_Request_Dispatch request (event, this); + TAO_NS_Method_Request_Dispatch_No_Copy request (&event, this, 1); - this->worker_task ()->exec (request); + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); } template <class SERVANT_TYPE> void -TAO_NS_ProxySupplier_T<SERVANT_TYPE>::forward_any_no_filtering (const CORBA::Any& data ACE_ENV_ARG_DECL_NOT_USED) +TAO_NS_ProxySupplier_T<SERVANT_TYPE>::forward_any_no_filtering (const CORBA::Any& any ACE_ENV_ARG_DECL) ACE_THROW_SPEC (( CORBA::SystemException )) { - TAO_NS_Event_var event (new TAO_NS_AnyEvent (data)); + TAO_NS_AnyEvent_No_Copy event(any); - TAO_NS_Method_Request_Dispatch_No_Filtering request (event, this); + TAO_NS_Method_Request_Dispatch_No_Copy request (&event, this, 0); - this->worker_task ()->exec (request); + this->worker_task ()->execute (request ACE_ENV_ARG_PARAMETER); } template <class SERVANT_TYPE> CosNotification::EventTypeSeq* diff --git a/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.cpp index dd340c2b592..3136b9b6935 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Proxy_T.cpp @@ -9,7 +9,7 @@ #include "Proxy_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Proxy_T, "$id$") +ACE_RCSID(Notify, TAO_NS_Proxy_T, "$Id$") template <class SERVANT_TYPE> TAO_NS_Proxy_T<SERVANT_TYPE>::TAO_NS_Proxy_T (void) diff --git a/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.cpp b/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.cpp index ca2e0da3330..60c229669dd 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/QoSProperties.cpp @@ -6,18 +6,18 @@ #include "QoSProperties.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_QoSProperties, "$id$") +ACE_RCSID(Notify, TAO_NS_QoSProperties, "$Id$") #include "Property.h" TAO_NS_QoSProperties::TAO_NS_QoSProperties (void) - :priority_ (CosNotification::Priority), - timeout_ (CosNotification::Timeout), - stop_time_supported_ (CosNotification::StopTimeSupported), - maximum_batch_size_ (CosNotification::MaximumBatchSize), - pacing_interval_ (CosNotification::PacingInterval), - thread_pool_ (NotifyExt::ThreadPool), - thread_pool_lane_ (NotifyExt::ThreadPoolLanes) + : priority_ (CosNotification::Priority) + , timeout_ (CosNotification::Timeout) + , stop_time_supported_ (CosNotification::StopTimeSupported) + , maximum_batch_size_ (CosNotification::MaximumBatchSize) + , pacing_interval_ (CosNotification::PacingInterval) + , thread_pool_ (NotifyExt::ThreadPool) + , thread_pool_lane_ (NotifyExt::ThreadPoolLanes) { unsupported_[0] = CosNotification::EventReliability; unsupported_[1] = CosNotification::ConnectionReliability; @@ -63,14 +63,17 @@ TAO_NS_QoSProperties::init (const CosNotification::PropertySeq& prop_seq, CosNot // Note call to rebind. This allows to call <init> to set updates. } - // Now, init the supported properties - this->priority_.set (*this); - this->timeout_.set (*this); - this->stop_time_supported_.set (*this); - this->maximum_batch_size_.set (*this); - this->pacing_interval_.set (*this); - this->thread_pool_.set (*this); - this->thread_pool_lane_.set (*this); + if (prop_seq.length () > 0) + { + // Now, init the supported properties + this->priority_.set (*this); + this->timeout_.set (*this); + this->stop_time_supported_.set (*this); + this->maximum_batch_size_.set (*this); + this->pacing_interval_.set (*this); + this->thread_pool_.set (*this); + this->thread_pool_lane_.set (*this); + } return err_index == -1 ? 0 : 1; } @@ -78,11 +81,11 @@ TAO_NS_QoSProperties::init (const CosNotification::PropertySeq& prop_seq, CosNot int TAO_NS_QoSProperties::copy (TAO_NS_QoSProperties& qos_properties) { - qos_properties.priority_ = this->priority_; - qos_properties.timeout_ = this->timeout_; - qos_properties.stop_time_supported_ = this->stop_time_supported_; - qos_properties.maximum_batch_size_ = this->maximum_batch_size_; - qos_properties.pacing_interval_ = this->pacing_interval_; + qos_properties.priority_ = this->priority_.value (); + qos_properties.timeout_ = this->timeout_.value (); + qos_properties.stop_time_supported_ = this->stop_time_supported_.value (); + qos_properties.maximum_batch_size_ = this->maximum_batch_size_.value (); + qos_properties.pacing_interval_ = this->pacing_interval_.value (); PROPERTY_MAP::ITERATOR iter (this->property_map_); PROPERTY_MAP::ENTRY *entry; diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.cpp b/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.cpp index 8517b21bd75..1d7c3eeffbd 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.cpp @@ -26,4 +26,106 @@ TAO_NS_RT_Factory::create (TAO_NS_StructuredProxyPushSupplier*& proxy ACE_ENV_AR CORBA::NO_MEMORY ()); } -ACE_FACTORY_DEFINE (TAO_Notify, TAO_NS_RT_Factory) +void +TAO_NS_RT_Factory:: create (TAO_NS_ProxySupplier_Collection*& collection ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_ProxyConsumer_Collection*& collection ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_EventChannel_Collection*& collection ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_ConsumerAdmin_Collection*& collection ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_SupplierAdmin_Collection*& collection ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_Proxy_Collection*& collection ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (collection ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_EventChannelFactory*& channel_factory ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (channel_factory ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_EventChannel*& channel ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (channel ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_SupplierAdmin*& admin ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (admin ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_ConsumerAdmin*& admin ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (admin ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_CosEC_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_CosEC_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_StructuredProxyPushConsumer*& proxy ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_SequenceProxyPushConsumer*& proxy ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_RT_Factory:: create (TAO_NS_SequenceProxyPushSupplier*& proxy ACE_ENV_ARG_DECL) +{ + TAO_NS_Default_Factory::create (proxy ACE_ENV_ARG_PARAMETER); +} + +ACE_FACTORY_DEFINE (TAO_RT_Notify, TAO_NS_RT_Factory) diff --git a/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.h b/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.h index f447f01f0ca..852d1b1d71c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.h +++ b/TAO/orbsvcs/orbsvcs/Notify/RT_Factory.h @@ -36,11 +36,62 @@ public: /// Destructor virtual ~TAO_NS_RT_Factory (); + /// Create ProxySupplier Collection + virtual void create (TAO_NS_ProxySupplier_Collection*& collection ACE_ENV_ARG_DECL); + + /// Create ProxyConsumer Collection + virtual void create (TAO_NS_ProxyConsumer_Collection*& collection ACE_ENV_ARG_DECL); + + /// Create EventChannel Collection + virtual void create (TAO_NS_EventChannel_Collection*& collection ACE_ENV_ARG_DECL); + + /// Create ConsumerAdmin Collection + virtual void create (TAO_NS_ConsumerAdmin_Collection*& collection ACE_ENV_ARG_DECL); + + /// Create SupplierAdmin Collection + virtual void create (TAO_NS_SupplierAdmin_Collection*& collection ACE_ENV_ARG_DECL); + + /// Create Proxy Collection + virtual void create (TAO_NS_Proxy_Collection*& collection ACE_ENV_ARG_DECL); + + /// Create EventChannelDefault_Factory + virtual void create (TAO_NS_EventChannelFactory*& channel_factory ACE_ENV_ARG_DECL); + + /// Create EventChannel + virtual void create (TAO_NS_EventChannel*& channel ACE_ENV_ARG_DECL); + + /// Create SupplierAdmin + virtual void create (TAO_NS_SupplierAdmin*& admin ACE_ENV_ARG_DECL); + + /// Create ConsumerAdmin + virtual void create (TAO_NS_ConsumerAdmin*& admin ACE_ENV_ARG_DECL); + + /// Create ProxyPushConsumer + virtual void create (TAO_NS_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL); + + /// Create ProxyPushSupplier + virtual void create (TAO_NS_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL); + + /// Create CosEC_ProxyPushConsumer + virtual void create (TAO_NS_CosEC_ProxyPushConsumer*& proxy ACE_ENV_ARG_DECL); + + /// Create CosEC_ProxyPushSupplier + virtual void create (TAO_NS_CosEC_ProxyPushSupplier*& proxy ACE_ENV_ARG_DECL); + + /// Create StructuredProxyPushConsumer + virtual void create (TAO_NS_StructuredProxyPushConsumer*& proxy ACE_ENV_ARG_DECL); + /// Create StructuredProxyPushSupplier virtual void create (TAO_NS_StructuredProxyPushSupplier*& proxy ACE_ENV_ARG_DECL); + + /// Create SequenceProxyPushConsumer + virtual void create (TAO_NS_SequenceProxyPushConsumer*& proxy ACE_ENV_ARG_DECL); + + /// Create SequenceProxyPushSupplier + virtual void create (TAO_NS_SequenceProxyPushSupplier*& proxy ACE_ENV_ARG_DECL); }; -ACE_FACTORY_DECLARE (TAO_Notify, TAO_NS_RT_Factory) +ACE_FACTORY_DECLARE (TAO_RT_Notify, TAO_NS_RT_Factory) #if defined (__ACE_INLINE__) #include "RT_Factory.inl" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.cpp b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.cpp index 705ebf295f9..3355a84b4be 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.cpp @@ -6,7 +6,7 @@ #include "Reactive_Task.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Reactive_Task, "$Id$") +ACE_RCSID(Notify, TAO_NS_Reactive_Task, "$Id$") #include "Timer_Reactor.h" @@ -40,7 +40,7 @@ TAO_NS_Reactive_Task::shutdown (void) } void -TAO_NS_Reactive_Task::exec (TAO_NS_Method_Request& method_request) +TAO_NS_Reactive_Task::execute (TAO_NS_Method_Request_No_Copy& method_request ACE_ENV_ARG_DECL) { ACE_DECLARE_NEW_CORBA_ENV; method_request.execute (ACE_ENV_SINGLE_ARG_PARAMETER); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.h b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.h index 98d77a6c39c..adb64d1f78a 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Reactive_Task.h @@ -49,7 +49,7 @@ public: virtual void shutdown (void); /// Exec the request. - virtual void exec (TAO_NS_Method_Request& method_request); + virtual void execute (TAO_NS_Method_Request_No_Copy& method_request ACE_ENV_ARG_DECL); /// The object used by clients to register timers. This method returns a Reactor based Timer. virtual TAO_NS_Timer* timer (void); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable.cpp b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.cpp index a5c277a611d..ee2d7a24513 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Refcountable.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.cpp @@ -8,7 +8,7 @@ #include "Refcountable.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Refcountable, "$Id$") +ACE_RCSID(Notify, TAO_NS_Refcountable, "$Id$") TAO_NS_Refcountable::TAO_NS_Refcountable (void) :refcount_ (1) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable.h b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.h index 77a45cd16fa..d01a49b347f 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Refcountable.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.h @@ -53,26 +53,6 @@ protected: TAO_SYNCH_MUTEX lock_; }; -/***********************************************************************/ - -/** - * @class TAO_NS_Refcountable_Guard - * - * @brief Ref. Count Guard - * Increments the reference count in the constructor, the count is decremented when the guard's is destructor. - * - */ -class TAO_Notify_Export TAO_NS_Refcountable_Guard -{ -public: - TAO_NS_Refcountable_Guard (TAO_NS_Refcountable& refcountable); - - ~TAO_NS_Refcountable_Guard (); - -protected: - TAO_NS_Refcountable& refcountable_; -}; - #if defined (__ACE_INLINE__) #include "Refcountable.inl" #endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable.inl b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.inl index be75f075cd8..74e88caa0c5 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Refcountable.inl +++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable.inl @@ -1,14 +1,2 @@ // $Id$ -ACE_INLINE -TAO_NS_Refcountable_Guard::TAO_NS_Refcountable_Guard (TAO_NS_Refcountable& refcountable) - :refcountable_ (refcountable) -{ - this->refcountable_._incr_refcnt (); -} - -ACE_INLINE -TAO_NS_Refcountable_Guard::~TAO_NS_Refcountable_Guard () -{ - this->refcountable_._decr_refcnt (); -} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.cpp new file mode 100644 index 00000000000..9af293e7bfa --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.cpp @@ -0,0 +1,14 @@ +// $Id$ + +#ifndef TAO_NS_REFCOUNTABLE_GUARD_T_CPP +#define TAO_NS_REFCOUNTABLE_GUARD_T_CPP + +#include "Refcountable_Guard_T.h" + +#if ! defined (__ACE_INLINE__) +#include "Refcountable_Guard_T.inl" +#endif /* __ACE_INLINE__ */ + +ACE_RCSID(Notify, TAO_NS_Refcountable_Guard_T, "$id$") + +#endif /* TAO_NS_REFCOUNTABLE_GUARD_T_CPP */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h new file mode 100644 index 00000000000..22af0962291 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.h @@ -0,0 +1,60 @@ +/* -*- C++ -*- */ +/** + * @file Refcountable_Guard_T.h + * + * $Id$ + * + * @author Pradeep Gore <pradeep@oomworks.com> + * + * + */ + +#ifndef TAO_NS_REFCOUNTABLE_GUARD_T_H +#define TAO_NS_REFCOUNTABLE_GUARD_T_H +#include "ace/pre.h" + +#include "notify_export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +/** + * @class TAO_NS_Refcountable_Guard_T + * + * @brief Increments the reference count in the constructor, the count is decremented in the destructor. + * + */ +template <class T> +class TAO_NS_Refcountable_Guard_T +{ +public: + /// Constuctor + TAO_NS_Refcountable_Guard_T (T* t); + + /// Destructor + ~TAO_NS_Refcountable_Guard_T (); + + /// Redirection operator + T *operator-> (void) const; + + T &operator *() const; + +private: + T* t_; +}; + +#if defined (__ACE_INLINE__) +#include "Refcountable_Guard_T.inl" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "Refcountable_Guard_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("Refcountable_Guard_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#include "ace/post.h" +#endif /* TAO_NS_REFCOUNTABLE_GUARD_T_H */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl new file mode 100644 index 00000000000..2e11b1ff701 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Notify/Refcountable_Guard_T.inl @@ -0,0 +1,26 @@ +// $Id$ + +template <class T> ACE_INLINE +TAO_NS_Refcountable_Guard_T<T>::TAO_NS_Refcountable_Guard_T (T *t) + : t_ (t) +{ + this->t_->_incr_refcnt (); +} + +template <class T> ACE_INLINE +TAO_NS_Refcountable_Guard_T<T>::~TAO_NS_Refcountable_Guard_T () +{ + this->t_->_decr_refcnt (); +} + +template <class T> ACE_INLINE T* +TAO_NS_Refcountable_Guard_T<T>::operator-> (void) const +{ + return this->t_; +} + +template <class T> ACE_INLINE T& +TAO_NS_Refcountable_Guard_T<T>::operator *(void) const +{ + return *this->t_; +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.cpp b/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.cpp index ee07eaf1a54..ff6dade8f40 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Seq_Worker_T.cpp @@ -9,7 +9,7 @@ #include "Seq_Worker_T.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Seq_Worker_T, "$id$") +ACE_RCSID(Notify, TAO_NS_Seq_Worker_T, "$Id$") template <class T> TAO_NS_Seq_Worker_T<T>::TAO_NS_Seq_Worker_T (void) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/Batch_Buffering_Strategy.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/Batch_Buffering_Strategy.cpp index 1c819aa54ba..fd9aef09f34 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/Batch_Buffering_Strategy.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/Batch_Buffering_Strategy.cpp @@ -1,6 +1,7 @@ // $Id$ #include "Batch_Buffering_Strategy.h" +#include "../Method_Request_Event.h" #if ! defined (__ACE_INLINE__) #include "Batch_Buffering_Strategy.inl" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.cpp index c1b7ea4bdfa..83a40e6fb20 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequenceProxyPushConsumer.cpp @@ -11,6 +11,8 @@ ACE_RCSID(Notify, TAO_NS_SequenceProxyPushConsumer, "$id$") #include "tao/debug.h" #include "SequencePushSupplier.h" #include "../AdminProperties.h" +#include "../Method_Request_Lookup.h" +#include "../Worker_Task.h" #include "../Structured/StructuredEvent.h" TAO_NS_SequenceProxyPushConsumer::TAO_NS_SequenceProxyPushConsumer (void) @@ -92,9 +94,11 @@ TAO_NS_SequenceProxyPushConsumer::push_structured_events (const CosNotification: { const CosNotification::StructuredEvent& notification = event_batch[i]; - TAO_NS_Event_var event (new TAO_NS_StructuredEvent (notification)); + TAO_NS_StructuredEvent_No_Copy event (notification); - this->push (event); + TAO_NS_Method_Request_Lookup_No_Copy request (&event, this); + + this->worker_task ()->execute (request ACE_ENV_ARG_DECL); } } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp index 36abbc2ba37..73249688e24 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.cpp @@ -14,8 +14,9 @@ ACE_RCSID(Notify, TAO_NS_SequencePushConsumer, "$id$") #include "../ProxySupplier.h" #include "../Worker_Task.h" #include "../Consumer.h" -#include "../Method_Request.h" +#include "../Method_Request_Event.h" #include "../Timer.h" +#include "../Proxy.h" TAO_NS_SequencePushConsumer::TAO_NS_SequencePushConsumer (TAO_NS_ProxySupplier* proxy) : TAO_NS_Consumer (proxy), pacing_interval_ (ACE_Time_Value::zero), timer_id_ (-1), buffering_strategy_ (0), @@ -60,7 +61,7 @@ TAO_NS_SequencePushConsumer::release (void) void TAO_NS_SequencePushConsumer::qos_changed (const TAO_NS_QoSProperties& qos_properties) { - this->max_batch_size_ = qos_properties.maximum_batch_size (); + this->max_batch_size_ = qos_properties.maximum_batch_size ().value (); if (this->max_batch_size_.is_valid ()) {// set the max batch size. @@ -103,9 +104,24 @@ TAO_NS_SequencePushConsumer::cancel_timer (void) } void -TAO_NS_SequencePushConsumer::push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL_NOT_USED) +TAO_NS_SequencePushConsumer::push_i (const TAO_NS_Event* event ACE_ENV_ARG_DECL) { - TAO_NS_Method_Request_Event* method_request = new TAO_NS_Method_Request_Event (event); + TAO_NS_Event* copy = event->copy (ACE_ENV_SINGLE_ARG_PARAMETER); + ACE_CHECK; + + TAO_NS_Event_Copy_var copy_var (copy); + + this->push_i (copy_var ACE_ENV_ARG_PARAMETER); +} + +void +TAO_NS_SequencePushConsumer::push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL) +{ + TAO_NS_Method_Request_Event* method_request; + + ACE_NEW_THROW_EX (method_request, + TAO_NS_Method_Request_Event (event), + CORBA::NO_MEMORY ()); int msg_count = this->buffering_strategy_->enqueue (*method_request); @@ -150,7 +166,7 @@ TAO_NS_SequencePushConsumer::handle_timeout (const ACE_Time_Value& /*current_tim if (deq_count > 0) { - TAO_NS_Refcountable_Guard ref_guard(*this->proxy ()); // Protect this object from being destroyed in this scope. + TAO_NS_Proxy_Guard ref_guard(this->proxy ()); // Protect this object from being destroyed in this scope. this->push (event_batch); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h index cc7f689b6ac..3a825d974a1 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Sequence/SequencePushConsumer.h @@ -56,7 +56,9 @@ public: virtual void release (void); /// Push <event> to this consumer. - void push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); + virtual void push_i (const TAO_NS_Event* event ACE_ENV_ARG_DECL); + + virtual void push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); /// Push <event> to this consumer. virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Service.h b/TAO/orbsvcs/orbsvcs/Notify/Service.h index a6848386f76..70c5548d89d 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Service.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Service.h @@ -21,6 +21,7 @@ #include "ace/Service_Object.h" #include "ace/Service_Config.h" +#include "ace/Service_Object.h" #include "orbsvcs/CosNotifyChannelAdminS.h" #include "tao/PortableServer/PortableServer.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.cpp index 1129cf9c763..04483e66f96 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.cpp @@ -19,7 +19,7 @@ TAO_NS_RT_StructuredProxyPushSupplier::~TAO_NS_RT_StructuredProxyPushSupplier () CORBA::Object_ptr TAO_NS_RT_StructuredProxyPushSupplier::activate (PortableServer::Servant servant ACE_ENV_ARG_DECL) { - CORBA::Object_var object = TAO_NS_Proxy::activate (servant ACE_ENV_ARG_DECL); + CORBA::Object_var object = TAO_NS_Proxy::activate (servant ACE_ENV_ARG_PARAMETER); ACE_CHECK_RETURN (CORBA::Object::_nil ()); // Obtain our ref. @@ -32,13 +32,51 @@ TAO_NS_RT_StructuredProxyPushSupplier::activate (PortableServer::Servant servant } void -TAO_NS_RT_StructuredProxyPushSupplier::push (const TAO_NS_Event_var &event) +TAO_NS_RT_StructuredProxyPushSupplier::push (const TAO_NS_Event* event ACE_ENV_ARG_DECL) { - event->push (this->event_forwarder_.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_NEW_ENV + { + event->push (this->event_forwarder_.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + if (TAO_debug_level > 2) + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "(%P|%t) TAO_NS_RT_StructuredProxyPushSupplier::push failed\n"); + } + + } + ACE_ENDTRY; +} + +void +TAO_NS_RT_StructuredProxyPushSupplier::push_no_filtering (const TAO_NS_Event* event ACE_ENV_ARG_DECL) +{ + ACE_TRY_NEW_ENV + { + event->push_no_filtering (this->event_forwarder_.in () ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHANY + { + if (TAO_debug_level > 2) + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, "(%P|%t) TAO_NS_RT_StructuredProxyPushSupplier::push failed\n"); + } + + } + ACE_ENDTRY; +} + +void +TAO_NS_RT_StructuredProxyPushSupplier::push (const TAO_NS_Event_var &event ACE_ENV_ARG_DECL) +{ + this->push (event.get () ACE_ENV_ARG_PARAMETER); } void -TAO_NS_RT_StructuredProxyPushSupplier::push_no_filtering (const TAO_NS_Event_var &event) +TAO_NS_RT_StructuredProxyPushSupplier::push_no_filtering (const TAO_NS_Event_var &event ACE_ENV_ARG_DECL) { - event->push_no_filtering (this->event_forwarder_.in () ACE_ENV_ARG_PARAMETER); + this->push_no_filtering (event.get () ACE_ENV_ARG_PARAMETER); } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h index a183a8193c7..b3516b05ce3 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/RT_StructuredProxyPushSupplier.h @@ -39,11 +39,17 @@ public: /// Activate this object and obtain the Event_Forwarder interface. virtual CORBA::Object_ptr activate (PortableServer::Servant servant ACE_ENV_ARG_DECL); - /// Override TAO_NS_ProxySupplier::push - virtual void push (const TAO_NS_Event_var &event); + /// Dispatch Event to consumer + virtual void push (const TAO_NS_Event* event ACE_ENV_ARG_DECL); + + /// Dispatch Event to consumer + virtual void push (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); + + /// Dispatch Event to consumer, no filtering + virtual void push_no_filtering (const TAO_NS_Event* event ACE_ENV_ARG_DECL); /// Dispatch Event to consumer, no filtering - virtual void push_no_filtering (const TAO_NS_Event_var &event); + virtual void push_no_filtering (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); private: /// Our ref. diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp index f971a8eb1d9..b12fc8978e2 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.cpp @@ -12,82 +12,110 @@ ACE_RCSID(RT_Notify, TAO_NS_StructuredEvent, "$Id$") #include "../Consumer.h" #include "tao/debug.h" -TAO_NS_StructuredEvent::TAO_NS_StructuredEvent (const CosNotification::StructuredEvent ¬ification) - : notification_ (notification), type_ (notification.header.fixed_header.event_type) +TAO_NS_StructuredEvent_No_Copy::TAO_NS_StructuredEvent_No_Copy (const CosNotification::StructuredEvent ¬ification) + : notification_ (¬ification), type_ (notification.header.fixed_header.event_type) { - TAO_NS_PropertySeq qos; - - if (qos.init (this->notification_.header.variable_header) != -1) - { - this->priority_.set (qos); - this->timeout_.set (qos); - } + const CosNotification::PropertySeq& prop_seq = notification.header.variable_header; + + for (CORBA::ULong i = 0; i < prop_seq.length (); ++i) + { + if (ACE_OS::strcmp (prop_seq[i].name.in (), CosNotification::Priority) == 0) + this->priority_.set (prop_seq[i].value); + else if (ACE_OS::strcmp (prop_seq[i].name.in (), CosNotification::Timeout) == 0) + this->timeout_.set (prop_seq[i].value); + } } const TAO_NS_EventType& -TAO_NS_StructuredEvent::type (void) const +TAO_NS_StructuredEvent_No_Copy::type (void) const { return this->type_; } -TAO_NS_StructuredEvent::~TAO_NS_StructuredEvent () +TAO_NS_StructuredEvent_No_Copy::~TAO_NS_StructuredEvent_No_Copy () +{ +} + +TAO_NS_Event* +TAO_NS_StructuredEvent_No_Copy::copy (ACE_ENV_SINGLE_ARG_DECL) const { + TAO_NS_Event* copy; + + ACE_NEW_THROW_EX (copy, + TAO_NS_StructuredEvent (*this->notification_), + CORBA::NO_MEMORY ()); + + return copy; } CORBA::Boolean -TAO_NS_StructuredEvent::do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) +TAO_NS_StructuredEvent_No_Copy::do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - " "TAO_Notify_StructuredEvent::do_match ()\n")); - return filter->match_structured (this->notification_ ACE_ENV_ARG_PARAMETER); + return filter->match_structured (*this->notification_ ACE_ENV_ARG_PARAMETER); } void -TAO_NS_StructuredEvent::convert (CosNotification::StructuredEvent& notification) +TAO_NS_StructuredEvent_No_Copy::convert (CosNotification::StructuredEvent& notification) const { - notification = this->notification_; + notification = *this->notification_; } void -TAO_NS_StructuredEvent::push (TAO_NS_Consumer* consumer ACE_ENV_ARG_DECL) const +TAO_NS_StructuredEvent_No_Copy::push (TAO_NS_Consumer* consumer ACE_ENV_ARG_DECL) const { if (TAO_debug_level > 0) ACE_DEBUG ((LM_DEBUG, "Notify (%P|%t) - " "TAO_Notify_StructuredEvent::do_push (" "CosNotifyComm::StructuredPushConsumer_ptr)\n")); - consumer->push (notification_ ACE_ENV_ARG_PARAMETER); + consumer->push (*this->notification_ ACE_ENV_ARG_PARAMETER); } void -TAO_NS_StructuredEvent::push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) +TAO_NS_StructuredEvent_No_Copy::push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const { - forwarder->forward_structured (notification_ ACE_ENV_ARG_PARAMETER); + forwarder->forward_structured (*this->notification_ ACE_ENV_ARG_PARAMETER); } + void -TAO_NS_StructuredEvent::push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) +TAO_NS_StructuredEvent_No_Copy::push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const { - forwarder->forward_structured_no_filtering (notification_ ACE_ENV_ARG_PARAMETER); + forwarder->forward_structured_no_filtering (*this->notification_ ACE_ENV_ARG_PARAMETER); } void -TAO_NS_StructuredEvent::push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) +TAO_NS_StructuredEvent_No_Copy::push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const { CORBA::Any any; - TAO_NS_Event::translate (this->notification_, any); + TAO_NS_Event::translate (*this->notification_, any); forwarder->forward_any (any ACE_ENV_ARG_PARAMETER); } void -TAO_NS_StructuredEvent::push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) +TAO_NS_StructuredEvent_No_Copy::push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const { CORBA::Any any; - TAO_NS_Event::translate (this->notification_, any); + TAO_NS_Event::translate (*this->notification_, any); forwarder->forward_any_no_filtering (any ACE_ENV_ARG_PARAMETER); } + +/*****************************************************************************************************/ + +TAO_NS_StructuredEvent::TAO_NS_StructuredEvent (const CosNotification::StructuredEvent& notification) + : TAO_NS_StructuredEvent_No_Copy (notification) + , notification_copy (notification) +{ + this->notification_ = ¬ification_copy; +} + +TAO_NS_StructuredEvent::~TAO_NS_StructuredEvent () +{ +} diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h index 5cf88887188..175913c898c 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredEvent.h @@ -23,25 +23,28 @@ #include "orbsvcs/CosNotificationC.h" /** - * @class TAO_NS_StructuredEvent + * @class TAO_NS_StructuredEvent_No_Copy * * @brief StructuredEvent implementation. * */ -class TAO_Notify_Export TAO_NS_StructuredEvent : public TAO_NS_Event +class TAO_Notify_Export TAO_NS_StructuredEvent_No_Copy : public TAO_NS_Event { public: /// Constuctor - TAO_NS_StructuredEvent (const CosNotification::StructuredEvent& notification); + TAO_NS_StructuredEvent_No_Copy (const CosNotification::StructuredEvent& notification); /// Destructor - ~TAO_NS_StructuredEvent (); + ~TAO_NS_StructuredEvent_No_Copy (); - CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL); + /// Copy the event. + virtual TAO_NS_Event* copy (ACE_ENV_SINGLE_ARG_DECL) const; + + CORBA::Boolean do_match (CosNotifyFilter::Filter_ptr filter ACE_ENV_ARG_DECL) const; /// Convert to CosNotification::Structured type - virtual void convert (CosNotification::StructuredEvent& notification); + virtual void convert (CosNotification::StructuredEvent& notification) const; /// Get the event type. virtual const TAO_NS_EventType& type (void) const; @@ -50,25 +53,47 @@ public: virtual void push (TAO_NS_Consumer* consumer ACE_ENV_ARG_DECL) const; /// Push event to the Event_Forwarder interface - virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL); + virtual void push (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; /// Push event to the Event_Forwarder interface - virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL); + virtual void push_no_filtering (Event_Forwarder::StructuredProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; /// Push event to the Event_Forwarder interface - virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL); + virtual void push (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; /// Push event to the Event_Forwarder interface - virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL); + virtual void push_no_filtering (Event_Forwarder::ProxyPushSupplier_ptr forwarder ACE_ENV_ARG_DECL) const; protected: /// Structured Event - CosNotification::StructuredEvent notification_; + const CosNotification::StructuredEvent* notification_; /// Our type. const TAO_NS_EventType type_; }; +/*****************************************************************************************************/ + +/** + * @class TAO_NS_StructuredEvent + * + * @brief StructuredEvent implementation. + * + */ +class TAO_Notify_Export TAO_NS_StructuredEvent : public TAO_NS_StructuredEvent_No_Copy +{ +public: + /// Constuctor + TAO_NS_StructuredEvent (const CosNotification::StructuredEvent& notification); + + /// Destructor + ~TAO_NS_StructuredEvent (); + +protected: + /// Copy of the Event. + CosNotification::StructuredEvent notification_copy; +}; + #if defined (__ACE_INLINE__) #include "StructuredEvent.inl" #endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp index 858f2f518ef..77a0edd3e85 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredProxyPushConsumer.cpp @@ -14,6 +14,9 @@ ACE_RCSID(RT_Notify, TAO_NS_StructuredProxyPushConsumer, "$Id$") #include "StructuredPushSupplier.h" #include "StructuredEvent.h" #include "../AdminProperties.h" +#include "../Method_Request_Lookup.h" +#include "../Worker_Task.h" +#include "c:/Program Files/Rational/Quantify/pure.h" TAO_NS_StructuredProxyPushConsumer::TAO_NS_StructuredProxyPushConsumer (void) { @@ -80,6 +83,18 @@ TAO_NS_StructuredProxyPushConsumer::push_structured_event (const CosNotification , CosEventComm::Disconnected )) { + static int quantify_started = 0; + + if (!quantify_started) + { + // Reset Quantify data recording; whatever happened in the past + // is not relevant to this test. + QuantifyClearData (); + quantify_started = 1; + } + + QuantifyStartRecordingData (); + // Check if we should proceed at all. if (this->admin_properties_->reject_new_events () == 1 && this->admin_properties_->queue_full ()) @@ -90,11 +105,13 @@ TAO_NS_StructuredProxyPushConsumer::push_structured_event (const CosNotification ACE_THROW (CosEventComm::Disconnected ()); } - // Convert - TAO_NS_Event_var event (new TAO_NS_StructuredEvent (notification)); + TAO_NS_StructuredEvent_No_Copy event (notification); + + TAO_NS_Method_Request_Lookup_No_Copy request (&event, this); + + this->worker_task ()->execute (request ACE_ENV_ARG_DECL); - // Continue processing. - this->push (event); + QuantifyStopRecordingData (); } void diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp index e868de67b00..2ac77c83b02 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.cpp @@ -2,6 +2,7 @@ #include "StructuredPushConsumer.h" #include "ace/Refcounted_Auto_Ptr.h" #include "../Event.h" +#include "c:/Program Files/Rational/Quantify/pure.h" #if ! defined (__ACE_INLINE__) #include "StructuredPushConsumer.inl" @@ -35,6 +36,12 @@ TAO_NS_StructuredPushConsumer::release (void) } void +TAO_NS_StructuredPushConsumer::push_i (const TAO_NS_Event* event ACE_ENV_ARG_DECL) +{ + event->push (this ACE_ENV_ARG_PARAMETER); +} + +void TAO_NS_StructuredPushConsumer::push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL) { event->push (this ACE_ENV_ARG_PARAMETER); @@ -53,5 +60,7 @@ TAO_NS_StructuredPushConsumer::push (const CORBA::Any& event ACE_ENV_ARG_DECL) void TAO_NS_StructuredPushConsumer::push (const CosNotification::StructuredEvent& event ACE_ENV_ARG_DECL) { + QuantifyStopRecordingData (); this->push_consumer_->push_structured_event (event ACE_ENV_ARG_PARAMETER); + QuantifyStartRecordingData (); } diff --git a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h index 28fb81439da..d0e950a34c5 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Structured/StructuredPushConsumer.h @@ -46,7 +46,10 @@ public: virtual void release (void); /// Push <event> to this consumer. - void push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); + virtual void push_i (const TAO_NS_Event* event ACE_ENV_ARG_DECL); + + /// Push <event> to this consumer. + virtual void push_i (const TAO_NS_Event_var& event ACE_ENV_ARG_DECL); /// Push <event> to this consumer. virtual void push (const CORBA::Any& event ACE_ENV_ARG_DECL); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.cpp b/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.cpp index 12210af6fc4..0bb764718c6 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Subscription_Change_Worker.cpp @@ -6,7 +6,7 @@ #include "Subscription_Change_Worker.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_Subscription_Change_Worker, "$id$") +ACE_RCSID(Notify, TAO_Subscription_Change_Worker, "$Id$") TAO_NS_Subscription_Change_Worker::TAO_NS_Subscription_Change_Worker (const CosNotification::EventTypeSeq & added, const CosNotification::EventTypeSeq & removed) :added_ (added), removed_ (removed) diff --git a/TAO/orbsvcs/orbsvcs/Notify/Supplier.cpp b/TAO/orbsvcs/orbsvcs/Notify/Supplier.cpp index f03f91207e2..848e9d804b6 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Supplier.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Supplier.cpp @@ -6,7 +6,7 @@ #include "Supplier.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Supplier, "$Id$") +ACE_RCSID(Notify, TAO_NS_Supplier, "$Id$") #include "ProxyConsumer.h" #include "Proxy.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.cpp b/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.cpp index aa6e7bca21d..fc7d19ac6fc 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.cpp @@ -121,7 +121,7 @@ CosNotifyChannelAdmin::ProxyConsumer_ptr TAO_NS_SupplierAdmin::obtain_notification_push_consumer_with_qos (CosNotifyChannelAdmin::ClientType ctype, CosNotifyChannelAdmin::ProxyID_out proxy_id, const CosNotification::QoSProperties & initial_qos - ACE_ENV_ARG_DECL_WITH_DEFAULTS + ACE_ENV_ARG_DECL ) ACE_THROW_SPEC (( CORBA::SystemException diff --git a/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.h b/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.h index 90ace4712ff..bd42ff139a6 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.h +++ b/TAO/orbsvcs/orbsvcs/Notify/SupplierAdmin.h @@ -62,7 +62,7 @@ protected: obtain_notification_push_consumer_with_qos (CosNotifyChannelAdmin::ClientType ctype, CosNotifyChannelAdmin::ProxyID_out proxy_id, const CosNotification::QoSProperties & initial_qos - ACE_ENV_ARG_DECL_WITH_DEFAULTS + ACE_ENV_ARG_DECL ) ACE_THROW_SPEC (( CORBA::SystemException diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp index 5829dd3348e..bc643f11b68 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.cpp @@ -6,9 +6,10 @@ #include "ThreadPool_Task.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_ThreadPool_Task, "$Id$") +ACE_RCSID(Notify, TAO_NS_ThreadPool_Task, "$Id$") #include "tao/debug.h" +#include "tao/ORB_Core.h" #include "Properties.h" #include "Timer_Queue.h" @@ -51,9 +52,11 @@ TAO_NS_ThreadPool_Task::init (const NotifyExt::ThreadPoolParams& tp_params, TAO_ long flags = THR_NEW_LWP | THR_JOINABLE; + CORBA::ORB_var orb = + TAO_NS_PROPERTIES::instance()->orb (); + flags |= - TAO_NS_PROPERTIES::instance()->scope_policy () | - TAO_NS_PROPERTIES::instance()->sched_policy (); + orb->orb_core ()->orb_params ()->thread_creation_flags (); // Increment the count on this object by the number of threads using it. { @@ -92,9 +95,9 @@ TAO_NS_ThreadPool_Task::init (const NotifyExt::ThreadPoolParams& tp_params, TAO_ } void -TAO_NS_ThreadPool_Task::exec (TAO_NS_Method_Request& method_request) +TAO_NS_ThreadPool_Task::execute (TAO_NS_Method_Request_No_Copy& method_request ACE_ENV_ARG_DECL) { - TAO_NS_Method_Request& request_copy = *method_request.copy (); + TAO_NS_Method_Request& request_copy = *method_request.copy (ACE_ENV_SINGLE_ARG_PARAMETER); if (this->buffering_strategy_->enqueue (request_copy) == -1) { diff --git a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h index 88c6b33462f..46ea7570770 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h +++ b/TAO/orbsvcs/orbsvcs/Notify/ThreadPool_Task.h @@ -57,7 +57,7 @@ public: void init (const NotifyExt::ThreadPoolParams& tp_params, TAO_NS_AdminProperties_var& admin_properties ACE_ENV_ARG_DECL); /// Queue the request - virtual void exec (TAO_NS_Method_Request& method_request); + virtual void execute (TAO_NS_Method_Request_No_Copy& method_request ACE_ENV_ARG_DECL); /// Shutdown task virtual void shutdown (void); diff --git a/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.cpp b/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.cpp index 41709be90df..39c4ec55cf6 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Timer_Reactor.cpp @@ -6,7 +6,7 @@ #include "Timer_Reactor.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(Notify, TAO_NS_Timer_Reactor, "$id$") +ACE_RCSID(Notify, TAO_NS_Timer_Reactor, "$Id$") #include "ace/Reactor.h" #include "tao/ORB_Core.h" diff --git a/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.cpp b/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.cpp index ae9f9efab55..317d4fc3c3b 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.cpp @@ -6,7 +6,7 @@ #include "Worker_Task.inl" #endif /* __ACE_INLINE__ */ -ACE_RCSID(RT_Notify, TAO_NS_Worker_Task, "$Id$") +ACE_RCSID(Notify, TAO_NS_Worker_Task, "$Id$") TAO_NS_Worker_Task::TAO_NS_Worker_Task (void) { diff --git a/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.h b/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.h index 2eef3710451..082994f3511 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.h +++ b/TAO/orbsvcs/orbsvcs/Notify/Worker_Task.h @@ -47,7 +47,7 @@ public: ///= Public method to be implemented by subclasses. /// Exec the request. - virtual void exec (TAO_NS_Method_Request& method_request) = 0; + virtual void execute (TAO_NS_Method_Request_No_Copy& method_request ACE_ENV_ARG_DECL) = 0; /// Shutdown task virtual void shutdown (void) = 0; |