• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

RMI Registry

 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone,

Does not anyone have a solution how to determine if a registry is running a specific host and port.

LocateRegistry.createRegistry(port) --- works
LocateRegistry.getRegistry(host, port) ---- does not tell me much

What I want to do is that if a user starts a registry on a specific host and port and if another user want to start a registry on the SAME host and port, I want to bypass the the creation of the remote object and binding it to the registry.

Otherwise, I am going to get an AlreadyBoundExeption.

if (LocateRegistry.getRegistry(host, port)==null) --- should work but it does not
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
catch the exception. If you reach the catchblock the registry was already there, if not it wasn't
 
reply
    Bookmark Topic Watch Topic
  • New Topic