Search in sources :

Example 1 with CachePutOperation

use of cn.taketoday.cache.interceptor.CachePutOperation in project today-infrastructure by TAKETODAY.

the class DefaultCacheAnnotationParser method parsePutAnnotation.

private CacheOperation parsePutAnnotation(AnnotatedElement ae, DefaultCacheConfig defaultConfig, CachePut cachePut) {
    CachePutOperation.Builder builder = new CachePutOperation.Builder();
    builder.setName(ae.toString());
    builder.setCacheNames(cachePut.cacheNames());
    builder.setCondition(cachePut.condition());
    builder.setUnless(cachePut.unless());
    builder.setKey(cachePut.key());
    builder.setKeyGenerator(cachePut.keyGenerator());
    builder.setCacheManager(cachePut.cacheManager());
    builder.setCacheResolver(cachePut.cacheResolver());
    defaultConfig.applyDefault(builder);
    CachePutOperation op = builder.build();
    validateCacheOperation(ae, op);
    return op;
}
Also used : CachePutOperation(cn.taketoday.cache.interceptor.CachePutOperation)

Example 2 with CachePutOperation

use of cn.taketoday.cache.interceptor.CachePutOperation in project today-framework by TAKETODAY.

the class DefaultCacheAnnotationParser method parsePutAnnotation.

private CacheOperation parsePutAnnotation(AnnotatedElement ae, DefaultCacheConfig defaultConfig, CachePut cachePut) {
    CachePutOperation.Builder builder = new CachePutOperation.Builder();
    builder.setName(ae.toString());
    builder.setCacheNames(cachePut.cacheNames());
    builder.setCondition(cachePut.condition());
    builder.setUnless(cachePut.unless());
    builder.setKey(cachePut.key());
    builder.setKeyGenerator(cachePut.keyGenerator());
    builder.setCacheManager(cachePut.cacheManager());
    builder.setCacheResolver(cachePut.cacheResolver());
    defaultConfig.applyDefault(builder);
    CachePutOperation op = builder.build();
    validateCacheOperation(ae, op);
    return op;
}
Also used : CachePutOperation(cn.taketoday.cache.interceptor.CachePutOperation)

Aggregations

CachePutOperation (cn.taketoday.cache.interceptor.CachePutOperation)2