+ update AJ caching test
This commit is contained in:
Costin Leau 2010-12-16 21:25:12 +00:00
parent bbba832904
commit 58633e4a89
2 changed files with 7 additions and 7 deletions

View File

@ -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();
}

View File

@ -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();
}