use of cn.taketoday.cache.interceptor.CacheEvictOperation in project today-framework by TAKETODAY.
the class DefaultCacheAnnotationParser method parseEvictAnnotation.
private CacheEvictOperation parseEvictAnnotation(AnnotatedElement ae, DefaultCacheConfig defaultConfig, CacheEvict cacheEvict) {
CacheEvictOperation.Builder builder = new CacheEvictOperation.Builder();
builder.setName(ae.toString());
builder.setCacheNames(cacheEvict.cacheNames());
builder.setCondition(cacheEvict.condition());
builder.setKey(cacheEvict.key());
builder.setKeyGenerator(cacheEvict.keyGenerator());
builder.setCacheManager(cacheEvict.cacheManager());
builder.setCacheResolver(cacheEvict.cacheResolver());
builder.setCacheWide(cacheEvict.allEntries());
builder.setBeforeInvocation(cacheEvict.beforeInvocation());
defaultConfig.applyDefault(builder);
CacheEvictOperation op = builder.build();
validateCacheOperation(ae, op);
return op;
}
use of cn.taketoday.cache.interceptor.CacheEvictOperation in project today-framework by TAKETODAY.
the class AnnotationCacheOperationSourceTests method multipleStereotypes.
@Test
public void multipleStereotypes() {
Collection<CacheOperation> ops = getOps(AnnotatedClass.class, "multipleStereotype", 3);
Iterator<CacheOperation> it = ops.iterator();
assertThat(it.next() instanceof CacheableOperation).isTrue();
CacheOperation next = it.next();
assertThat(next instanceof CacheEvictOperation).isTrue();
assertThat(next.getCacheNames().contains("foo")).isTrue();
next = it.next();
assertThat(next instanceof CacheEvictOperation).isTrue();
assertThat(next.getCacheNames().contains("bar")).isTrue();
}
use of cn.taketoday.cache.interceptor.CacheEvictOperation in project today-infrastructure by TAKETODAY.
the class DefaultCacheAnnotationParser method parseEvictAnnotation.
private CacheEvictOperation parseEvictAnnotation(AnnotatedElement ae, DefaultCacheConfig defaultConfig, CacheEvict cacheEvict) {
CacheEvictOperation.Builder builder = new CacheEvictOperation.Builder();
builder.setName(ae.toString());
builder.setCacheNames(cacheEvict.cacheNames());
builder.setCondition(cacheEvict.condition());
builder.setKey(cacheEvict.key());
builder.setKeyGenerator(cacheEvict.keyGenerator());
builder.setCacheManager(cacheEvict.cacheManager());
builder.setCacheResolver(cacheEvict.cacheResolver());
builder.setCacheWide(cacheEvict.allEntries());
builder.setBeforeInvocation(cacheEvict.beforeInvocation());
defaultConfig.applyDefault(builder);
CacheEvictOperation op = builder.build();
validateCacheOperation(ae, op);
return op;
}
use of cn.taketoday.cache.interceptor.CacheEvictOperation in project today-infrastructure by TAKETODAY.
the class AnnotationCacheOperationSourceTests method multipleStereotypes.
@Test
public void multipleStereotypes() {
Collection<CacheOperation> ops = getOps(AnnotatedClass.class, "multipleStereotype", 3);
Iterator<CacheOperation> it = ops.iterator();
assertThat(it.next() instanceof CacheableOperation).isTrue();
CacheOperation next = it.next();
assertThat(next instanceof CacheEvictOperation).isTrue();
assertThat(next.getCacheNames().contains("foo")).isTrue();
next = it.next();
assertThat(next instanceof CacheEvictOperation).isTrue();
assertThat(next.getCacheNames().contains("bar")).isTrue();
}
Aggregations