I am using RMI to implement some distributed algorithm, and since we're transmitting quite big objects, I'd like some precisions about when RMI transmits serialized objects over the network.
Suppose I have a Remote classe with the following method.
class MyServer extends Remote {
public synchronized void foo (Bar bar) {
...
Thread.wait();
...
}
}
Now, I have two (or more) RMI clients calling MyServer.foo method. When Client 1 calls it, it gets blocked in Thread.wait(). Then, Client 2 calls foo and it gets blocked because Client 1 is still in the foo method which is synchronized.
Now, the question is : When is the bar parameter of the Client 2 call transmitted over the network ? Only once Client 2 can actually enter the foo method or before, when it is blocked ?
Bonus question : Is this (the time at which objects are transmitted) a behavior that is enforced by RMI specs or is this implementation-specific ?