• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI Naming and registry

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to RMI;What is the difference between the Registry and naming services for lookup?
I see examples that do:

Registry registry = LocateRegistry.getRegistry(RemoteInterface.REGISTRY_PORT);
RemoteInterface remoteReference =
(RemoteInterface) UnicastRemoteObject.exportObject(new Server());
registry.rebind(RemoteInterface.REGISTRY_NAME, remoteReference);

as well as examples that do :
AccountImpl acct = new AccountImpl("JimF");

// Register it with the local naming registry
Naming.rebind("JimF", acct);

So what's the difference in binding to registry and naming service.I understand that both of them refer to the Registry in any case.
 
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cross post:
http://forum.java.sun.com/thread.jspa?threadID=5119325&tstart=0
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the first case, this means that your server class programatically starts a new instance of the naming service/registry on the ip,port,etc. specified, and binds itself to it. When your server class shuts down, so does the naming service.

In the second case, your server class binds itself to the naming service/registry already running on the specified ip,port,etc. This registry could have been started from another program or the command line - but it is independent of your server class and doesn't shutdown if your server does.
 
reply
    Bookmark Topic Watch Topic
  • New Topic