Top Description Constructors Methods
org.springframework.cache.interceptor

public Class SimpleCacheResolver

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

A simple CacheResolver that resolves the Cache instance(s) based on a configurable CacheManager and the name of the cache(s) as provided by getCacheNames().
Authors
Stephane Nicoll, Juergen Hoeller
Since
4.1
See Also
BasicOperation#getCacheNames()

Constructor Summary

AccessConstructor and Description
public
SimpleCacheResolver()

Construct a new SimpleCacheResolver.

public
SimpleCacheResolver(CacheManager
the CacheManager to use
cacheManager
)

Construct a new SimpleCacheResolver for the given CacheManager.

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.

pack-priv static SimpleCacheResolver

Returns:

the SimpleCacheResolver (null if the CacheManager was null)
of
(CacheManager
the CacheManager (potentially null)
cacheManager
)

Return a SimpleCacheResolver for the given CacheManager.

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

Constructor Detail

SimpleCacheResolverback to summary
public SimpleCacheResolver()

Construct a new SimpleCacheResolver.

See Also
setCacheManager
SimpleCacheResolverback to summary
public SimpleCacheResolver(CacheManager cacheManager)

Construct a new SimpleCacheResolver for the given CacheManager.

Parameters
cacheManager:CacheManager

the CacheManager to use

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
ofback to summary
pack-priv static SimpleCacheResolver of(CacheManager cacheManager)

Return a SimpleCacheResolver for the given CacheManager.

Parameters
cacheManager:CacheManager

the CacheManager (potentially null)

Returns:SimpleCacheResolver

the SimpleCacheResolver (null if the CacheManager was null)

Annotations
@Nullable
Since
5.1