public abstract class AbstractCacheResolver extends Object implements CacheResolver, org.springframework.beans.factory.InitializingBean
CacheResolver
implementation that requires the concrete
implementation to provide the collection of cache name(s) based on the
invocation context.Modifier | Constructor and Description |
---|---|
protected |
AbstractCacheResolver() |
protected |
AbstractCacheResolver(CacheManager cacheManager) |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
CacheManager |
getCacheManager()
Return the
CacheManager that this instance use. |
protected abstract Collection<String> |
getCacheNames(CacheOperationInvocationContext<?> context)
Provide the name of the cache(s) to resolve against the current cache manager.
|
Collection<? extends Cache> |
resolveCaches(CacheOperationInvocationContext<?> context)
Return the cache(s) to use for the specified invocation.
|
void |
setCacheManager(CacheManager cacheManager)
Set the
CacheManager that this instance should use. |
protected AbstractCacheResolver()
protected AbstractCacheResolver(CacheManager cacheManager)
public void setCacheManager(CacheManager cacheManager)
CacheManager
that this instance should use.public CacheManager getCacheManager()
CacheManager
that this instance use.public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
public Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context)
CacheResolver
resolveCaches
in interface CacheResolver
context
- the context of the particular invocationnull
)protected abstract Collection<String> getCacheNames(CacheOperationInvocationContext<?> context)
It is acceptable to return null
to indicate that no cache could
be resolved for this invocation.
context
- the context of the particular invocationnull
if no cache should be resolved