public class SSMCache extends Object implements org.springframework.cache.Cache
Cache
that allow to set default expiration time used in all
put(Object, Object)
(
Cache.set(String, int, Object, com.google.code.ssm.api.format.SerializationType)
)
requests.Modifier and Type | Class and Description |
---|---|
static class |
SSMCache.ValueRetrievalException
A custom exception class because org.springframework.cache.Cache.ValueRetrievalException cannot be used
as it is declared in Spring 4.3 but SSM shouldn't required newest Spring version.
|
Constructor and Description |
---|
SSMCache(Cache cache,
int expiration) |
SSMCache(Cache cache,
int expiration,
boolean allowClear) |
SSMCache(Cache cache,
int expiration,
boolean allowClear,
boolean registerAliases,
boolean muteExceptions) |
SSMCache(SSMCache ssmCache,
int expiration) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
evict(Object key) |
org.springframework.cache.Cache.ValueWrapper |
get(Object key) |
<T> T |
get(Object key,
Callable<T> valueLoader)
Required by Spring 4.3
|
<T> T |
get(Object key,
Class<T> type)
Required by Spring 4.0
|
Cache |
getCache() |
int |
getExpiration()
An expiration time is specified in seconds.
|
String |
getName() |
Object |
getNativeCache() |
boolean |
isAllowClear() |
boolean |
isMuteExceptions()
If true exceptions thrown by underlying cache are muted and aren't forwarded to Spring Cache Abstraction,
it's behaviour of SSM before 4.0.0.
|
boolean |
isRegisterAliases()
If true then all aliases of the underlying cache will be used to register the cache in Spring, otherwise the
cache will be available only by name.
|
void |
put(Object key,
Object value) |
org.springframework.cache.Cache.ValueWrapper |
putIfAbsent(Object key,
Object value)
Required by Spring 4.1
|
public SSMCache(Cache cache, int expiration, boolean allowClear, boolean registerAliases, boolean muteExceptions)
public SSMCache(Cache cache, int expiration, boolean allowClear)
public SSMCache(Cache cache, int expiration)
public SSMCache(SSMCache ssmCache, int expiration)
public String getName()
getName
in interface org.springframework.cache.Cache
public Object getNativeCache()
getNativeCache
in interface org.springframework.cache.Cache
public org.springframework.cache.Cache.ValueWrapper get(Object key)
get
in interface org.springframework.cache.Cache
public <T> T get(Object key, Class<T> type)
get
in interface org.springframework.cache.Cache
public <T> T get(Object key, Callable<T> valueLoader)
get
in interface org.springframework.cache.Cache
public void put(Object key, Object value)
put
in interface org.springframework.cache.Cache
public org.springframework.cache.Cache.ValueWrapper putIfAbsent(Object key, Object value)
putIfAbsent
in interface org.springframework.cache.Cache
public void evict(Object key)
evict
in interface org.springframework.cache.Cache
public void clear()
clear
in interface org.springframework.cache.Cache
@Generated(value="lombok") public Cache getCache()
@Generated(value="lombok") public int getExpiration()
@Generated(value="lombok") public boolean isAllowClear()
@Generated(value="lombok") public boolean isMuteExceptions()
@Generated(value="lombok") public boolean isRegisterAliases()
Copyright © 2019. All rights reserved.