Ticket #599 (closed Enhancement: fixed)

Opened 11 years ago

Last modified 10 years ago

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:1 Changed 11 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 11 years ago by jri

  • Milestone Release 4.2 deleted

comment:3 Changed 10 years ago by jri

  • Cc carolina added

comment:4 Changed 10 years ago by jri

  • Milestone set to Release 4.4

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.

comment:7 Changed 10 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.