import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.ProceedingJoinPoint;
@Aspect
public class AroundExample {
@Around("com.xyz.myapp.SystemArchitecture.businessService()")
public Object doBasicProfiling(ProceedingJoinPoint pjp) throws Throwable {
// start stopwatch
Object retVal = pjp.proceed();
// stop stopwatch
return retVal;
}
}
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You will need current version of aspectj jars i.e. aspectjrt-1.6.6.jar
and aspectjweaver-1.7.2.jar
with other jars shown in the below image to work with AspectJ of Spring framework.
回答2:
this is link to get jars
回答3:
The link provided in the accepted answer didn't work for me. So I had to get the jar from somewhere else. This is the LINK
The file is aspectjrt-1.6.6.jar
回答4:
You can use this to find jars http://findjar.com
回答5:
aspectj-N.N.NN.jar
, where N is the version number. See the AspectJ download site.