Community
Participate
Working Groups
From section 112.7, Deployment of Declarative Services (R4) Spec: "Factory Configuration – If a factory PID exists, with zero or more Configu- rations, that is equal to the component name, then for each Configuration, a component configuration must be created that will obtain additional component properties from Configuration Admin. This is the ManagedServiceFactory situation." In org.eclipse.equinox.ds.resolver.Resolver.enableComponents(List componentDescriptions) the following code never checks to see if any Configurations are registered with a service.factoryPid matching the component's name, which prevents ManagedServiceFactories from being handled properly: // check for a Configuration properties for this component Configuration config = null; try { ConfigurationAdmin configurationAdmin = (ConfigurationAdmin) configAdminTracker.getService(); if (configurationAdmin != null) { config = configurationAdmin.getConfiguration(cd.getName(), cd.getBundleContext().getBundle().getLocation()); } } catch (IOException e) { // Log it and continue Log.log(1, "[SCR] IOException when getting Configuration Properties. ", e); } // if no Configuration if (config == null) { // create ComponentConfiguration map(cd, null); } else { // if ManagedServiceFactory if (config.getFactoryPid() != null) { This code looks for configurations with a pid that has the same value of the name of the component. This doesn't work in the case of ManagedServiceFactories since pids are programmatically generated for them. So the code above only works with ManagedServices. I'll submit a possible patch that looks for Configurations with a service.factoryPid that matches the component's name, and if none are found a lookup will be performed to see if any existing Configurations are registered with a service.pid that matches the component's name. I believe this handles both cases.
Created attachment 53397 [details] Updated version of enableComponents that works with ManagedServiceFactories
Created attachment 53401 [details] Fixed patch file for updated enabledComponents method that handles ManagedServiceFactories
First attached patch is corrupt (I attached a tmp vim generated file by mistake) second should be ok.
Comment on attachment 53397 [details] Updated version of enableComponents that works with ManagedServiceFactories Attached vim .swp file by mistake.
BJ, can you review the patch and release if appropriate?
I know the whole crowd here is probably busy with EclipseCon now, but I'd appreciate it if someone could apply the provided patch and make an updated bundle available, as my specific use case for DS relies upon this interaction between DS and a ManagedServiceFactory.
Can we close this since the DS impl was replaced by a contribution from ProSyst?
There is no such problem with the new DS implementation