AspectJ的Eclipse插件下载:http://www.eclipse.org/aspectj/downloads.php
测试代码如下:
普通的Java类:
















aspectj类:
HelloWorld.aj













ExecutionRecipe.aj













AdviceExecutionRecipe.aj












输出:
aspect adviceexecution
aspect call
aspect adviceexecution
aspect execution
Inside foo (int, String)