Ticket #599 (closed Enhancement: fixed)
Core API: the ConsumesService annotation should be a class object (instead a String)
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Major | Milestone: | Release 4.4 |
Component: | DeepaMehta Standard Distribution | Version: | 4.1.3 |
Keywords: | Cc: | dgf, Malte, carolina | |
Complexity: | 3 | Area: | Application Framework / API |
Module: | deepamehta-core |
Description
In case of a typo error the developer would be signalized at compile time, instead of wondering why her plugin isn't activated although no error is reported.
Change History
comment:5 Changed 10 years ago by Jörg Richter
Core API: ConsumesService? args are classes (#599).
BREAKING CHANGE
The @ConsumesService? annotation takes class objects as argument (instead of strings).
This way malformed service specifications are detected early by the compiler
(instead of deploying the plugin and let it wait forever for a service never arriving).
Example (listening for 1 service):
@Override @ConsumesService(FacetsService.class) public void serviceArrived(PluginService service) { facetsService = (FacetsService) service; }
Example (listening for more than one service):
@Override @ConsumesService({TopicmapsService.class, FacetsService.class}) public void serviceArrived(PluginService service) { if (service instanceof FacetsService) { facetsService = (FacetsService) service; } else if (service instanceof TopicmapsService) { topicmapsService = (TopicmapsService) service; } }
See #599.
comment:6 Changed 10 years ago by Jörg Richter
Adapt plugins to core change (#599).
The @ConsumesService? annotation takes class objects as argument (instead of strings).
See #599.