ph cache - phax/ph-commons GitHub Wiki
Generic caching infrastructure and a precompiled regular expression cache.
Highlights:
-
ICache<K,V>/IMutableCache<K,V>- cache interfaces -
Cache/MappedCache- simple cache implementations, optionally with aDuration-based time-to-live (since 12.3.0) -
CacheEntry<V>- internal value+expiration holder used byMappedCache(since 12.3.0) -
CacheBuilder/ProviderCacheBuilder/ManualCacheBuilder- dedicated builders sharing the common baseCacheBuilderBasewithexpireAfterWrite(Duration)andevictionInterval(Duration)to configure time-based expiration and opt-in background eviction (since 12.3.0) -
IMutableCacheWithExpiration.putInCache(K, V, Duration)/putInCache(K, V, LocalDateTime)- per-entry expiration overrides for the cache-wide TTL (since 12.3.0) -
CacheEvictionScheduler- process-wide singleton driving periodicevictExpired()calls for registered caches on one shared daemon thread (since 12.3.0) -
AnnotationUsageCache- cache for annotation presence checks -
RegExCache/RegExPattern/RegExHelper- compiled regex pattern caching and utilities
Add the following to your pom.xml to use this artifact:
<dependency>
<groupId>com.helger.commons</groupId>
<artifactId>ph-cache</artifactId>
<version>x.y.z</version>
</dependency>