The 4.2 draft spec for Declarative Services identifies 3 ways to provide
properties to Components: Component Factory.newInstance method,
Configuration Admin Service, specified in Component description. The
ComponentFactory and ConfigurationAdminService use a Dictionary to
contain the properties. If you define properties in a Component
Description, they will be passed to the Component's activate method as a
Map.
The activate method can take zero or more arguments. Each argument must
be of one of the following types:
• ComponentContext – The component instance will be passed the Component
Context for the component configuration.
• BundleContext – The component instance will be passed the Bundle
Context of the component's bundle.
• Map – The component instance will be passed an unmodifiable Map containing
the component properties.
This creates an inconsistency since Dictionary doesn't implement the Map
interface. Implementations would have to be able to handle both a Map
and a Dictionary to allow the component to be used by each of the
different property providers. Changing the draft to look for a method
that takes a Dictionary instead of a Map would provide a consistent
interface across the different configuration options.
Is this something that would be addressed by entering a bug report?
_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev