Package org.apache.camel.support
Class DefaultLRUCacheFactory
java.lang.Object
org.apache.camel.support.LRUCacheFactory
org.apache.camel.support.DefaultLRUCacheFactory
Default
LRUCacheFactory which uses a LinkedHashMap based implementation.-
Field Summary
Fields inherited from class org.apache.camel.support.LRUCacheFactory
FACTORY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<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 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> 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> 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.Methods inherited from class org.apache.camel.support.LRUCacheFactory
getInstance, init, newLRUCache, newLRUCache, newLRUCache, newLRUCache, newLRUSoftCache, newLRUSoftCache, newLRUSoftCache, newLRUWeakCache, newLRUWeakCache, newLRUWeakCache, setLRUCacheFactory
-
Constructor Details
-
DefaultLRUCacheFactory
public DefaultLRUCacheFactory()
-
-
Method Details
-
createLRUCache
Constructs an empty LRUCache instance with the specified maximumCacheSize, and will stop on eviction.- Specified by:
createLRUCachein classLRUCacheFactory- Parameters:
maximumCacheSize- the max capacity.- Throws:
IllegalArgumentException- if the initial capacity is negative
-
createLRUCache
Constructs an empty LRUCache instance with the specified maximumCacheSize, and will stop on eviction.- Specified by:
createLRUCachein classLRUCacheFactory- Parameters:
maximumCacheSize- the max capacity.- Throws:
IllegalArgumentException- if the initial capacity is negative
-
createLRUCache
Constructs an empty LRUCache instance with the specified initial capacity, maximumCacheSize, and will stop on eviction.- Specified by:
createLRUCachein classLRUCacheFactory- Parameters:
initialCapacity- the initial capacity.maximumCacheSize- the max capacity.- Throws:
IllegalArgumentException- if the initial capacity is negative
-
createLRUCache
public <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.- Specified by:
createLRUCachein classLRUCacheFactory- Parameters:
initialCapacity- the initial capacity.maximumCacheSize- the max capacity.stopOnEviction- whether to stop service on eviction.- Throws:
IllegalArgumentException- if the initial capacity is negative
-
createLRUSoftCache
Constructs an empty LRUSoftCache instance with the specified maximumCacheSize, and will stop on eviction.- Specified by:
createLRUSoftCachein classLRUCacheFactory- Parameters:
maximumCacheSize- the max capacity.- Throws:
IllegalArgumentException- if the initial capacity is negative
-
createLRUSoftCache
Description copied from class:LRUCacheFactoryConstructs an empty LRUSoftCache instance with the specified maximumCacheSize, and will stop on eviction.- Specified by:
createLRUSoftCachein classLRUCacheFactory- Parameters:
initialCapacity- the initial capacity.maximumCacheSize- the max capacity.
-
createLRUSoftCache
public <K,V> Map<K,V> createLRUSoftCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction) Description copied from class:LRUCacheFactoryConstructs an empty LRUSoftCache instance with the specified maximumCacheSize, and will stop on eviction.- Specified by:
createLRUSoftCachein classLRUCacheFactory- Parameters:
initialCapacity- the initial capacity.maximumCacheSize- the max capacity.stopOnEviction- whether to stop service on eviction.
-
createLRUWeakCache
Constructs an empty LRUWeakCache instance with the specified maximumCacheSize, and will stop on eviction.- Specified by:
createLRUWeakCachein classLRUCacheFactory- Parameters:
maximumCacheSize- the max capacity.- Throws:
IllegalArgumentException- if the initial capacity is negative
-
createLRUWeakCache
Description copied from class:LRUCacheFactoryConstructs an empty LRUWeakCache instance with the specified maximumCacheSize, and will stop on eviction.- Specified by:
createLRUWeakCachein classLRUCacheFactory- Parameters:
initialCapacity- the initial capacity.maximumCacheSize- the max capacity.
-
createLRUWeakCache
public <K,V> Map<K,V> createLRUWeakCache(int initialCapacity, int maximumCacheSize, boolean stopOnEviction) Description copied from class:LRUCacheFactoryConstructs an empty LRUWeakCache instance with the specified maximumCacheSize, and will stop on eviction.- Specified by:
createLRUWeakCachein classLRUCacheFactory- Parameters:
initialCapacity- the initial capacity.maximumCacheSize- the max capacity.stopOnEviction- whether to stop service on eviction.
-