I am reading through few tutorial (one of them here) related to Java RMI, I found myself hardly understand about the RMI server.
I start a Java Main program, and create a UnicastRemoteObject
, after that bind the object in the RMI registry server (follow the tutorial). After that the Java Main program exit after the binding.
The parent class of UnicastRemoteObject
is RemoteServer
, I assume every remote object (which is also UnicastRemoteObject
) that I created is a Java process (JVM) that listening on one anonymous port.
So if I have 10 remote object, then I have 10 ports occupied to serve the client remote invocation? This doesn't sound right, but I can't really find where is the RMI server that actually established and how many port it will occupy for the remote client invocation?
Can anyone explain in detail how this thing work?