일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- Greedy
- db
- Exception
- Proxy
- java
- http
- 김영한
- JPQL
- QueryDSL
- 백준
- Android
- kotlin
- Thymeleaf
- SpringBoot
- 자바
- 인프런
- springdatajpa
- transaction
- spring
- JDBC
- AOP
- Servlet
- 그리디
- 스프링 핵심 기능
- jpa
- pointcut
- Spring Boot
- 알고리즘
- 스프링
- 스프링 핵심 원리
- Today
- Total
목록DefaultPointcutAdvisor (2)
개발자되기 프로젝트
save() 메서드에는 어드바이스 로직을 적용하지만, find() 메서드에는 어드바이스 로직을 적용하지 말자. 이런 기능에 특화되어서 제공되는 것이 바로 포인트컷이다. 1. Pointcut관련 인터페이스 - 스프링 public interface Pointcut { ClassFilter getClassFilter(); MethodMatcher getMethodMatcher(); } public interface ClassFilter { boolean matches(Class clazz); } public interface MethodMatcher { boolean matches(Method method, Class targetClass); //.. } 포인트컷은 크게 ClassFilter 와 MethodM..
어드바이저는 하나의 포인트컷과 하나의 어드바이스를 가지고 있다. 프록시 팩토리를 통해 프록시를 생성할 때 어드바이저를 제공하면 어디에 어떤 기능을 제공할 지 알 수 있다. 1. 예제코드 public class AdvisorTest { @Test void advisorTest1(){ ServiceInterface target = new ServiceImpl(); ProxyFactory proxyFactory = new ProxyFactory(target); DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(Pointcut.TRUE, new TimeAdvice()); proxyFactory.addAdvisor(advisor); ServiceInterf..