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

Cache manager review the cache instantiation process #3011

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

riccardomodanese
Copy link
Contributor

Signed-off-by: riccardomodanese riccardo.modanese@eurotech.com

Brief description of the PR.
Keep CachingProvider and CacheManager instance reference in KapuaCacheManager class

Related Issue
none

Description of the solution adopted
The process to create a cache instance involves the creation of a CachingProvider and a CacheManager.
The previous implementation creates a new instance of both of them for each cache instantiation.
Now the CachingProvider and CacheManager are instantiated once and kept as reference for the further getCache invocations.
This is perfectly allowed and shouldn't change any cache behavior since from CachingProvider.getCacheManager method javadoc (JCache specification):
"Requests a CacheManager configured according to the implementation specific URI that uses the provided ClassLoader for loading underlying classes.
Multiple calls to this method with the same URI and ClassLoader must return the same CacheManager instance, except if a previously returned CacheManager has been closed."

Screenshots
none

Any side note on the changes made
none

…antiated caches)

Signed-off-by: riccardomodanese <riccardo.modanese@eurotech.com>
Copy link
Contributor

@stefanomorson stefanomorson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good for me.

@Coduz Coduz added the Bug This is a bug or an unexpected behaviour. Fix it! label Jul 3, 2020
@Coduz Coduz merged commit fe4d674 into develop Jul 3, 2020
@Coduz Coduz deleted the fix-cacheInitialization branch July 3, 2020 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug or an unexpected behaviour. Fix it!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants