日期:2014-05-17  浏览次数:21052 次

AspectJ中使用CGLIB

在spring中,当对没有实现接口的类使用aspect的时候,可以使用CGLIB,<aop:aspectj-autoproxy proxy-target-class="true"/>

?

写道

@Aspect
@Component("updateInvocationDefinitionSource")
public class UpdateInvocationDefinitionSource {
???? @AfterReturning("execution(* com.mawujun.facade.MenuManager.save(..))")
???? public void saveMenu() throws Exception{

?????????? System.out.println("-----------------------");

????? }

}

??

?