Closed cruftex closed 7 years ago
The intention was definitely option a) which I have clarified in the CachingProvider Javadoc.
In current javadoc of CachingProvider.getCacheManager(URI, ClassLoader, Properties)
it is mentioned that:
Properties are caching implementation specific.
Javadoc of CacheManager.getProperties
reads:
Get the {@link Properties} that were used to create this {@link CacheManager}.
According to the discussion in https://github.com/jsr107/jsr107tck/issues/102#issuecomment-267604441 (regarding TCK test CachingTest.getCacheManager_nonNullProperties
):
The Spec doesn't say that properties have to be preserved and how properties are interpreted is implementation specific. A legal implementation may refuse operation if there are any properties. If there is the assumption that properties are preserved and an implementation ignores properties which are not in its namespace, then we need to put that in the Spec first. In jsr107/jsr107spec#368 Greg opted for a. That means everything non null is implementation specific, so we cannot test anything here.
It seems that further clarification is required to indicate properties must be preserved, otherwise the related TCK test does not make sense.
From: https://github.com/jsr107/jsr107tck/issues/102
A cache manager has properties. The relevant passages from the specification:
CacheManager
CachingProvider
Current State
No implementation actually uses the content in the properties for its configuration.
Applications can set arbitrary property values and that get passed through transparently by the caching provider.
The
RICachingManager
always constructs a new Properties instance and takes over the specified properties atCachingProvider
level as default properties:Hazelcast 3.4.2 and Coherence V12.1.3 do the same. Others simple use the identical property instance.
=> The current behavior is not really specified. Implementations are not consistent.
Possible Clarifications
a) Properties are only interpreted by the implementation. Everything non-null is implementation specific. The behavior of mutating properties obtained from
CacheManager.getProperties()
is undefined.b) Property values are passed through transparently. Applications can read and write properties in the instance obtained by
CacheManager.getProperties()
. This has only visible effect within one cache manager, meaning, it must be ensured that there is one properties object per cache manager.