Open cdalexndr opened 4 years ago
A simpler solution would be to just stash the "default" configuration object in the system properties... that said I'm interested to understand more about the use case that gets us here before moving forward with implementing anything.
When initializing the CacheManager, an URI can be given or configured by
ehcache.jsr107.config.default
property when using default URI, to configure the cache manager using an xml configuration file. This embedded auto-configuration helps to configure the CacheManager using JCache that may request a CacheManager at any point in application.The same cannot be done using programatic configuration because by default an empty configuration is used: https://github.com/ehcache/ehcache3/blob/4f5ed860b3488c2b2b3424575692a5d5ac3df8d0/107/src/main/java/org/ehcache/jsr107/EhcacheCachingProvider.java#L322-L336
A possible solution is to provide a property (maybe the same
ehcache.jsr107.config.default
) that contains aDefaultConfiguration
class implementation that is instantiated and used instead of the default empty configuration.