DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Stefan has posted 2 posts at DZone. View Full User Profile

Aop Timing Aspect With <aop:config> Style

06.05.2009
| 3110 views |
  • submit to reddit
        <aop:config> way of doing http://dhruba.name/2008/12/16/spring-aop-timing-aspect/

// description of your code here
  <bean class="a.TimingAspect" name="timingAspectBean" />
  <aop:config>
  	  <aop:aspect ref="timingAspectBean">
	  	  <aop:pointcut id="classTimingOperation" expression="within(@a.Timed *) and @target(timed)"/>
	      <aop:around method="time" pointcut-ref="classTimingOperation" />
	  	  <aop:pointcut id="methodTimingOperation" expression="@annotation(a.Timed) and @annotation(timed)" />
	      <aop:around method="time" pointcut-ref="methodTimingOperation" /> 
      </aop:aspect>
  </aop:config>