// Path: src/main/java/org/smart4j/framework/aop/proxy/Proxy.java
// public interface Proxy {
// 
//     /**
//      * 执行链式代理
//      *
//      * @param proxyChain 代理链
//      * @return 目标方法返回值
//      * @throws Throwable 异常
//      */
//     Object doProxy(ProxyChain proxyChain) throws Throwable;
// }


import java.lang.reflect.Method;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smart4j.framework.aop.proxy.Proxy;
import org.smart4j.framework.aop.proxy.ProxyChain;
        begin();
        try {
            if (intercept(cls, method, params)) {
                before(cls, method, params);
                result = proxyChain.doProxyChain();
                after(cls, method, params, result);
            } else {
                result = proxyChain.doProxyChain();
            }
        } catch (Exception e) {
            logger.error("AOP 异常", e);
            error(cls, method, params, e);
            throw e;
        } finally {
            end();
        }

        return result;
    }

    public void begin() {
    }

    public boolean intercept(Class<?> cls, Method method, Object[] params) throws Throwable {
        return true;
    }

    public void before(Class<?> cls, Method method, Object[] params) throws Throwable {
    }

// Path: src/main/java/org/smart4j/framework/aop/proxy/Proxy.java
// public interface Proxy {
// 
//     /**
//      * 执行链式代理
//      *
//      * @param proxyChain 代理链
//      * @return 目标方法返回值
//      * @throws Throwable 异常
//      */
//     Object doProxy(ProxyChain proxyChain) throws Throwable;
// }


// Path: src/main/java/org/smart4j/framework/aop/AspectProxy.java
import java.lang.reflect.Method;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smart4j.framework.aop.proxy.Proxy;
import org.smart4j.framework.aop.proxy.ProxyChain;

        begin();
        try {
            if (intercept(cls, method, params)) {
                before(cls, method, params);
                result = proxyChain.doProxyChain();
                after(cls, method, params, result);
            } else {
                result = proxyChain.doProxyChain();
            }
        } catch (Exception e) {
            logger.error("AOP 异常", e);
            error(cls, method, params, e);
            throw e;
        } finally {
            end();
        }

        return result;
    }

    public void begin() {
    }

    public boolean intercept(Class<?> cls, Method method, Object[] params) throws Throwable {
        return true;
    }

    public void before(Class<?> cls, Method method, Object[] params) throws Throwable {
    }

    public void after(Class<?> cls, Method method, Object[] params, Object result) throws Throwable {