본문 바로가기
Development/Java

[Spring In Action]정규표현식 포인트컷 선언

by 폴피드 2011. 9. 6.
728x90
반응형
포인트컷은 어드바이스가 적용돼야할 메서드를 골라내는것

pointcut 정의
  1. <bean id="performancePointcut" class="org.springframework.aop.support.JdkRegexpMethodPointcut">
  2.     <prorperty name="pattern" value=".*perform">
  3. </prorperty></bean>
advice와 pointcut 결합
  1. <bean id="audienceAdvisor" class="org.springframework.aop.support.DefaultPointcutAdvisor">
  2.     <prorperty name="advice" ref="audienceAdvice">
  3.     <prorperty name="pointcut" ref="performancePointcut">
  4. </prorperty></prorperty></bean>
하나의 빈 설정으로 pointcut과 advice 동시정의
  1. <bean id="audienceAdvisor" class="org.springframework.aop.support.RegexpMethodPointcutAdvisor">
  2.     <prorperty name="advice" ref="audienceAdvice">
  3.     <prorperty name="pointcut" ref=".*perform">
  4. </prorperty></prorperty></bean>


728x90
반응형