json-logic-java
json-logic-java copied to clipboard
Added ability to use Caffeine for Caching, which enables additional features like eviction, which is not supported by existing ConcurrentHashMap parseCache (#45)
Issue: https://github.com/jamsesso/json-logic-java/issues/45 This change is to provide clients option to use Caffeine with a pre configured max size, so that the parseCache does not grow indefinitely which were causing JVM high memory issues
Changes:
- Added CacheManager interface to be able to use ConcurrentHashMap or Caffeine for caching.
- Added ConcurrentHashMapCacheManager class which uses ConcurrentHashMap for caching, this will be default behaviour ensuring backward compatibility.
- Added CaffeineCacheManager which uses Caffeine for caching, and provides option to specify a max size of the cache.
- Minor update to the version from 1.1.1-SNAPSHOT to 1.1.2-SNAPSHOT