Class CompositeCacheOperationSource
- java.lang.Object
- org.springframework.cache.interceptor.CompositeCacheOperationSource
- All Implemented Interfaces:
Serializable,CacheOperationSource
public class CompositeCacheOperationSource extends Object implements CacheOperationSource, Serializable
CompositeCacheOperationSourceimplementation that iterates over a given array ofCacheOperationSourceinstances.- Since:
- 3.1
- Author:
- Costin Leau, Juergen Hoeller
- See Also:
- Serialized Form
Constructor Summary
Constructors Constructor Description CompositeCacheOperationSource(CacheOperationSource... cacheOperationSources)Create a new CompositeCacheOperationSource for the given sources.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<CacheOperation>getCacheOperations(Method method, Class<?> targetClass)Return the collection of cache operations for this method, ornullif the method contains no cacheable annotations.CacheOperationSource[]getCacheOperationSources()Return theCacheOperationSourceinstances that thisCompositeCacheOperationSourcecombines.
Constructor Detail
CompositeCacheOperationSource
public CompositeCacheOperationSource(CacheOperationSource... cacheOperationSources)
Create a new CompositeCacheOperationSource for the given sources.- Parameters:
cacheOperationSources- the CacheOperationSource instances to combine
Method Detail
getCacheOperationSources
public final CacheOperationSource[] getCacheOperationSources()
Return theCacheOperationSourceinstances that thisCompositeCacheOperationSourcecombines.
getCacheOperations
public Collection<CacheOperation> getCacheOperations(Method method, Class<?> targetClass)
Description copied from interface:CacheOperationSourceReturn the collection of cache operations for this method, ornullif the method contains no cacheable annotations.- Specified by:
getCacheOperationsin interfaceCacheOperationSource- Parameters:
method- the method to introspecttargetClass- the target class (may benull, in which case the declaring class of the method must be used)- Returns:
- all cache operations for this method, or
nullif none found