-
Notifications
You must be signed in to change notification settings - Fork 357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPI Config API for Jersey #4116
Conversation
Just wondering, but why are Helidon and SmallRye providers needed? Would it not be an option to only use the public MicroProfile Config APIs? |
Actually those are external modules, they are not needed, just optional. The aim is to demonstrate possibilities to plug different implementations of MP configurations. And in the same way Jersey provides more tooling prepared out of the box so particular user is not required to implement s/his own connector if existing fits requirements. |
But can't you just use the vanilla MicroProfile API to get the Config without these providers?
then whatever Config Provider is available will be used. There shouldn't be any need to use apis from the provider directly. Config Provider uses a Service Loader to find the provider on the classpath without coupling to non-standard apis. |
@smillidge Using the MP config is just one possibility. All this should be able to
That is to explain why there is non-mp-config SPI used |
OK, I will introduce some minor changes in a while (according to your comments) |
@jansupol I like the whole config provider SPI. I was commenting more in the context of creating the MP Config provider as an implementation of the SPI there shouldn't be the need to create a dependency to the specific MP Config implementations as the MP ConfigProvider itself should provide that abstraction. |
@smillidge, @arjantijms, @jansupol I've updated the PR, build is passed OK. Could you please take a look? |
ext/microprofile/config/src/main/java/org/glassfish/jersey/config/ConfigurationModel.java
Outdated
Show resolved
Hide resolved
51fd0c4
to
54e2220
Compare
core-common/src/main/java/org/glassfish/jersey/CommonProperties.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/org/glassfish/jersey/internal/config/SystemPropertiesConfigurationModel.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/org/glassfish/jersey/internal/config/SystemPropertiesConfigurationModel.java
Outdated
Show resolved
Hide resolved
core-common/src/main/java/org/glassfish/jersey/internal/config/package-info.java
Outdated
Show resolved
Hide resolved
pom.xml
Outdated
@@ -2043,6 +2043,9 @@ | |||
<weld3.version>3.0.0.Final</weld3.version> | |||
<xerces.version>2.11.0</xerces.version> | |||
<yasson.version>1.0.3</yasson.version> | |||
<helidon.version>1.0.2</helidon.version> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CQ required for Helidon, MP Config API, smallrye
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...c/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactory.java
Outdated
Show resolved
Hide resolved
Given the issue with smallrye licensing, we would probably need to split the commit into two, the test module with smallrye in a separate commit. I assume that one will not make it to 2.29 |
04e944d
to
4a871a9
Compare
Short summary on current state of the PR: Config engine is modified to be plugged automatically for both client and server parts of Jersey. Tests are adjusted accordingly. Small-ray test/example is removed from the PR due to license header error in one of its sources. Will be added separately. |
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
ext/microprofile/config/pom.xml
Outdated
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<artifactId>config</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please align the name with other ext projects: jersey-mp-config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't that you who told me to avoid MP naming in modules/PRs?
@@ -44,6 +44,7 @@ | |||
<module>cdi</module> | |||
<module>entity-filtering</module> | |||
<module>metainf-services</module> | |||
<module>microprofile/config</module> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just microprofile. Each sub module should be dealt with in the microprofile project. There would be at least 2 submodules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
correct, but we already have a PR #4086 which does this with its module, so it would be less conflicts when both PR's will be merged
...java/org/glassfish/jersey/internal/config/ExternalPropertiesConfigurationFactoryFeature.java
Outdated
Show resolved
Hide resolved
public void configure(FeatureContext context) { | ||
if (!context.getConfiguration().isRegistered(ExternalPropertiesConfigurationFactoryFeature.class)) { | ||
ExternalPropertiesConfigurationFactoryFeature.getFactory().configure(context); | ||
context.register(ExternalPropertiesConfigurationFactoryFeature.getFactory()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would register the feature twice. Context.register(ExternalPropertiesConfigurationFactoryFeature.class)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) I saw that. It's due to mixing the feature and the factory
core-common/src/main/java/org/glassfish/jersey/spi/ExternalConfigurationModel.java
Show resolved
Hide resolved
d5cbc91
to
9371a4f
Compare
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
...n/src/main/java/org/glassfish/jersey/internal/config/ExternalPropertiesAutoDiscoverable.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Maxim Nesen <maxim.nesen@oracle.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Relates to #4110
Signed-off-by: Maxim Nesen maxim.nesen@oracle.com