home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1998 February / VPR9802A.ISO / APP_DEMO / VC / MAIN.BIN / Registry.java < prev    next >
Text File  |  1997-10-27  |  3KB  |  91 lines

  1. /*
  2.  * @(#)Registry.java    1.5 97/02/12
  3.  * 
  4.  * Copyright (c) 1995, 1996 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  * CopyrightVersion 1.1_beta
  20.  */
  21. package java.rmi.registry;
  22.  
  23. import java.rmi.*;
  24.  
  25. /**
  26.  * A "registry" exists on every node that allows RMI connections to
  27.  * servers on that node.  The registry on a particular node contains a
  28.  * transient database that maps names to remote objects.  When the
  29.  * node boots, the registry database is empty.  The names stored in the
  30.  * registry are pure and are not parsed.  A service storing itself in
  31.  * the registry may want to prefix its name of the service by a package
  32.  * name (although not required), to reduce name collisions in the
  33.  * registry.
  34.  *
  35.  * The LocateRegistry class is used to obtain the registry for different hosts.
  36.  *
  37.  * @see LocateRegistry
  38.  */
  39. public interface Registry extends Remote {
  40.     /** Well known port for registry */
  41.     public static final int REGISTRY_PORT = 1099;
  42.     
  43.     /**
  44.      * Returns the remote object associated with the specified name in the 
  45.      * registry.
  46.      *
  47.      * @exception RemoteException If remote operation failed.
  48.      * @exception NotBoundException if there is no object with this name in the
  49.      *              registry.
  50.      * @exception AccessException If this operation is not permitted.
  51.      */
  52.     public Remote lookup(String name)
  53.     throws RemoteException, NotBoundException, AccessException;
  54.  
  55.     /**
  56.      * Binds the name to the specified remote object.
  57.      * @exception RemoteException If remote operation failed.
  58.      * @exception AlreadyBoundException If name is already bound.
  59.      * @exception AccessException If this operation is not permitted.
  60.      */
  61.     public void bind(String name, Remote obj)
  62.     throws RemoteException, AlreadyBoundException, AccessException;
  63.     
  64.     /**
  65.      * Unbind the name.
  66.      * @exception RemoteException If remote operation failed.
  67.      * @exception NotBoundException if there is no object with this name in the
  68.      *              registry.
  69.      * @exception AccessException If this operation is not permitted.
  70.      */
  71.     public void unbind(String name)
  72.     throws RemoteException, NotBoundException, AccessException;
  73.  
  74.  
  75.     /** 
  76.      * Rebind the name to a new object, replacing any existing binding.
  77.      * @exception RemoteException If remote operation failed.
  78.      * @exception AccessException If this operation is not permitted.
  79.      */
  80.     public void rebind(String name, Remote obj)
  81.     throws RemoteException, AccessException;
  82.  
  83.     /**
  84.      * Returns an array of the names in the registry.
  85.      * @exception RemoteException If remote operation failed.
  86.      * @exception AccessException If this operation is not permitted.
  87.      */
  88.     public String[] list()
  89.     throws RemoteException, AccessException;
  90. }
  91.