Interface CachePolicy
-
- All Known Implementing Classes:
NoopCachePolicy
@Immutable public interface CachePolicy
Policy of aCache
(orCheckedCache
).- Author:
- Michael Vorburger.ch
-
-
Field Summary
Fields Modifier and Type Field Description static long
UNLIMITED_ENTRIES
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default long
maxEntries()
Specifies the maximum number of entries the cache may contain.default boolean
statsEnabled()
Whether this cache has it statics enabled.
-
-
-
Field Detail
-
UNLIMITED_ENTRIES
static final long UNLIMITED_ENTRIES
- See Also:
- Constant Field Values
-
-
Method Detail
-
statsEnabled
@Default default boolean statsEnabled()
Whether this cache has it statics enabled. This may cause it to have a bit more runtime overhead than it would have if it does not.CacheStats
are obtained viaCacheManager.getStats()
-
maxEntries
@Default default long maxEntries()
Specifies the maximum number of entries the cache may contain. When this limit is reached, existing entries are evicted to accomodate new entries.The default is
UNLIMITED_ENTRIES
.Users are encourage to set the maximum entries policy suitable to their actual usage of the cache; either programmatically in code, or by runtime configuration.
-
-