public final class LRUCacheFactory extends Object
LRUCache instances.| Modifier and Type | Method and Description |
|---|---|
static <K,V> Map<K,V> |
newLRUCache(int maximumCacheSize)
Constructs an empty LRUCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
static <K,V> Map<K,V> |
newLRUCache(int initialCapacity,
int maximumCacheSize)
Constructs an empty LRUCache instance with the
specified initial capacity, maximumCacheSize, and will stop on eviction.
|
static <K,V> Map<K,V> |
newLRUCache(int initialCapacity,
int maximumCacheSize,
boolean stopOnEviction)
Constructs an empty LRUCache instance with the
specified initial capacity, maximumCacheSize,load factor and ordering mode.
|
static <K,V> Map<K,V> |
newLRUSoftCache(int maximumCacheSize)
Constructs an empty LRUSoftCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
static <K,V> Map<K,V> |
newLRUWeakCache(int maximumCacheSize)
Constructs an empty LRUWeakCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
static void |
warmUp()
Warm-up the LRUCache to startup Apache Camel faster.
|
public static void warmUp()
public static <K,V> Map<K,V> newLRUCache(int maximumCacheSize)
maximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic static <K,V> Map<K,V> newLRUCache(int initialCapacity, int maximumCacheSize)
initialCapacity - the initial capacity.maximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic static <K,V> Map<K,V> newLRUCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction)
initialCapacity - the initial capacity.maximumCacheSize - the max capacity.stopOnEviction - whether to stop service on eviction.IllegalArgumentException - if the initial capacity is negativepublic static <K,V> Map<K,V> newLRUSoftCache(int maximumCacheSize)
maximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic static <K,V> Map<K,V> newLRUWeakCache(int maximumCacheSize)
maximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativeApache Camel