| Summary: | [DS] Reference event method "updated" only executed with ServiceReference parameter | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Dirk Fauth <dirk.fauth> | ||||
| Component: | Compendium | Assignee: | equinox.compendium-inbox <equinox.compendium-inbox> | ||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||
| Severity: | major | ||||||
| Priority: | P3 | CC: | s.boshev, tjwatson | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Dirk Fauth
Will need a testcase. The following code seems to check for at least the service object type method: org.eclipse.equinox.internal.ds.model.ComponentReference.getMethod(ComponentInstanceImpl, Reference, String, ServiceReference) I don't recall when the Map variant was added to the specification, but it could be later than what is implemented by Equinox DS impl. (In reply to Thomas Watson from comment #1) > I don't recall when the Map variant was added to the specification, but it > could be later than what is implemented by Equinox DS impl. Would be strange. I just checked the 4.2 Spec which contains the Declarative Service Specification 1.1. And there it is already specified. And the bind and unbind methods support it already. It is only the updated method that doesn't work. I will prepare a small sample so you are able to verify it easily. Created attachment 261384 [details]
Example showing the issue
The attached example contains two small bundle projects. One contains a configurable component, the other Felix shell commands. One command uses the ConfigurationAdmin to set a configuration property, the other command references the configurable component.
The WelcomeCommand contains the "updated" methods that should be triggered in case of configuration changes.
Only the method with the ServiceReference gets triggered. The others not.
Note that you should test this with only one method uncommented. If you have all methods uncommented always the one with the ServiceReference parameter should be called because of the specified order in the DS spec.
Also note that you need the ConfigurationAdmin to test this. Unfortunately the ConfigurationAdmin bundle is not included in a default Eclipse installation, therefore it needs to be added manually.
I forgot to mention, after you start via the launch configuration in the command bundle, you should start with the "welcome" command to activate the component. It should print "Service says: null". After that execute the "configure xxx" command. Now the modified and the updated methods should be triggered. If you execute the "welcome" command afterwards, it should print "Service says: xxx". This is not a bug in the DS implementation. 1. The updated method for references is added in Declarative services specification v1.2. Therefore, you need to use schema v1.2.0 in your component. 2. You need to specify the updated method in your reference. In your testcase you have specified only the bind method. If you fix (1) and (2) in your testcase, it will work as expected. Thanks for the verification and the hint on the wrong component xml. I can confirm that changing the spec and adding the updated attribute works. I realized that the issue is in the newly introduced DS annotations added to PDE with Eclipse Neon. The two other signatures are not taken into account on xml generation which leads to the wrong xml file. I created/updated Bug 492645 for this. |