标签:int blog asp execution ring aspect show 传递 count
//args(trackNumber):表明传给playTrack的int参数,也会传给切入点 @Pointcut("execution(* com.zte.sound.service.bean.CompactDisc.playTrack(int))"+" && args(trackNumber)") public void trackPlayed(int trackNumber){} @After("trackPlayed(trackNumber)") public void showCount(int trackNumber){ System.out.println("当前磁道播放了:"+trackNumber+"次"); }
com.zte.sound.service.bean.CompactDisc.playTrack(int num)在被调用时,
所传入的参数num,
作为切面类showCount方法的参数"trackNumber"传入
Spring4 In Action-4.3-@AspectJ-args-往切面传递参数
标签:int blog asp execution ring aspect show 传递 count
原文地址:http://www.cnblogs.com/zjsy/p/7588917.html