java.lang.Object | +----java.rmi.registry.LocateRegistry
This class is used to obtain the bootstrap Registry on a particular
host (including your local host). The following example demonstrates usage
(minus exception handling):
Server wishes to make itself available to others:
SomeService service = ...; // remote object for service
Registry registry = LocateRegistry.getRegistry();
registry.bind("I Serve", service);
The client wishes to make requests of the above service:
Registry registry = LocateRegistry.getRegistry("foo.services.com");
SomeService service = (SomeService)registry.lookup("I Serve");
service.requestService(...);
public static Registry getRegistry() throws RemoteException
public static Registry getRegistry(int port) throws RemoteException
public static Registry getRegistry(String host) throws RemoteException, UnknownHostException
String reference is null, the local
host is used.
public static Registry getRegistry(String host,
int port) throws RemoteException, UnknownHostException
String reference is
null, the local host is used.
public static Registry createRegistry(int port) throws RemoteException
![]()