Comments (3)
Comment author: Karel Haeck <[email protected]>
the current draft only supports providers of Filters, Interceptors, BodyReaders and BodyWriters. The jax-rs spec also defines Feature, DynamicFeature, ContextResolver,
ExceptionMapper and ParamConverterProvider.
It would be much simpler to have a single property osgi.jaxrs.provider.base, regardless of provider type,
as all providers share the characteristic that the base url matches all subpaths.
Note also that standard jax-rs javax.ws.core.Feature functionality is quite similar to the newly proposed rfc specific JaxRSContext
from design.
Comment author: @timothyjward
(In reply to Karel Haeck from comment BZ#0)
the current draft only supports providers of Filters, Interceptors,
BodyReaders and BodyWriters. The jax-rs spec also defines Feature,
DynamicFeature, ContextResolver,
ExceptionMapper and ParamConverterProvider.
It would be much simpler to have a single property osgi.jaxrs.provider.base,
regardless of provider type,
as all providers share the characteristic that the base url matches all
subpaths.
We agreed something very similar to this at the Expert Group Face to Face meeting last week. The original intent was to map closely to the Http Service Whiteboard, which uses different property names, but there are a sufficiently large number of different types with similar semantics here that a common property does seem to be a better choice.
Note also that standard jax-rs javax.ws.core.Feature functionality is quite
similar to the newly proposed rfc specific JaxRSContext
We will look again at the additional types, particularly the use of Feature, which may be able to replace JaxRSContext, but the intent of the spec is not necessarily to provide a 100% mapping of the JAX-RS API to a whiteboard model, at least for the first version of the whiteboard specification. Applications which make heavy use of the JAX-RS specification can always fall back to registering an Application with the whiteboard.
The ContextResolver is a good example of a service that probably does not need to be part of the whiteboard - whiteboard resources will typically be singletons, and will use Declarative Services or some other injection technology to get access to OSGi service dependencies. The use of @ Context for custom injection is therefore likely to be limited to method injection for built-in JAX-RS types, and using a ContextResolver therefore broadly unnecessary. DynamicFeatures appear to be similarly unnecessary, they provide exactly the same behaviour as registering several Filters, or registering a Feature.
In general we want to ensure that the whiteboard is useful, but also to prevent it from becoming overly complex.
If you have a specific use case that you are concerned about then it would be valuable to know what it is.
from design.
Comment author: Karel Haeck <[email protected]>
My primary use case for a ContextResolver is not for direct use in a Resource, but for customization of other feature's. e.g. In Jersey I may add a JacksonFeature to use the Jackson library for JSON (de)serializing, and then register a ContextResolver to control how objects are (de)serialized to/from JSON.
Motivation for DynamicFeature is to reuse existing components. e.g. Jersey provides a
RolesAllowedDynamicFeature, that bridges a resource method's @ RolesAllowed annotation with SecurityContext.isUserInRole(String). While there are other ways to implement this, it just happens to be implemented as a DynamicFeature.
I agree that a 100% mapping of JAX-RS features to the whiteboard should not be a goal, but by not caring about the provider type, the whiteboard automatically supports all of the provider types.
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-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
- R7 Core draft 2017-3, 10.8.4.3 (Capability and Requirement version params) 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.