|Re: [ecf-dev] Distributed EventAdmin Service|
Hi Philipp and Roshan,In accord with the bug that Philipp created (i.e. https://bugs.eclipse.org/bugs/show_bug.cgi?id=289496 ) I've implemented the proper OSGi-specified behavior for the use of EVENT_TOPIC and EVENT_FILTER service properties (for EventHandler implementation).
This is all part of ECF HEAD currently, and so will only be a part of ECF 3.1 (not 3.0.1/Galileo maintenance release).
Scott Konradi, Philipp wrote:
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 DistributedEventAdminimplementation (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 EventHandlerserviceproperty 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 eventadminservicesupport filters? I was trying to add a filter condition to the eventhandler code intheproperties 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 topicnamesare 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_______________________________________________ ecf-dev mailing list ecf-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ecf-dev
Back to the top