SPR-7308
+ update AJ caching test git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@3821 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
49c8df65d7
commit
4c8186f2a9
|
|
@ -24,7 +24,7 @@ import org.springframework.cache.annotation.Cacheable;
|
||||||
/**
|
/**
|
||||||
* @author Costin Leau
|
* @author Costin Leau
|
||||||
*/
|
*/
|
||||||
@Cacheable
|
@Cacheable("default")
|
||||||
public class AnnotatedClassCacheableService implements CacheableService {
|
public class AnnotatedClassCacheableService implements CacheableService {
|
||||||
|
|
||||||
private AtomicLong counter = new AtomicLong();
|
private AtomicLong counter = new AtomicLong();
|
||||||
|
|
@ -37,11 +37,11 @@ public class AnnotatedClassCacheableService implements CacheableService {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@CacheEvict
|
@CacheEvict("default")
|
||||||
public void invalidate(Object arg1) {
|
public void invalidate(Object arg1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cacheable(key = "#p0")
|
@Cacheable(value = "default", key = "#p0")
|
||||||
public Object key(Object arg1, Object arg2) {
|
public Object key(Object arg1, Object arg2) {
|
||||||
return counter.getAndIncrement();
|
return counter.getAndIncrement();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,21 +31,21 @@ public class DefaultCacheableService implements CacheableService<Long> {
|
||||||
|
|
||||||
private AtomicLong counter = new AtomicLong();
|
private AtomicLong counter = new AtomicLong();
|
||||||
|
|
||||||
@Cacheable
|
@Cacheable("default")
|
||||||
public Long cache(Object arg1) {
|
public Long cache(Object arg1) {
|
||||||
return counter.getAndIncrement();
|
return counter.getAndIncrement();
|
||||||
}
|
}
|
||||||
|
|
||||||
@CacheEvict
|
@CacheEvict("default")
|
||||||
public void invalidate(Object arg1) {
|
public void invalidate(Object arg1) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cacheable(condition = "#classField == 3")
|
@Cacheable(value = "default", condition = "#classField == 3")
|
||||||
public Long conditional(int classField) {
|
public Long conditional(int classField) {
|
||||||
return counter.getAndIncrement();
|
return counter.getAndIncrement();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Cacheable(key = "#p0")
|
@Cacheable(value = "default", key = "#p0")
|
||||||
public Long key(Object arg1, Object arg2) {
|
public Long key(Object arg1, Object arg2) {
|
||||||
return counter.getAndIncrement();
|
return counter.getAndIncrement();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue