Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI: rmiregistry, LocateRegistry, Naming and policy files

 
Marcos Motta
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to figure out the best way to bind my server to the Registry. I see three options:
1) My server does not create a registry, it uses the registry on default port 1099 previously create by rmiregistry.
2) The server always create the registry using LocateRegistry.createRegistry()
3) Always try to create the registry at port 1099 ignoring any exception and, after that, bind to the registry using Naming.rebind(). This way my server can use an external registry (in another VM) or create one as needed. Example:


One last thing: Do I realy have to setup a RMISercurityManager and provide a policy file? So far my client and server are working perfectly without any of these. (I am using jdk1.3.1)
Suggestions are very welcome
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2) The server always create the registry using LocateRegistry.createRegistry()
That's the approach that I would advise because it's one less thing to document. The simpler your start up instructions the better. If you don't do that you will have to explain how to start the registry. I used that approch and made the registry port a command line option which defaulted to 1099 (if the port were not entered on the command line).
One last thing: Do I realy have to setup a RMISercurityManager and provide a policy file? So far my client and server are working perfectly without any of these. (I am using jdk1.3.1)
Nope. I did in mine, but it is not necessary. Once again, it's one less thing to document. The simpler, the better.
 
Marcos Motta
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic