SPR-7308
+ add support for multiple cache names + require each annotation to specify a cache name + add method support in Key generator interface + add bug fix for embedded JDK concurrent declaration
This commit is contained in:
@@ -24,7 +24,7 @@ import org.springframework.cache.annotation.Cacheable;
|
||||
/**
|
||||
* @author Costin Leau
|
||||
*/
|
||||
@Cacheable
|
||||
@Cacheable("default")
|
||||
public class AnnotatedClassCacheableService implements CacheableService {
|
||||
|
||||
private AtomicLong counter = new AtomicLong();
|
||||
@@ -37,11 +37,11 @@ public class AnnotatedClassCacheableService implements CacheableService {
|
||||
return null;
|
||||
}
|
||||
|
||||
@CacheEvict
|
||||
@CacheEvict("default")
|
||||
public void invalidate(Object arg1) {
|
||||
}
|
||||
|
||||
@Cacheable(key = "#p0")
|
||||
@Cacheable(value = "default", key = "#p0")
|
||||
public Object key(Object arg1, Object arg2) {
|
||||
return counter.getAndIncrement();
|
||||
}
|
||||
|
||||
@@ -31,21 +31,21 @@ public class DefaultCacheableService implements CacheableService<Long> {
|
||||
|
||||
private AtomicLong counter = new AtomicLong();
|
||||
|
||||
@Cacheable
|
||||
@Cacheable("default")
|
||||
public Long cache(Object arg1) {
|
||||
return counter.getAndIncrement();
|
||||
}
|
||||
|
||||
@CacheEvict
|
||||
@CacheEvict("default")
|
||||
public void invalidate(Object arg1) {
|
||||
}
|
||||
|
||||
@Cacheable(condition = "#classField == 3")
|
||||
@Cacheable(value = "default", condition = "#classField == 3")
|
||||
public Long conditional(int classField) {
|
||||
return counter.getAndIncrement();
|
||||
}
|
||||
|
||||
@Cacheable(key = "#p0")
|
||||
@Cacheable(value = "default", key = "#p0")
|
||||
public Long key(Object arg1, Object arg2) {
|
||||
return counter.getAndIncrement();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user