The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI Registry Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI Registry" Watch "RMI Registry" New topic

RMI Registry

GD Deepz
Ranch Hand

Joined: Sep 29, 2004
Posts: 55
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
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
catch the exception. If you reach the catchblock the registry was already there, if not it wasn't

wood burning stoves
subject: RMI Registry
Similar Threads
RMI registry and remote object in different machines
look up error
RMI Registry
classpah in readme
Server Host/Port Validation