Java RMI Proxy issue

时间秒杀一切 提交于 2019-11-29 11:59:01

The class $Proxy0 is a dynamic proxy, that is, a class is generate by java at run-time.

This class should implement the interface Abstract, but does not extend Call. So you can't downcast it to Call (this gives a class cast), but downcasting it to Abstract should be ok.

If you use RMI, you should only communicate with remote object through interfaces.

PS: Abstract is kind of a confusing name. I really thought that you were speaking of abstract class first. I would rename that if possible. Same for rmi.engine, prefer something like org.myproject, to avoid confusion with internal class of the JDK.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!