Comments (2)
Comment author: Elias N Vasylenko <[email protected]>
As discussed previously here https://mail.osgi.org/pipermail/osgi-dev/2017-November/006598.html I propose support for some way to provide partial configurations for a PID and have the configurer merge them as appropriate.
Peter Kriens has shown that at least some users want this and that it's feasible to provide.
I think this is best served by allowing a configuration to mark itself as an override. If the configurer then chooses it as the highest ranked configuration, it knows that it is incomplete and must be merged with the configuration of the next highest ranking.
This achieves two important properties:
-
An incomplete configuration is never deployed without an existing complete configuration to be overridden.
-
Control of how a configuration is merged is given to the entry with the highest ranking.
Take the following configurations as an example:
[Bundle A]
{
"my.pid": {
":configurator:ranking": "0",
"key_one": "configured_value",
"key_two": "configured_value",
"key_three": "configured_value"
}
}
[Bundle B]
{
"my.pid": {
":configurator:ranking": "1",
"key_three": "overriding_value",
":configurator:merge-strategy": "override" // just a suggestion for illustration
}
}
Here bundle B's configuration can't be deployed by itself, but with the presense of bundle A as well the configurer would infer the following resulting configuration:
[effective]
{
"my.pid": {
"key_one": "configured_value",
"key_two": "configured_value",
"key_three": "overriding_value"
}
}
I think this approach is powerful enough to justify the extra implementation complexity and does not add much burden to the mental model for users. It would probably require a version bump for ":configurator:version".
from design.
Comment author: Elias N Vasylenko <[email protected]>
One consideration I forgot to mention is that this this would interact with the overwrite policy in a tricky way. Different keys in the effective configuration may have been merged in from configurations which used different policies.
Building on the example above:
-
Let's say bundle A has specified "force" policy on its configuration and bundle B has "default".
-
At runtime another bundle then provides a manual configuration for "my.pid" through the configuration admin.
-
Bundle A and B are then redeployed, what happens now?
I think the natural behaviour is to keep the manual configuration for "key_three" but revert "key_one" and "key_two" to the values given by bundle A.
It could be nice to be able to have different policies apply to different properties ... but as a general mechanism for allowing that this is pretty clunky since it can't be done in a single configuration.
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
- R7 Core draft 2017-3, 10.8.4.3 (Capability and Requirement version params) 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.