Comments (2)
Comment author: Sergey Beryozkin <[email protected]>
RFC 217 recommends registering the container filters with an "osgi.jaxrs.filter.base" property.
It appears to me that this RFC 217 feature can only be applied to JAX-RS filters and implemented by registering an internal PreMatch and PostMatch filters which will run all the registered filters which match the request URI.
The question is, at what priority level this internal filter(s) will be registered with the JAX-RS runtime ? Consider this example, the user registers a number of Per and Post match filters and expects them be applied only if request URI matches "http://host/a/b/c":
- PreMatchFilter1, priority 3
- PreMatchFilter2, priority 5
It also registers a global PreMatchFilter3, priority 4
The internal PreMatch filter will run at the most earliest priority - it will have to sort PreMatchFilter1 & PreMatchFilter2 itself. As far as the JAX-RS runtime is concerned, it will only see Internal and PreMatchFilter3 => the priority of PreMatchFilter3 will not be honoured.
Unless the only filter which the runtime sees is this Internal Filter which will do all the sorting of the custom filters itself. This is a bit problematic - the runtime should sort but it might work.
But it will become trickier if the above example is updated for the PostMatch filters - again the priorities can only be guaranteed if the JAX-RS runtime will only see an internal PostMatch filter sorting all the custom filters itself - meaning it will also have to manage both named and non-named filters correctly, discard the named filters whose names do not match, etc.
I wonder how useful the "osgi.jaxrs.filter.base" property can become in practice - to support it the container will have to take on itself what the JAX-RS runtime does with respect to managing the filters. Users can implement themselves this URI-checks in their filters if they need. For PstMatch filters users mean often that all of their global filters will apply to a given method invocation and they can restrict with names if needed or indeed with the custom checks.
from design.
Comment author: Sergey Beryozkin <[email protected]>
Perhaps I missed the point of this "osgi.jaxrs.filter.base" property - may be the idea is to use it associate with the separately registered resources...Nonetheless it might make sense to make sure the ordering of the filters (per the Priority annotations) is always preserved
from design.
Related Issues (20)
- 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
- 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.