tags:

views:

25

answers:

1

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 does) 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?

+2  A: 

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.

EJP