The RMI registry is
implemented as an RMI server. Underlying Naming
’s static methods
is an interface that extends Remote
and an
implementation of that interface. In Java 2, these
are:
This extends Remote
and defines the methods an
implementation of Registry
must implement.
This is an actual RMI server that implements
the Registry
interface.
The Registry
interface is
straightforward. It defines five methods, each of
which maps directly to one of the static methods
defined in Naming
:
public interface Registry extends Remote { public static final int REGISTRY_PORT = 1099; public Remote lookup(String name) throws RemoteException, NotBoundException, AccessException; public void bind(String name, Remote obj) throws RemoteException, AlreadyBoundException, AccessException; public void unbind(String name) throws RemoteException, NotBoundException, AccessException; public void rebind(String name, Remote obj) throws RemoteException, AccessException; public String[] list( ) throws RemoteException, AccessException; }
Given
that the RMI registry is an RMI server, with both
an interface and an implementation, many people
wonder why Naming
was defined. Why go through the
trouble of making static methods that simply
redirect to a standard implementation?
The answer is that we use Naming
and the static methods because the bootstrapping ...
No credit card required