public class MemoryConstrainedCacheManager extends AbstractCacheManager
CacheManager
implementation usable in production
environments. It will not cause memory leaks as it produces Cache
s backed by
SoftHashMap
s which auto-size themselves based on the runtime environment's memory
limitations and garbage collection behavior.
While the Cache
instances created are thread-safe, they do not offer any enterprise-level features such as
cache coherency, optimistic locking, failover or other similar features. For more enterprise features, consider
using a different CacheManager
implementation backed by an enterprise-grade caching product (Hazelcast,
EhCache, TerraCotta, Coherence, GigaSpaces, etc, etc).Constructor and Description |
---|
MemoryConstrainedCacheManager() |
Modifier and Type | Method and Description |
---|---|
protected Cache |
createCache(String name)
Returns a new
MapCache instance backed by a SoftHashMap . |
destroy, getCache, toString
public MemoryConstrainedCacheManager()
protected Cache createCache(String name)
MapCache
instance backed by a SoftHashMap
.createCache
in class AbstractCacheManager
name
- the name of the cacheMapCache
instance backed by a SoftHashMap
.Copyright © 2004–2017 The Apache Software Foundation. All rights reserved.