@JdkService(value="lru-cache-factory")
public final class CaffeineLRUCacheFactory
extends org.apache.camel.support.LRUCacheFactory
CaffeineLRUCache instances.| Constructor and Description |
|---|
CaffeineLRUCacheFactory() |
| Modifier and Type | Method and Description |
|---|---|
<K,V> Map<K,V> |
createLRUCache(int maximumCacheSize)
Constructs an empty LRUCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
<K,V> Map<K,V> |
createLRUCache(int maximumCacheSize,
Consumer<V> onEvict)
Constructs an empty LRUCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
<K,V> Map<K,V> |
createLRUCache(int initialCapacity,
int maximumCacheSize)
Constructs an empty LRUCache instance with the
specified initial capacity, maximumCacheSize, and will stop on eviction.
|
<K,V> Map<K,V> |
createLRUCache(int initialCapacity,
int maximumCacheSize,
boolean stopOnEviction)
Constructs an empty LRUCache instance with the
specified initial capacity, maximumCacheSize,load factor and ordering mode.
|
<K,V> Map<K,V> |
createLRUSoftCache(int maximumCacheSize)
Constructs an empty LRUSoftCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
<K,V> Map<K,V> |
createLRUSoftCache(int initialCapacity,
int maximumCacheSize)
Constructs an empty LRUSoftCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
<K,V> Map<K,V> |
createLRUSoftCache(int initialCapacity,
int maximumCacheSize,
boolean stopOnEviction)
Constructs an empty LRUSoftCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
<K,V> Map<K,V> |
createLRUWeakCache(int maximumCacheSize)
Constructs an empty LRUWeakCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
<K,V> Map<K,V> |
createLRUWeakCache(int initialCapacity,
int maximumCacheSize)
Constructs an empty LRUWeakCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
<K,V> Map<K,V> |
createLRUWeakCache(int initialCapacity,
int maximumCacheSize,
boolean stopOnEviction)
Constructs an empty LRUWeakCache instance with the
specified maximumCacheSize, and will stop on eviction.
|
String |
toString() |
static void |
warmUp()
Warm-up the LRUCache to startup Apache Camel faster.
|
public static void warmUp()
public <K,V> Map<K,V> createLRUCache(int maximumCacheSize)
createLRUCache in class org.apache.camel.support.LRUCacheFactorymaximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUCache(int maximumCacheSize, Consumer<V> onEvict)
createLRUCache in class org.apache.camel.support.LRUCacheFactorymaximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUCache(int initialCapacity, int maximumCacheSize)
createLRUCache in class org.apache.camel.support.LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction)
createLRUCache in class org.apache.camel.support.LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.stopOnEviction - whether to stop service on eviction.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUSoftCache(int maximumCacheSize)
createLRUSoftCache in class org.apache.camel.support.LRUCacheFactorymaximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUSoftCache(int initialCapacity, int maximumCacheSize)
createLRUSoftCache in class org.apache.camel.support.LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUSoftCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction)
createLRUSoftCache in class org.apache.camel.support.LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.stopOnEviction - whether to stop service on eviction.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUWeakCache(int maximumCacheSize)
createLRUWeakCache in class org.apache.camel.support.LRUCacheFactorymaximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUWeakCache(int initialCapacity, int maximumCacheSize)
createLRUWeakCache in class org.apache.camel.support.LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUWeakCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction)
createLRUWeakCache in class org.apache.camel.support.LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.stopOnEviction - whether to stop service on eviction.IllegalArgumentException - if the initial capacity is negativeApache Camel