Repository navigation
Conversation
Signed-off-by: Steve Hawkins <shawkins@redhat.com>
|
@keycloak/cloud-native @pruivo does this look like something you would be ok moving forward with? I'm just reusing most of the Scope class via BaseScope because we can't directly use Options here as we're all the way down in core. If this seems good, I'll open an issue. |
|
@shawkins it looks good to me. I don't think you need to split the interface in two; you could add |
My reasoning is:
The scoping logic provides child scopes. If you call scope() currently it is a no-op. |
It may be useful to access other scopes but I'm not sure if it a widespread use case. I'm doing the following in my code: //legacy option, for backwards compatibility --spi-connections-infinispan-quarkus-site-name
var legacySiteName = Config.scope(InfinispanConnectionSpi.SPI_NAME, "quarkus").get("site-name");
if (legacySiteName != null) {
logger.warn("--spi-connections-infinispan-quarkus-site-name is deprecated and may be removed in the future. Use --spi-cache-embedded-%s-site-name".formatted(DefaultCacheEmbeddedConfigProviderFactory.PROVIDER_ID));
}
var siteName = config.get(DefaultCacheEmbeddedConfigProviderFactory.SITE_NAME, legacySiteName);Anyway, the PR looks good to me 👍 |
Another motivation behind this change is that we pass a Scope to the init method, so it's an "official" stateful way of obtaining configuration information. Accessing static methods on Config, and elsewhere, is something we should eventually refactor out of the public api - in particular there's no reason someone should call Config.init. cc @pedroigor The point is taken that you using the scope method to access another provider's configuration, rather than using a constant or convienence method based around toDashCase. So I'll open an issue and refine this pr to being just a single interface instead. |
|
@shawkins What is the status of this PR? |
I incorporated much of the modifications into another pr, so I just need to revisit this and clean it up. |
|
Looking at this again it's probably not worth messing with until we make a more comprehensive attempt at not exposing all of static Config methods. |
No description provided.