1

The OSGi DS Specification mentions :

When the service is requested, if the service has the scope attribute set to bundle, SCR must create and activate a unique component configuration for each bundle requesting the service.

In other words, if a component specifies a service with bundle scope, and this service is requested by two different bundles at the same time, then you call the method org.osgi.service.component.runtime.ServiceComponentRuntime.getComponentConfigurationDTOs(ComponentDescriptionDTO), you should get two different ComponentConfigurationDTO.

But based on the Apache Felix implementation org.apache.felix.scr_2.2.6.jar, you can only get one ComponentConfigurationDTO.

I checked the source code and it uses class org.apache.felix.scr.impl.manager.ServiceFactoryComponentManager to manage such component and its field serviceContexts to maintain all the component instances under that component :

// maintain the map of ComponentContext objects created for the
// service instances
private IdentityHashMap<S, ComponentContextImpl<S>> serviceContexts = new IdentityHashMap<>();

Such a code implementation, which makes a single component configuration associated with multiple component instances, it is also inconsistent with the specification

Component Instance - An instance of the component implementation class. A component instance is created when a component configuration is activated and discarded when the component configuration is deactivated. A component instance is associated with exactly one component configuration.

Bourbon_7
  • 161
  • 7
  • 1
    By the way, how do I report this issue to Apache, there is no "issues" or "discussions" portal in github https://github.com/apache/felix-dev/tree/master/scr/. – Bourbon_7 Aug 27 '23 at 16:15
  • 2
    Apache uses Jira: https://issues.apache.org/jira/projects/FELIX – gjoranv Aug 27 '23 at 20:11

0 Answers0