Java Rmi 存根对象生命周期
当 java-rmi 存根对象变得无效时。
1-在客户端和服务器之间的链接断开之后。(存根在连接重新建立后是否有效,或者仍然需要刷新)
2-在特定超时之后。
我想获取存根并将它们存储在应用程序范围内。
When a java-rmi stub object become invalid.
1-After link between client and server broken.(Is stub is valid after connection reestablish or it is still need to refresh)
2-After a specific timeout.
I want to get stubs ones and store them on application scope.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
两者都不。当相应的远程对象未导出时,它会变得无效,只有当远程对象未导出时才会发生这种情况,无论是显式的还是本地垃圾收集的结果。反过来,本地 GC 只能在分布式垃圾收集 (DGC) 发生后发生,这意味着对于远程对象的每个客户端,它要么允许其存根在自己的 JVM 中进行本地 GC,要么 它与远程对象主机的网络路径断开连接的时间足够长,DGC 到期才会生效,这需要一个可配置的时间,默认情况下是(是?)10 分钟。
Neither. It becomes invalid when the corresponding remote object is unexported, which can only happen if the remote object is unexported, either explicitly or as a result of local garbage-collection. Local GC in turn can only happen after Distributed Garbage Collection (DGC) has occurred, which means that for each client of the remote object, either it has allowed its stub to be locally GC'd in its own JVM or it has become disconnected from the network path to the remote object's host for long enough for DGC expiry to take effect, which takes a configurable time which by default is (was?) 10 minutes.