public class DefaultComputingCacheFactory extends AbstractConfigurationAware implements ComputingCacheFactory
ConcurrentHashMap
.Map.computeIfAbsent(Object, java.util.function.Function)
Modifier and Type | Class and Description |
---|---|
static class |
DefaultComputingCacheFactory.MaxSizeStrategy
Defines the strategy applied when the max size limit is set and exceeded.
|
static class |
DefaultComputingCacheFactory.RemovalCause |
configuration
Constructor and Description |
---|
DefaultComputingCacheFactory() |
DefaultComputingCacheFactory(DefaultComputingCacheFactory.MaxSizeStrategy maxSizeStrategy) |
Modifier and Type | Method and Description |
---|---|
<K,V> ComputingCache<K,V> |
create(String consumerId,
ComputingCache.Function<K,V> computingFunction,
Long expirationTimeout,
Long maxSize,
ComputingCache.Listener<K> listener)
The
ComputingCache implementations are not required to implement
eviction operations (expiration timeout, maximum size, listener). |
checkNotInitialized, init, init
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfigurationKeys, init
public DefaultComputingCacheFactory()
public DefaultComputingCacheFactory(DefaultComputingCacheFactory.MaxSizeStrategy maxSizeStrategy)
maxSizeStrategy
- public <K,V> ComputingCache<K,V> create(String consumerId, ComputingCache.Function<K,V> computingFunction, Long expirationTimeout, Long maxSize, ComputingCache.Listener<K> listener)
ComputingCacheFactory
ComputingCache
implementations are not required to implement
eviction operations (expiration timeout, maximum size, listener).
However, a ComputingCacheFactory
must either log a warning
message or throw a runtime exception in such cases.
Clients who require maximum performance should not make use of eviction operations.
create
in interface ComputingCacheFactory
consumerId
- Allow the factory to identify the cache consumerexpirationTimeout
- Expiration timeout in milliseconds - a cache entry may be
automatically removed from the cache when the specified amount
of time elapses after its creationmaxSize
- Maximum size of the cache, subsequent eviction operation is
implementation-specificCopyright © 2017. All rights reserved.