Using SlingScriptHelper.getServices to return multiple services
I'm trying to explore options for maintaining multiple versions of code. I have three bundles which are essentially identical, except for a version indicator in the symbolic name, and the return value of a service method. I can install these to Felix simultaneously. Version 1.0.4 of the bundle has a property on the service class named version with a value of "1.0.4". Version 1.0.3 of the bundle has no such property, and version 1.0.5 has "1.0.5".
If I call sling.getServices(MyInterface.class, "(version=*)") from a JSP, I always get an array of 1 element returned. I haven't totally figured out what the rules governing which version I get, but currently when I pass "(version=1.0.4)" as my filter, I get the 1.0.5 version, and when I pass "(version=1.0.5)", I get a zero-length array back. Is there something I'm doing wrong?
Thanks