Skip to content
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

Add default fallback configuration for Cache #10695

Closed
vbekiaris opened this issue Jun 2, 2017 · 2 comments
Closed

Add default fallback configuration for Cache #10695

vbekiaris opened this issue Jun 2, 2017 · 2 comments

Comments

@vbekiaris
Copy link
Contributor

@vbekiaris vbekiaris commented Jun 2, 2017

Other data structures' Config.findXYZConfig() methods include fallback to a "default" config, however this is not the case for Caches. Using wildcards is a workaround but is not consistent with how other data structures work.

By including the fallback, the behavior of Hazelcast's CacheManager.getCache methods will change to return a preconfigured Cache instead of null (as is the case in Hazelcast 3.x): this seems compliant to the specification of getCache methods as both state in their javadoc:

   * Implementations that support declarative mechanisms for pre-configuring
   * {@link Cache}s may return a pre-configured {@link Cache} instead of
   * <code>null</code>.
@mmedenjak

This comment has been minimized.

Copy link
Contributor

@mmedenjak mmedenjak commented Jul 6, 2018

+1 to do in 4.0 with other config cleanup - #12617

@vbekiaris

This comment has been minimized.

Copy link
Contributor Author

@vbekiaris vbekiaris commented Oct 29, 2019

It seems the JSR 107 spec does not allow for this behaviour. The JSR107 TCK includes tests that enforce that under default (= no) configuration, implementations return null from getCache. It is only allowed to create & return a Cache from getCache when an implementation is configured with explicit non-default configuration.

Related discussion: jsr107/jsr107tck#148

@vbekiaris vbekiaris closed this Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.