哪位高手可以解答一下Proxy类?

PigBrother 2006-06-21 05:34:37
英文的看不太懂
A dynamic proxy class (simply referred to as a proxy class below) is a class that implements a list of interfaces specified at runtime when the class is created, with behavior as described below. A proxy interface is such an interface that is implemented by a proxy class. A proxy instance is an instance of a proxy class. Each proxy instance has an associated invocation handler object, which implements the interface InvocationHandler. A method invocation on a proxy instance through one of its proxy interfaces will be dispatched to the invoke method of the instance's invocation handler, passing the proxy instance, a java.lang.reflect.Method object identifying the method that was invoked, and an array of type Object containing the arguments. The invocation handler processes the encoded method invocation as appropriate and the result that it returns will be returned as the result of the method invocation on the proxy instance.

我大致的理解是Proxy的实例提供Invoke方法,用于调用此Proxy实现的某一个interface的方法
但是为什么要使用这种Proxy方法呢,这种用法比直接调用好在哪里呢?
...全文
116 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
congliu 2006-06-21
  • 打赏
  • 举报
回复
http://www.mx68.com/WebDeveloper/2006-03-10/WebDeveloper_34145_2.shtml
有详细解释,我不转贴了
PigBrother 2006-06-21
  • 打赏
  • 举报
回复
anyone knows?

62,616

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧