org.springframework.cache.interceptor
Class CompositeCacheDefinitionSource

java.lang.Object
  extended by org.springframework.cache.interceptor.CompositeCacheDefinitionSource
All Implemented Interfaces:
Serializable, CacheDefinitionSource

public class CompositeCacheDefinitionSource
extends Object
implements CacheDefinitionSource, Serializable

Composite CacheDefinitionSource implementation that iterates over a given array of CacheDefinitionSource instances.

Author:
Costin Leau
See Also:
Serialized Form

Constructor Summary
CompositeCacheDefinitionSource(CacheDefinitionSource[] cacheDefinitionSources)
          Create a new CompositeCachingDefinitionSource for the given sources.
 
Method Summary
 CacheDefinition getCacheDefinition(Method method, Class<?> targetClass)
          Return the cache operation definition for this method.
 CacheDefinitionSource[] getCacheDefinitionSources()
          Return the CacheDefinitionSource instances that this CompositeCachingDefinitionSource combines.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeCacheDefinitionSource

public CompositeCacheDefinitionSource(CacheDefinitionSource[] cacheDefinitionSources)
Create a new CompositeCachingDefinitionSource for the given sources.

Parameters:
cacheDefinitionSourcess - the CacheDefinitionSource instances to combine
Method Detail

getCacheDefinitionSources

public final CacheDefinitionSource[] getCacheDefinitionSources()
Return the CacheDefinitionSource instances that this CompositeCachingDefinitionSource combines.


getCacheDefinition

public CacheDefinition getCacheDefinition(Method method,
                                          Class<?> targetClass)
Description copied from interface: CacheDefinitionSource
Return the cache operation definition for this method. Return null if the method is not cacheable.

Specified by:
getCacheDefinition in interface CacheDefinitionSource
Parameters:
method - method
targetClass - target class. May be null, in which case the declaring class of the method must be used.
Returns:
CacheDefinition the matching cache operation definition, or null if none found