一个简单的例子:
public class DemoMain {
public static void main(String[] args) throws Exception {
Student student = new Student();
AspectJProxyFactory aspectJProxyFactory = new AspectJProxyFactory(student);
aspectJProxyFactory.addAspect(MyAspect.class);
aspectJProxyFactory.setProxyTargetClass(true);
HelloServiceStaticMethodMatcherPointcut cut =
new HelloServiceStaticMethodMatcherPointcut("saySomeThing", Student.class);
DefaultPointcutAdvisor advisor = new DefaultPointcutAdvisor(cut,new MethodInterceptor() {
@Override
public Object invoke(MethodInvocation invocation) throws Throwable {
System.out.println("Defau