public class DefaultLRUCacheFactory extends LRUCacheFactory
LRUCacheFactory which uses a LinkedHashMap based implementation.FACTORY| Constructor and Description |
|---|
DefaultLRUCacheFactory() |
| 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.
|
getInstance, init, newLRUCache, newLRUCache, newLRUCache, newLRUCache, newLRUSoftCache, newLRUSoftCache, newLRUSoftCache, newLRUWeakCache, newLRUWeakCache, newLRUWeakCache, setLRUCacheFactorypublic <K,V> Map<K,V> createLRUCache(int maximumCacheSize)
createLRUCache in class 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 LRUCacheFactorymaximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUCache(int initialCapacity, int maximumCacheSize)
createLRUCache in class 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 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 LRUCacheFactorymaximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUSoftCache(int initialCapacity, int maximumCacheSize)
LRUCacheFactorycreateLRUSoftCache in class LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.public <K,V> Map<K,V> createLRUSoftCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction)
LRUCacheFactorycreateLRUSoftCache in class LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.stopOnEviction - whether to stop service on eviction.public <K,V> Map<K,V> createLRUWeakCache(int maximumCacheSize)
createLRUWeakCache in class LRUCacheFactorymaximumCacheSize - the max capacity.IllegalArgumentException - if the initial capacity is negativepublic <K,V> Map<K,V> createLRUWeakCache(int initialCapacity, int maximumCacheSize)
LRUCacheFactorycreateLRUWeakCache in class LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.public <K,V> Map<K,V> createLRUWeakCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction)
LRUCacheFactorycreateLRUWeakCache in class LRUCacheFactoryinitialCapacity - the initial capacity.maximumCacheSize - the max capacity.stopOnEviction - whether to stop service on eviction.Apache Camel