wingjay.github.io icon indicating copy to clipboard operation
wingjay.github.io copied to clipboard

《Java 技术之动态代理机制》评论

Open wingjay opened this issue 7 years ago • 4 comments

文章地址:http://wingjay.com/2018/02/11/java-dynamic-proxy

wingjay avatar Feb 11 '18 09:02 wingjay

看到“就是这么神奇”,忍不住点进来了。。

loicaplay avatar Feb 16 '18 04:02 loicaplay

统计函数耗时–动态代理实现

public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        long start = System.currentMillions();
        Object result = method.invoke(target, args);
        System.out.println("耗时:" + (System.currentMillions() - start));
        return result;
    }

上面的target变量从哪里来的?

wudashan avatar May 05 '18 14:05 wudashan

@wudashan 应该是 realObject,这里写错了。

wingjay avatar May 09 '18 09:05 wingjay

请问这个生成的代理类$Proxy0.class 在那里可以找到呢,我在windows下运行正常,但是没有找到这个class文件

counten avatar Sep 24 '19 07:09 counten