Skip to content

Instantly share code, notes, and snippets.

@mihaita-tinta
Last active March 9, 2021 14:33
Show Gist options
  • Save mihaita-tinta/04f68e33ce970f9cedf4d4c8d1830e6c to your computer and use it in GitHub Desktop.
Save mihaita-tinta/04f68e33ce970f9cedf4d4c8d1830e6c to your computer and use it in GitHub Desktop.
package com.mihaita.articles.caching;
import org.springframework.aop.Advisor;
import org.springframework.aop.aspectj.AspectJExpressionPointcut;
import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import java.util.Arrays;
@Configuration
@EnableAspectJAutoProxy
public class CompletableFutureCacheableConfiguration {
@Bean
public Advisor advisor() {
AspectJExpressionPointcut pointcut = new AspectJExpressionPointcut();
pointcut.setExpression("@annotation(com.mihaita.articles.caching.CompletableFutureCacheable)");
return new DefaultPointcutAdvisor(pointcut, new CompletableFutureCacheableMethodInterceptor(Arrays.asList("cf1", "cf2")));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment