diff options
Diffstat (limited to 'TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp')
-rw-r--r-- | TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp b/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp index 886ae0b6145..96701da9693 100644 --- a/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp +++ b/TAO/orbsvcs/orbsvcs/Notify/Notify_Dispatcher.cpp @@ -3,6 +3,16 @@ #include "Notify_Dispatcher.h" #include "ace/CORBA_macros.h" #include "orbsvcs/orbsvcs/CosNotifyCommC.h" // i get some errors with env otherwise +#include "Notify_FilterAdmin_i.h" + +TAO_Notify_Dispatcher::TAO_Notify_Dispatcher (void) + :filter_admin_ (0) +{ +} + +TAO_Notify_Dispatcher::~TAO_Notify_Dispatcher () +{ +} TAO_Notify_Dispatcher* TAO_Notify_Dispatcher::create (CORBA::Environment &ACE_TRY_ENV) @@ -19,6 +29,12 @@ TAO_Notify_Dispatcher::create (CORBA::Environment &ACE_TRY_ENV) return dispatcher; } +void +TAO_Notify_Dispatcher::set_FilterAdmin (TAO_Notify_FilterAdmin_i* filter_admin) +{ + filter_admin_ = filter_admin; +} + int TAO_Notify_Dispatcher::add_dispatcher (TAO_Notify_Dispatcher& dispatcher) { @@ -48,3 +64,30 @@ Notify_Reactive_Dispatcher::dispatch_event (const CORBA::Any & data, ACE_CHECK; } } + +void +Notify_Reactive_Dispatcher::dispatch_event ( + const CosNotification::StructuredEvent& event, + CORBA::Environment &ACE_TRY_ENV) +{ + if (filter_admin_ != 0) + { + CORBA::Boolean truth = + filter_admin_->match_structured (event, ACE_TRY_ENV); + ACE_CHECK; + + if (truth == 0) + return; // don't propogate the event further out. + } + + DISPATCHER_SET_ITER iter (contained_); + TAO_Notify_Dispatcher **p_dispatcher; + + for (iter.first ();iter.done () != 1;iter.advance ()) + { + if (iter.next (p_dispatcher) == 0) + break; + (*p_dispatcher)->dispatch_event (event, ACE_TRY_ENV); + ACE_CHECK; + } +} |