package com.soft.factorybean;


import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class MyAspect implements MethodInterceptor {
    @Override
    public Object invoke(MethodInvocation mi) throws Throwable {
        check_Permissions();
        //执行目标方法
        Object obj = mi.getMethod();
        log();
        return obj;
    }

    //前增强
    public void check_Permissions(){
        System.out.println("模拟检查.....");
    }
    //后增强
    public void log(){
        System.out.println("模拟日志......");
    }


}