package com.hs.admin.proxy;

import org.springframework.cglib.proxy.InvocationHandler;
import org.springframework.cglib.proxy.Proxy;

import javax.swing.plaf.basic.BasicComboPopup;
import java.lang.reflect.Method;

/**
 * 动态代理类
 *
 * @author xieheng
 */
public class MySubjectProxy<T> implements InvocationHandler {
    //构造方法注入
    private Class<T> proxyInterface;

    public MySubjectProxy(Class<T> proxyInterface) {
        this.proxyInterface = proxyInterface;
    }

    @Override
    public Object invoke(Object o, Method method, Object[] objects) throws Throwable {
        return method.invoke(proxyInterface, objects);
    }

}
