RMI - 谁调用了该方法
有没有办法知道哪个服务器/客户端调用了服务器上的方法?
问题: 我有一个完全连接的服务器图,当命令从某个服务器节点上的客户端传入时,我会将其转发到图上的其余服务器节点。我只想转发命令当且仅当它来自客户端而不是另一个服务器。
is there a way to know what server/client invoked a method on the server?
Problem:
I have a completely connected graph of server, and when a command comes in from a client on one of the server nodes, I forward it to the rest of the server nodes on the graph. I want to only forward the commands if and only if it's coming from a client and not another server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
与其尝试找出客户端,为什么不提供服务器对象的两种实现呢?一种转发请求,一种不转发请求?我将从非转发版本中继承转发版本,并以不同的名称注册它们。
然而,在我看来,您确实想要一个消息传递架构,而不是服务器之间的 RMI。
Rather than trying to find out the client, why not provide two implementations of the server object? One that forwards requests, and one that doesn't? I would subclass the forwarding version from the non-forwarding version, and register them under different names.
However, it seems to me that you really want a messaging architecture rather than RMI between the servers.