简体   繁体   English

如何检查RMI服务是否在给定的服务器和端口上运行

[英]how to check if the RMI service is running on given server and port

I have the following requirement. 我有以下要求。

Requirement: verify if the given RMI service object say "xxservice" is running/available on the given host and port using java. 要求:使用Java验证给定RMI服务对象“ xxservice”在给定主机和端口上是否正在运行/可用。

I am using JDK1.6 我正在使用JDK1.6

Appreciate any help. 感谢任何帮助。

Thanks 谢谢

Just look it up in the Registry, if that's its bound name. 只需在注册表中查找它的绑定名称即可。

Of course that doesn't prove it's still there. 当然,这并不能证明它仍然存在。 In general the best way to determine whether any resource is available is just to try to use it. 通常,确定任何资源是否可用的最佳方法就是尝试使用它。 In this case, call a method on it. 在这种情况下,请在其上调用一个方法。 Any technique that tries to predict whether a following use will fail is of course bound to fail itself. 任何试图预测后续使用是否会失败的技术当然都会失败。

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

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