是否可以在两个类之间使用RMI双向?
I want to share some information between two classes (A and B), which are running in different java programs. Instead of writing a whole communication protocol I want to use the java build-in rmi classes for that purpose. Currently class B is able to run a method which belongs to class A remotely. Is it somehow possible to use the same "connection" within class A to call a method of class B? Otherwise I probably have to implement a second rmi service ...
我想在两个类(A和B)之间共享一些信息,它们运行在不同的java程序中。我没有编写完整的通信协议,而是想为此目的使用java内置rmi类。目前,B类能够远程运行属于A类的方法。是否有可能在A类中使用相同的“连接”来调用B类的方法?否则我可能要实施第二个rmi服务......
BR,
BR,
Markus
马库斯
8 个解决方案
#1
9
If B
implements Remote
, it can be export and passed as a parameter in an RMI call to A
. In this scenario, there's no need to register B
in an RMI registry, since the client is being passed a reference to it explicitly.
如果B实现Remote,它可以导出并作为RMI调用中的参数传递给A.在这种情况下,不需要在RMI注册表中注册B,因为客户端正在明确地传递对它的引用。
更多相关文章
- spring框架中一个跟String的trim方法一样的方法
- 当只使用get()和set()方法时,用原始类型替换AtomicBoolean?
- java中循环遍历删除List和Set集合中元素的方法
- 80端口占用异常解决方法java.net.BindException: Address alread
- java写入文件的几种方法小结
- OOP面向对象编程(一)-------方法的重载
- Java之美[从菜鸟到高手演变]之Java学习方法
- vue、react等单页面项目部署到服务器的方法及vue和react的区别
- javascript获得客户端IP的又一方法