Top Description Fields Constructors Methods
org.springframework.cache.interceptor

public Class NamedCacheResolver

extends AbstractCacheResolver
Class Inheritance
Imports
java.util.Collection, .List, org.springframework.cache.CacheManager, org.springframework.lang.Nullable

A CacheResolver that forces the resolution to a configurable collection of name(s) against a given CacheManager.
Author
Stephane Nicoll
Since
4.1

Field Summary

Modifier and TypeField and Description
private Collection<String>

Constructor Summary

AccessConstructor and Description
public
public
NamedCacheResolver(CacheManager cacheManager, String... cacheNames)

Method Summary

Modifier and TypeMethod and Description
protected Collection<String>
getCacheNames(CacheOperationInvocationContext<?>
the context of the particular invocation
context
)

Implements abstract org.springframework.cache.interceptor.AbstractCacheResolver.getCacheNames.

Provide the name of the cache(s) to resolve against the current cache manager.
public void
setCacheNames(Collection<String> cacheNames)

Set the cache name(s) that this resolver should use.

Inherited from org.springframework.cache.interceptor.AbstractCacheResolver:
afterPropertiesSetgetCacheManagerresolveCachessetCacheManager

Field Detail

cacheNamesback to summary
private Collection<String> cacheNames
Annotations
@Nullable

Constructor Detail

NamedCacheResolverback to summary
public NamedCacheResolver()
NamedCacheResolverback to summary
public NamedCacheResolver(CacheManager cacheManager, String... cacheNames)

Method Detail

getCacheNamesback to summary
protected Collection<String> getCacheNames(CacheOperationInvocationContext<?> context)

Implements abstract org.springframework.cache.interceptor.AbstractCacheResolver.getCacheNames.

Doc from org.springframework.cache.interceptor.AbstractCacheResolver.getCacheNames.

Provide the name of the cache(s) to resolve against the current cache manager.

It is acceptable to return null to indicate that no cache could be resolved for this invocation.

Parameters
context:CacheOperationInvocationContext<?>

the context of the particular invocation

Returns:Collection<String>

the cache name(s) to resolve, or null if no cache should be resolved

Annotations
@Override
setCacheNamesback to summary
public void setCacheNames(Collection<String> cacheNames)

Set the cache name(s) that this resolver should use.