Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ecf-dev] Distributed EventAdmin Service

Hi,

The EVENT_FILTER supplied with an EventHandler is only evaluated on
event properties.
Roshan, this means in your example that the event you sent should have a
property "topic" with value "defaultTopic" to be delivered to the event
handler you described. I'd first verify this.
 
In addition to Scott's example:
EventConstants.EVENT_TOPIC can also be supplied directly to
event-handlers service registration properties. Like this:

Dictionary d = new Hashtable();
d.put(EventConstants.EVENT_TOPIC, topics );
d.put(EventConstants.EVENT_FILTER,
"(my_event_property=foo.*)" );
context.registerService( EventHandler.class.getName(), this, d );

Thanks, Philipp
BTW: I filed right now a bug / feature request on adding
EventConstants.EVENT_TOPIC evaluation to in DistributedEventAdmin
implementation (to make it spec compliant). 
That might be the cause for the problem you describing as well.

> -----Original Message-----
> From: ecf-dev-bounces@xxxxxxxxxxx [mailto:ecf-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Scott Lewis
> Sent: Tuesday, September 15, 2009 7:39 PM
> To: Eclipse Communication Framework (ECF) developer mailing list.
> Subject: Re: [ecf-dev] Distributed EventAdmin Service
> 
> Hi Roshan,
> 
> I've done some testing, and determined that the current EventAdmin
> filtering works fine/ok.  What was wrong with your EventHandler
service
> property is that the EVENT_FILTER creation should look like this:
> 
>         props.put(EventConstants.EVENT_FILTER,
> "("+EventConstants.EVENT_TOPIC+"="+topic+")");
> 
> with this way of defining the event filter the EventAdmin matching
> works
> just fine.
> 
> I've added this code to the example
> (org.eclipse.ecf.examples.eventadmin.app), and will include something
> like it in the test case.
> 
> Thanks,
> 
> Scott
> 
> 
> roshan joseph wrote:
> > Hi,
> >  Could someone let me know whether the distributed eventadmin
service
> > support filters?
> >
> > I was trying to add a filter condition to the eventhandler code in
> the
> > properties object, but the event handler is found no response to the
> > filter.
> >
> > In the testeventhandler code I have added another line like
> > dictionary.put(EventConstants.EVENT_FILTER,"(topic=defaultTopic)");
> >
> > before registering the eventhandler. Events with different topic
> names
> > are also processed by the handler.
> >
> > Really appreciate all help in advance.
> >
> > Thanks & Regards,
> > Roshan
> >
> >
> >
> >
---------------------------------------------------------------------
> ---
> >
> > _______________________________________________
> > ecf-dev mailing list
> > ecf-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/ecf-dev
> >
> 
> _______________________________________________
> ecf-dev mailing list
> ecf-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ecf-dev


Back to the top