Registry

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## java.rmi.registry
Interface Registry

All Superinterfaces:
  Remote

All Known Implementing Classes:
  IxcRegistry

    public interface Registry

extends Remote

`Registry` is a remote interface to a simple remote object registry that provides methods for storing and retrieving remote object references bound with arbitrary string names. The `bind`, `unbind`, and `rebind` methods are used to alter the name bindings in the registry, and the `lookup` and `list` methods are used to query the current name bindings.

A `Registry` implementation may choose to restrict access to some or all of its methods (for example, methods that mutate the registry's bindings may be restricted to calls originating from the local host). If a `Registry` method chooses to deny access for a given invocation, its implementation may throw `AccessException`.

The names used for bindings in a `Registry` are pure strings, not parsed. A service which stores its remote reference in a `Registry` may wish to use a package name as a prefix in the name binding to reduce the likelihood of name collisions in the registry.

Since:
  JDK1.1
Version:
  1.17, 03/01/23
Author:
  Ann Wollrath, Peter Jones
See Also:
  ``

Field Summary
`static int` | `REGISTRY_PORT` Well known port for registry.

Method Summary
`void` | `bind(String name, Remote obj)` Binds a remote reference to the specified `name` in this registry.
`String[]` | `list()` Returns an array of the names bound in this registry.
`Remote` | `lookup(String name)` Returns the remote reference bound to the specified `name` in this registry.
`void` | `rebind(String name, Remote obj)` Replaces the binding for the specified `name` in this registry with the supplied remote reference.
`void` | `unbind(String name)` Removes the binding for the specified `name` in this registry.

Field Detail

### REGISTRY_PORT

    static final int REGISTRY_PORT

  Well known port for registry.

  See Also:
    Constant Field Values

Method Detail

### lookup

    Remote lookup(String name)
                  throws RemoteException,
                         NotBoundException,
                         AccessException

  Returns the remote reference bound to the specified `name` in this registry.

  Parameters:
    `name` - the name for the remote reference to look up
  Returns:
    a reference to a remote object
  Throws:
    `NotBoundException` - if `name` is not currently bound
    `RemoteException` - if remote communication with the registry failed
    `AccessException` - if this registry is local and it denies the caller access to perform this operation
    `NullPointerException` - if `name` is `null`

### bind

    void bind(String name,
              Remote obj)
              throws RemoteException,
                     AlreadyBoundException,
                     AccessException

  Binds a remote reference to the specified `name` in this registry.

  Parameters:
    `name` - the name to associate with the remote reference
    `obj` - a reference to a remote object (usually a stub)
  Throws:
    `AlreadyBoundException` - if `name` is already bound
    `RemoteException` - if remote communication with the registry failed
    `AccessException` - if this registry is local and it denies the caller access to perform this operation
    `NullPointerException` - if `name` is `null`, or if `obj` is `null`

### unbind

    void unbind(String name)
                throws RemoteException,
                       NotBoundException,
                       AccessException

  Removes the binding for the specified `name` in this registry.

  Parameters:
    `name` - the name of the binding to remove
  Throws:
    `NotBoundException` - if `name` is not currently bound
    `RemoteException` - if remote communication with the registry failed
    `AccessException` - if this registry is local and it denies the caller access to perform this operation
    `NullPointerException` - if `name` is `null`

### rebind

    void rebind(String name,
                Remote obj)
                throws RemoteException,
                       AccessException

  Replaces the binding for the specified `name` in this registry with the supplied remote reference. If there is an existing binding for the specified `name`, it is discarded.

  Parameters:
    `name` - the name to associate with the remote reference
    `obj` - a reference to a remote object (usually a stub)
  Throws:
    `RemoteException` - if remote communication with the registry failed
    `AccessException` - if this registry is local and it denies the caller access to perform this operation
    `NullPointerException` - if `name` is `null`, or if `obj` is `null`

### list

    String[] list()
                  throws RemoteException,
                         AccessException

  Returns an array of the names bound in this registry. The array will contain a snapshot of the names bound in this registry at the time of the given invocation of this method.

  Returns:
    an array of the names bound in this registry
  Throws:
    `RemoteException` - if remote communication with the registry failed
    `AccessException` - if this registry is local and it denies the caller access to perform this operation

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD