public class AerospikeCacheManager
extends org.springframework.cache.transaction.AbstractTransactionSupportingCacheManager
CacheManager implementation for Aerospike. By default AerospikeCaches
will be lazily initialized for each getCache(String) request unless a set of
predefined cache names is provided. AbstractTransactionSupportingCacheManager.setTransactionAware(boolean) to true will force Caches to
be decorated as TransactionAwareCacheDecorator so values will only be written
to the cache after successful commit of surrounding transaction.| Modifier and Type | Class and Description |
|---|---|
class |
AerospikeCacheManager.AerospikeSerializingCache |
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DEFAULT_SET_NAME |
| Constructor and Description |
|---|
AerospikeCacheManager(com.aerospike.client.AerospikeClient aerospikeClient,
java.util.Collection<java.lang.String> cacheNames,
MappingAerospikeConverter aerospikeConverter)
Create a new
AerospikeCacheManager instance with the specified caches and
with the set name "aerospike". |
AerospikeCacheManager(com.aerospike.client.AerospikeClient aerospikeClient,
java.util.Collection<java.lang.String> cacheNames,
java.lang.String setName,
MappingAerospikeConverter aerospikeConverter)
Create a new
AerospikeCacheManager instance with the specified caches and
with the specified set name. |
AerospikeCacheManager(com.aerospike.client.AerospikeClient aerospikeClient,
MappingAerospikeConverter aerospikeConverter)
Create a new
AerospikeCacheManager instance with no caches and with the
set name "aerospike". |
AerospikeCacheManager(com.aerospike.client.AerospikeClient aerospikeClient,
java.lang.String setName,
MappingAerospikeConverter aerospikeConverter)
Create a new
AerospikeCacheManager instance with no caches and with the
specified set name. |
| Modifier and Type | Method and Description |
|---|---|
protected AerospikeCache |
createCache(java.lang.String cacheName) |
protected org.springframework.cache.Cache |
decorateCache(org.springframework.cache.Cache cache) |
org.springframework.cache.Cache |
getCache(java.lang.String name) |
protected org.springframework.cache.Cache |
getMissingCache(java.lang.String cacheName) |
protected boolean |
isCacheAlreadyDecorated(org.springframework.cache.Cache cache) |
protected java.util.Collection<? extends org.springframework.cache.Cache> |
loadCaches() |
protected org.springframework.cache.Cache |
lookupAerospikeCache(java.lang.String name) |
isTransactionAware, setTransactionAwareprotected static final java.lang.String DEFAULT_SET_NAME
public AerospikeCacheManager(com.aerospike.client.AerospikeClient aerospikeClient,
MappingAerospikeConverter aerospikeConverter)
AerospikeCacheManager instance with no caches and with the
set name "aerospike".aerospikeClient - the AerospikeClient instance.aerospikeConverter - public AerospikeCacheManager(com.aerospike.client.AerospikeClient aerospikeClient,
java.lang.String setName,
MappingAerospikeConverter aerospikeConverter)
AerospikeCacheManager instance with no caches and with the
specified set name.aerospikeClient - the AerospikeClient instance.setName - the set name.aerospikeConverter - public AerospikeCacheManager(com.aerospike.client.AerospikeClient aerospikeClient,
java.util.Collection<java.lang.String> cacheNames,
MappingAerospikeConverter aerospikeConverter)
AerospikeCacheManager instance with the specified caches and
with the set name "aerospike".aerospikeClient - the AerospikeClient instance.cacheNames - the default caches to create.aerospikeConverter - public AerospikeCacheManager(com.aerospike.client.AerospikeClient aerospikeClient,
java.util.Collection<java.lang.String> cacheNames,
java.lang.String setName,
MappingAerospikeConverter aerospikeConverter)
AerospikeCacheManager instance with the specified caches and
with the specified set name.aerospikeClient - the AerospikeClient instance.cacheNames - the default caches to create.setName - the set name.aerospikeConverter - protected java.util.Collection<? extends org.springframework.cache.Cache> loadCaches()
loadCaches in class org.springframework.cache.support.AbstractCacheManagerprotected org.springframework.cache.Cache getMissingCache(java.lang.String cacheName)
getMissingCache in class org.springframework.cache.support.AbstractCacheManagerprotected AerospikeCache createCache(java.lang.String cacheName)
public org.springframework.cache.Cache getCache(java.lang.String name)
getCache in interface org.springframework.cache.CacheManagergetCache in class org.springframework.cache.support.AbstractCacheManagerprotected org.springframework.cache.Cache lookupAerospikeCache(java.lang.String name)
protected org.springframework.cache.Cache decorateCache(org.springframework.cache.Cache cache)
decorateCache in class org.springframework.cache.transaction.AbstractTransactionSupportingCacheManagerprotected boolean isCacheAlreadyDecorated(org.springframework.cache.Cache cache)