Aop:pointcut의 정규표현식

From JCFWiKi

Jump to: navigation, search

[편집] <aop:config>

  • 트랜젝션을 처리할 대상을 넣음

그림:information.gif

참조:

[편집] 공통모듈에서의 정규표현식

  • applicationContext-aop.xml
	<aop:config>
	   <aop:pointcut id="serviceOperation" expression="execution(* *..*Service.*(..))"/>
	   <aop:advisor advice-ref="txAdvice" pointcut-ref="serviceOperation"/>	
	</aop:config>
  • 설명
    • *_:모든 형태의 가시성(public,proteced..)을 가지는 메소드
    • *..:모든 패키지명
    • *Service:클래스명이 Service로 끝나는 클래스
    • .*(..)):모든 형태의 파라미터를 가지는 모든 메소드

그림:warning.gif

* *..*Service.*(..)): 모든형태의 가시성을 가지는 모든 패키지명에서 클래스명이 Service로 끝나는 클래스의 모든 형태의 파라미터