Ticket #279 (accepted Enhancement)

Opened 8 years ago

Last modified 7 years ago

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.

Change History

comment:1 Changed 8 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 8 years ago by jri

  • Summary changed from Core: event filtering through listener method annotations to Core: topic event filtering through listener method annotations

comment:3 Changed 8 years ago by jri

  • Milestone changed from Release 4.1 to Release 4.2

comment:4 Changed 7 years ago by jri

  • Milestone Release 4.2 deleted
Note: See TracTickets for help on using tickets.