Ticket #279 (accepted Enhancement)
Core: topic event filtering through listener method annotations
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Minor | Milestone: | |
Component: | DeepaMehta Standard Distribution | Version: | 4.0.11 |
Keywords: | Cc: | dgf | |
Complexity: | 5 | Area: | Application Framework / API |
Module: | deepamehta-core |
Description
In order to filter the topic related events a plugin developer might want to annotate the listener methods with a type filter, e.g.:
@TypeFilter("dm4.contacts.address") public void postCreateTopic(Topic topic, ...
The core would call that particular handler method only if the topic is of the specified type.
Advantages would be
a) the developer is freed from checking the type itself
b) the core would deliver less pointless events
The annotation would be optional. If not present all topics would pass.
Thanks, dgf, for coming up with that idea!
Note: the annotation approach could even be extended to the non-topic related events. E.g. the serviceArrived() handler could be annotated by the services it is interested in (and would make the "consumedServiceInterfaces" config property dispensable). This will be addressed in a separate ticket.