Closed bjhargrave closed 7 years ago
Comment author: David Jencks <djencks@us.ibm.com>
I often want to use the annotation fully qualified class name as id (already the default) and pid/factory pid. Similarly to the use of "$" in DS for the component name as pid, it would be convenient to use "$" in @ ObjectClassDefinition pid/factoryPid to indicate the id (defaulting to the FQCN).
It would also be convenient in DS to be able to specify configuration annotations in place of pids, perhaps Class[] configurationClass, where any annotation you specified would have to have only one pid/factory pid specified and you could not use both confgurationClass and configurationPid in the same component. This might be too complex and error prone.
Comment author: @bjhargrave
(In reply to David Jencks from comment BZ#0)
I often want to use the annotation fully qualified class name as id (already the default) and pid/factory pid. Similarly to the use of "$" in DS for the component name as pid, it would be convenient to use "$" in @ ObjectClassDefinition pid/factoryPid to indicate the id (defaulting to the FQCN).
So you are asking that use of "$" as an ObjectClassDefinition.pid or ObjectClassDefinition.factoryPid element value be replaced with the id value of the ObjectClassDefinition? This seems to conflict with the description of id element which states: "The id is not to be confused with a PID which can be specified by the pid or factoryPid element."
It would also be convenient in DS to be able to specify configuration annotations in place of pids, perhaps Class[] configurationClass, where any annotation you specified would have to have only one pid/factory pid specified and you could not use both confgurationClass and configurationPid in the same component. This might be too complex and error prone.
The Designate annotation is the way to connect an ObjectClassDefinition to a Component. This is the most common scenario. If your component needs multiple pids then an element of type Class[] would also be error prone since there is no compile-time way to ensure types annotated with ObjectClassDefinition are used as arguments.
Comment author: David Jencks <djencks@us.ibm.com>
Replacing "$" with the FQCN would be even better than the id.
I discussed the Class[] configurationClass idea with BJ and we decided it is not very clear if a metatype
Comment author: @bjhargrave
CPEG f2f 7 Sep 2016: Agreed to map $ to the FQCN of the type being annotated.
Comment author: @bjhargrave
Both the org.osgi.service.metatype and org.osgi.service.metatype.annotation packages are versioned at 1.3 (we keep the versions in sync as is done for component).
To add a the support to org.osgi.service.metatype.annotation would require bumping its version to 1.4 which would mean we also bump the org.osgi.service.metatype package to 1.4 also. But we are not adding any new function to Metatype runtime. This bug just asks for some tooltime support for the annotations processing.
I think we should wait to add this support until we are otherwise adding some new function to the Metatype spec which would increment the org.osgi.service.metatype package version to 1.4.
At that time, we should also add the @ Requirement(namespace = ExtenderNamespace.EXTENDER_NAMESPACE, ...) annotation to ObjectClassDefinition.
Comment author: @bjhargrave
CPEG call: Agreed to defer until we bump the org.osgi.service.metatype spec to 1.4.
Comment author: @bjhargrave
Bring back to R7 since we must update Metatype spec for new component property type name mapping features ($$ to -, PREFIX, and single-element annotations).
Comment author: @bjhargrave
Fixed by https://osgi.org/gitweb/build.git/commit/3621a8506547ed755138333422cfd7e8963c7ac0
Original bug ID: BZ#2917 From: David Jencks <djencks@us.ibm.com> Reported version: R6