Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Unable to pass XML configuration via JCache's "getCacheManager" #91
When using the JCache interface, I'm unable to configure the Cache2K provider at runtime using an XML configuration via
I receive the following exception when I attempt this:
The culprit appears to be the
As getCacheManager(...) only accepts URIs, I do not see a way around this.
To get the default cache manager, do:
or simply, if you don't need to specify properties or classloader:
In case there is a
If you want to create a different cache manager, with a different configuration, then do:
In this case
There is a conceptual mismatch between the cache manager designation in cache2k and JCache. In JCache it is an URI of the configuration file, which is probably an inheritance from Gregs' EHcache. In cache2k a cache manager simply has a name, which is a string.
The reason is that I'd like the cache2k API to be open and not tied to specific concepts. The XML configuration is one way that the cache configuration is provided, but its possible to provide other mechanisms to provide the cache configuration via the service provider interface
The second reason is that I don't like an URI like
I think many first time users will probably stumble here, so I try to improve documentation and the exception.
In case there are any limitations from other frameworks that require the URI to include a scheme and/or path, please let me know.
added a commit
Aug 23, 2018
I added some remarks in the documentation and improved the exception messge and just released the version
Just let me know in case you hit another obstacle. I am happy to assist.