Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 461072 - Java Services should be overriden when called with a new version of the same class
Summary: Java Services should be overriden when called with a new version of the same ...
Status: CLOSED FIXED
Alias: None
Product: Acceleo
Classification: Modeling
Component: Query Language (show other bugs)
Version: 3.6.0   Edit
Hardware: PC Linux
: P3 normal
Target Milestone: ---   Edit
Assignee: Yvan Lussaud CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 460947
  Show dependency tree
 
Reported: 2015-02-27 11:49 EST by Cedric Brun CLA
Modified: 2015-04-10 08:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Brun CLA 2015-02-27 11:49:31 EST
I'm in a situation where Java classes can change in a given environment.
I'm calling :
queryEnvironment.registerServicePackage(clazz);

to register a new service class. When the Java class gets recompiled I'm calling it again with the new version of the class though even if AQL register it the "old version" always seems to be called. I would have expected that the subsequent one would "replace" the first one.

I'd like to avoid rebuilding a new query environment as this also involves re-registering the EPackages, briefly looking at the AQL code I don't see anything which should prevent this. What do you think ?
Comment 1 Yvan Lussaud CLA 2015-03-02 03:42:40 EST
I think we should add QueryEnvironment.removeServicePackage with a Class as parameter. May be also add one with the instance itself as parameter. This will prevent a complexe semantic for registerServicePackage().

it could be used like this:

Class<?> classv1 = ...

env.registerServicePackage(classv1);
...
Class<?> classv2 = ...
env.removeServicePackage(classv1);
env.registerServicePackage(classv2);
...

Does it fit your needs ?
Comment 2 Cedric Brun CLA 2015-03-02 04:46:15 EST
Indeed, that would be better as then I would not have the possibility of having around a Service we did register before which should not be there anymore.
Comment 3 Eclipse Genie CLA 2015-03-20 10:35:55 EDT
New Gerrit change created: https://git.eclipse.org/r/44251

WARNING: this patchset contains 1316 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 4 Eclipse Genie CLA 2015-03-27 05:34:10 EDT
WARNING: this patchset contains 1310 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 5 Eclipse Genie CLA 2015-03-27 07:28:58 EDT
WARNING: this patchset contains 1310 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 6 Eclipse Genie CLA 2015-04-02 13:10:57 EDT
Gerrit change https://git.eclipse.org/r/44251 was merged to [master].
Commit: http://git.eclipse.org/c/acceleo/org.eclipse.acceleo.git/commit/?id=7d31037bb69f3191ce852a079be3da9fa1046000

WARNING: this patchset contains 1310 new lines of code and may require a Contribution Questionnaire (CQ) if the author is not a committer on the project. Please see:https://wiki.eclipse.org/Project_Management_Infrastructure/Creating_A_Contribution_Questionnaire
Comment 7 Cedric Brun CLA 2015-04-10 07:53:31 EDT
The API is working as intended when used in the Sirius bridge.
Comment 8 Yvan Lussaud CLA 2015-04-10 08:10:05 EDT
Nothing to add for the moment.