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

  • submit to reddit
        <aop:config> way of doing

// description of your code here
  <bean class="a.TimingAspect" name="timingAspectBean" />
  	  <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" />