开发者

rmi callback gotchas?

开发者 https://www.devze.com 2023-01-18 05:48 出处:网络
What do I need to worry about when doing callbacks in RMI? I just need a simple client notification mechanism to avoid excessive polling.

What do I need to worry about when doing callbacks in RMI? I just need a simple client notification mechanism to avoid excessive polling.

I found an online example and it looks pretty straightforward, the client just implements an interface that extends Remote (like the server doe开发者_如何学Cs) and passes it to the server, which can then call back its methods. I'm guessing the remote callback can occur on any thread, so I have to assume it will be asynchronous to my client application's normal threads. What else is there?


Two things.

  1. RMI callbacks almost certainly won't work through firewalls

  2. RMI callbacks execute on a different thread from the original client call to the server. You can get unexpected synchronization deadlocks if you don't take that into account.

0

精彩评论

暂无评论...
验证码 换一张
取 消