Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

registry.rebind vs Naming.rebind

 
Rosie Nelson
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am starting the rmiregistry programmatically using:-
LocateRegistry.createRegistry(portNumber);
When I am binding the remote object is it best to use :
Registry registry = LocateRegistry.getRegistry(portNumber);
registry.rebind("//" + etc...
or
Naming.rebind("//" + etc...
Conversely, on the client when I perform the lookup should I use:-
Naming.lookup (etc...
or
registry.lookup (etc...
Both approaches appear to work nicely, but are there any pitfalls associated with either approach.
Rosie
 
Sai Prasad
Ranch Hand
Posts: 560
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It doesn't matter which way you do it in the server side. You get the same result. You can also specify the port number when you call Naming.rebind() like,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic