Top Description Methods
org.springframework.cache.annotation

public @Interface CacheConfig

extends Annotation
Annotations
@Target:TYPE
@Retention:RUNTIME
@Documented
Imports
java.lang.annotation.Documented, .ElementType, .Retention, .RetentionPolicy, .Target

@CacheConfig provides a mechanism for sharing common cache-related settings at the class level.

When this annotation is present on a given class, it provides a set of default settings for any cache operation defined in that class.

Authors
Stephane Nicoll, Sam Brannen
Since
4.1
See Also
Cacheable

Method Summary

Modifier and TypeMethod and Description
public String
cacheManager()

The bean name of the custom org.springframework.cache.CacheManager to use to create a default org.springframework.cache.interceptor.CacheResolver if none is set already.

public String[]
cacheNames()

Names of the default caches to consider for caching operations defined in the annotated class.

public String
public String
keyGenerator()

The bean name of the default org.springframework.cache.interceptor.KeyGenerator to use for the class.

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

cacheManagerback to summary
public String cacheManager()

The bean name of the custom org.springframework.cache.CacheManager to use to create a default org.springframework.cache.interceptor.CacheResolver if none is set already.

If no resolver and no cache manager are set at the operation level, and no cache resolver is set via cacheResolver, this one is used instead of the default.

See Also
org.springframework.cache.interceptor.SimpleCacheResolver
cacheNamesback to summary
public String[] cacheNames()

Names of the default caches to consider for caching operations defined in the annotated class.

If none is set at the operation level, these are used instead of the default.

Names may be used to determine the target cache(s), to be resolved via the configured cacheResolver() which typically delegates to org.springframework.cache.CacheManager#getCache. For further details see Cacheable#cacheNames().

cacheResolverback to summary
public String cacheResolver()

The bean name of the custom org.springframework.cache.interceptor.CacheResolver to use.

If no resolver and no cache manager are set at the operation level, this one is used instead of the default.

keyGeneratorback to summary
public String keyGenerator()

The bean name of the default org.springframework.cache.interceptor.KeyGenerator to use for the class.

If none is set at the operation level, this one is used instead of the default.

The key generator is mutually exclusive with the use of a custom key. When such key is defined for the operation, the value of this key generator is ignored.