Comments (2)
Comment author: Simon Spero <[email protected]>
The type of the generated attribute is constrained to be Version, but for some namespaces the type is unconstrained, or specified to be a different type.
For example, osgi.contract (pre-R7) seemed to restrict the value to List, and now allows any of "Version, List and Version[]".
I'm just using contract as an example, since that is not the canonical use case (and is hard to process since the uses are pointed the wrong way.
Also, the Requirement version argument seems overly restrictive (if a single string format is used, the same code for parsing import versions could be used to generate the filter.
For both these cases, the version arg could be widened to Object, with capability taking String, Version, Version[], and List, and Requirement taking String, Version, and VersionRange.
The resulting attribute type of the attribute value for Capability can be restricted to Version or List (with services that permit arbitrary strings made to do things the hard way as punishment).
In the alternative, the existing behavior could be documented, with an explicit warning, or a multi-valued "versions" parameter could be added to @ Capability.
from design.
Comment author: @bjhargrave
Capability is an annotation. As such the version element cannot have a value of Object since that is not supported by annotations in Java.
If you use the version element of the Capability annotation, then generated capability will have a type of Version.
If you needed to define a contract capability with the Capability annotation and need to specify more than a single version, you can use the attribute element:
attribute({"version:List="1.0,1.1,2.0""})
The version element is to cover the majority of use cases but you can always us the attribute element for other use cases. Almost all capabilities should have exactly one version. The contract capability is rather unique.
Similarly for Requirement, if the version annotation does not cover your use case, you can specify it via the filter element.
So it seems that you can express the corner cases with the annotations, just not with the version element itself. Since this is possible, I don't see that the spec should change to alter the definition of the version elements of the Capability and Requirement annotations.
from design.
Related Issues (20)
- Ordering issue with RFC-217 "osgi.jaxrs.filter.base" filters HOT 2
- rfc-217 should clarify how ApplicationPath annotation can affect the base path HOT 1
- RFC-217 support for Feature, DynamicFeature, ContextResolver and other providers HOT 3
- RFC-221 Transaction control: Release resources managed by JDBCConnectionProvider HOT 4
- Typos in RFC 221 Transaction Control - Drafs HOT 1
- RFC-229 MQTT Wildcard topics HOT 2
- [Converter] Conversion of Collections HOT 2
- Configurer specification - partial configurations and merging (R8+) HOT 2
- Feature: support Optional<T> for DS service reference type HOT 3
- [RFC 216/ PushStream] Inconsistency between JavaDoc/Spec Section 706.7.14.6 and the reference implementation HOT 1
- [RFC 216/ PushStream] Inconsistent time unit of PushbackPolicyOption.getPolicy() between JavaDoc and implementation HOT 4
- Component "outjection" for declarative services. HOT 1
- rfc-241 (Feature) - json structure and comment HOT 4
- Offer BundleContext#registerService without HashTable HOT 4
- [JPA Service] allow a JPA Service to use the (non-)jta-data-source attribute instead of the javax.persistence.jdbc.driver property HOT 1
- DS 1.4 Component Property Types: Allow meta annotations or static fields for generating constant component properties HOT 3
- DS 1.4 Component Property Type Annotations: Allow elements which only optionally create component properties HOT 1
- DS: Allow a condition towards a framework property HOT 3
- DS: Allow conditions for a class being available to the classloader HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from design.