• 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,
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!