public abstract class AbstractCacheResolver extends java.lang.Object implements CacheResolver, 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()
Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
|
CacheManager |
getCacheManager()
Return the
CacheManager that this instance uses. |
protected abstract java.util.Collection<java.lang.String> |
getCacheNames(CacheOperationInvocationContext<?> context)
Provide the name of the cache(s) to resolve against the current cache manager.
|
java.util.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 uses.public void afterPropertiesSet()
InitializingBean
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface InitializingBean
public java.util.Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context)
CacheResolver
resolveCaches
in interface CacheResolver
context
- the context of the particular invocationnull
)protected abstract java.util.Collection<java.lang.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