简体   繁体   English

使用Java rmi激活系统的主要目的是什么?

[英]What's the main purpose of using java rmi activation system?

First of all, I am reading the java official document about rmi specification. 首先,我正在阅读有关rmi规范的java官方文档。 http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/index.html http://docs.oracle.com/javase/7/docs/platform/rmi/spec/rmi-activation2.html http://docs.oracle.com/javase/7/docs/technotes/guides/rmi/index.html http://docs.oracle.com/javase/7/docs/platform/rmi/spec/rmi-activation2 .html

The features in java rmi listed in oracle website can be easily understood except rmi activation part. 甲骨文网站中列出的java rmi中的功能可以轻松理解,除了rmi激活部分。 I have read through the detailed document of rmi activation mechanism, but still got nothing about the useful practice in the real scenario. 我已经阅读了有关rmi激活机制的详细文档,但对于实际情况下的有用实践仍然一无所知。

Thus, these are several question which really confused me as follows: 因此,以下几个问题确实使我感到困惑:

  1. Regarding the doc, rmid is a router which specifies the remote rmi server and return the server information to the clients only once. 关于文档,rmid是一个路由器,它指定远程rmi服务器,并且仅将服务器信息返回给客户端一次。 This looks like the similar function with rmiregistry which is a place for the server to register services. 这看起来类似于rmiregistry的功能,这是服务器注册服务的地方。 What's the difference if we do not have it? 如果没有,有什么区别?
  2. Does this mechanism include server auto-recovery or failover functionality? 此机制是否包括服务器自动恢复或故障转移功能? In other words, I have already known that remote rmi server should be registered on RMID, if one of remote rmi server (maybe on different machine) crashed, can RMID detect this and trigger this remote rmi server bouncing? 换句话说,我已经知道应该在RMID上注册远程rmi服务器,如果远程rmi服务器之一(可能在不同的计算机上)崩溃了,RMID可以检测到并触发该远程rmi服务器跳动吗?
  3. Can the function of rmid be implemented via using the rmi API in order to run the same function in my customized standalone server instead of using JDK RMID tools. 可以通过使用rmi API来实现rmid的功能,以便在我的自定义独立服务器中运行相同功能,而不是使用JDK RMID工具。 For example, tools rmiregistry could be replaced with rmi API LocateRegistry.createRegistry(regPort); 例如,可以使用rmi API LocateRegistry.createRegistry(regPort);替换工具rmir​​egistry LocateRegistry.createRegistry(regPort);

Please advise or provide the relevant material, thanks in advance. 请提前告知或提供相关材料。

Regarding the doc, rmid is a router which specifies the remote rmi server and return the server information to the clients only once. 关于文档,rmid是一个路由器,它指定远程rmi服务器,并且仅将服务器信息返回给客户端一次。

No. The documentation doesn't say that. 否。文档中没有这么说。 'rmid' is a daemon that starts the remote object if it isn't already running. “ rmid”是一个守护程序,如果它尚未运行,它将启动远程对象。

This looks like the similar function with rmiregistry 这看起来与rmiregistry类似的功能

No. 没有。

Does this mechanism include server auto-recovery or failover functionality? 此机制是否包括服务器自动恢复或故障转移功能?

If the JVM containing an activated remote object exits, or the activated remote object de-activates itself, rmid will restart it on demand. 如果包含激活的远程对象的JVM退出,或者激活的远程对象自行取消激活,rmid将按需重新启动它。

Can rmid be running in the standalone server, and initialize via java API instead of rmi tools? rmid是否可以在独立服务器中运行,并且可以通过java API而不是rmi工具进行初始化?

I don't understand the question. 我不明白这个问题。

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

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