Take the 2-minute tour ×

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?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer

Your Answer


