67,513
社区成员
发帖
与我相关
我的任务
分享
public class AopProxyFactory {
public static Object createProxy(final Object target, final MethodBeforeAdvice methodBeforeAdive) {
return Proxy.newProxyInstance(target.getClass().getClassLoader(), target.getClass().getInterfaces(), new InvocationHandler() {
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
methodBeforeAdive.before(method, args, target);
return method.invoke(target, args);
}
});
}
}