Why does java.rmi.Naming not implement interface java.rmi.Registry?

J

Jan Schulze

The class Naming (from package java.rmi) provides the methods bind,
list, lookup etc. Those methods are defined in the interface Registry
(from package java.rmi). But according to the SDK API docs Naming does
not implement that interface. Is that true or a misprint? If it is
true, could anyone explain?

Regards
Jan
 
E

Esmond Pitt

Jan said:
The class Naming (from package java.rmi) provides the methods bind,
list, lookup etc. Those methods are defined in the interface Registry
(from package java.rmi). But according to the SDK API docs Naming does
not implement that interface. Is that true or a misprint? If it is
true, could anyone explain?

There are two answers to this:

1. Because all the methods of Naming are static. Otherwise you would
have to get an instance of it, which would be the same as
LocateRegistry.getRegistry(), so what would be the point?

2. It doesn't strictly speaking implement the Registry interface,
because it understands (and returns) rmi:// URLs, where the Registry
interfaces only accept and return object names.

EJP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top