Last active
March 9, 2021 14:33
-
-
Save mihaita-tinta/04f68e33ce970f9cedf4d4c8d1830e6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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