简体   繁体   English

使用RMI注册表确定Java RMI远程对象主机的IP

[英]Determining ip of java rmi remote object host machine using rmi registry

是否可以确定托管远程对象的计算机的IP?是否可以从RMI注册表获取此信息?

You can access a rmiregistry only by using the IP it resides. 您只能使用其驻留的IP访问rmiregistry。 And you can only call methods that are registered with the Remote interface. 而且,您只能调用在Remote接口中注册的方法。 So writing a function in the interface to return an IP is of no use, I think. 因此,我认为在接口中编写函数以返回IP是没有用的。

There is no use you can possibly make of the information, so it isn't provided via an API. 您可能无法利用这些信息,因此不会通过API提供。 All you need to do with the stub is call remote methods with it. 您需要对存根执行的所有操作就是使用它调用远程方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM