• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about DVDConnector in SCJD Exam book

 
Lara McCarver
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to understand the DVDConnector class in the SCJD Exam book. I think the static method getRemote() would be used by the (GUI) client to connect to the (database) server.

What I don't understand is the inclusion of the line RegDVDDatabase.register() inside this method which is called by the client. It seems that this would start up the RMI registry. But, is it desirable to start up the RMI registry on the client machine (assuming the client and server are on separate machines)? I would think that you only want to start up the RMI registry on the server machine.

Does this sound right?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Lara
But, is it desirable to start up the RMI registry on the client machine (assuming the client and server are on separate machines)? I would think that you only want to start up the RMI registry on the server machine.
You are correct - normally you would only want a registry on the server machine.

However the reference version of the RMI registry provided with the JDK does not allow remote registration of services. So if you wanted to set up services on both computers (for example having the server push updates to the client), then you might want to also have a registry on the client machine (I think there are easier ways to achieve this, but I am too lazy to turn on another computer to test this ).

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic