Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Class java.rmi.registry.LocateRegistry

java.lang.Object
    |
    +----java.rmi.registry.LocateRegistry

public abstract class LocateRegistry
extends Object
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(...);

See Also:
Registry

Method Summary
static Registry  createRegistry(int port)
Create and export a registry on the local host.
static Registry  getRegistry()
Returns the remote object Registry for the local host.
static Registry  getRegistry(int port)
Returns the remote object Registry on the current host at the specified port.
static Registry  getRegistry(String host)
Returns the remote object Registry on the specified host at a default (i.e., well-known) port number.
static Registry  getRegistry(String host, int port)
Returns the remote object Registry on the specified host at the specified port.
 
Methods inherited from class java.lang.Object
 clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRegistry

public static Registry getRegistry() throws RemoteException
Returns the remote object Registry for the local host.

getRegistry

public static Registry getRegistry(int port) throws RemoteException
Returns the remote object Registry on the current host at the specified port.

getRegistry

public static Registry getRegistry(String host) throws RemoteException, UnknownHostException
Returns the remote object Registry on the specified host at a default (i.e., well-known) port number. If the host String reference is null, the local host is used.

getRegistry

public static Registry getRegistry(String host,
                                   int port) throws RemoteException, UnknownHostException
Returns the remote object Registry on the specified host at the specified port. If port <= 0, the default Registry port number is used. If the host String reference is null, the local host is used.
Throws:
UnknownHostException - If the host is not known.

createRegistry

public static Registry createRegistry(int port) throws RemoteException
Create and export a registry on the local host.
Parameters:
port - the port on which the registry is to be exported
Throws:
RemoteException - If failure occurs during remote object creation.

Contents | Package | Class | Tree | Deprecated | Index | Help Java 1.2 Beta 3
PREV | NEXT SHOW LISTS | HIDE LISTS

Submit a bug or feature
Submit comments/suggestions about new javadoc look.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.