---
title: "AspectJ中使用CGLIB"
author: "black_angle"
date: "2010-04-27T11:32:01Z"
tags: []
categories: ["企业架构"]
slug: "aspectj-cglib"
draft: false
lastmod: "2010-04-27T11:34:59Z"
id: 654007
url: "https://black-angle.iteye.com/blog/654007"
---

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

 

写道

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

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

      }

}