ibis.rmi
Class Naming

java.lang.Object
  extended byibis.rmi.Naming

public final class Naming
extends java.lang.Object

The Naming class provides static methods for storing and obtaining references to remote objects. These methods take a name in URL format as one of its arguments.


Method Summary
static void bind(java.lang.String name, Remote obj)
          Binds the specified name to the specified remote object.
static java.lang.String[] list(java.lang.String name)
          Returns an array of all names bound in the registry.
static Remote lookup(java.lang.String name)
          Returns a reference for the remote object associated with the specified name.
static void rebind(java.lang.String name, Remote obj)
          Rebinds the specified name to the specified remote object.
static void unbind(java.lang.String name)
          Removes the binding for the specified name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

lookup

public static Remote lookup(java.lang.String name)
                     throws NotBoundException,
                            java.net.MalformedURLException,
                            RemoteException
Returns a reference for the remote object associated with the specified name.

Parameters:
name - the name in URL format
Returns:
a stub for the remote object
Throws:
NotBoundException - if name is not bound
java.net.MalformedURLException - if the name is not appropriately formatted
RemoteException - if the registry could not be found

bind

public static void bind(java.lang.String name,
                        Remote obj)
                 throws AlreadyBoundException,
                        java.net.MalformedURLException,
                        RemoteException
Binds the specified name to the specified remote object.

Parameters:
name - the name in URL format
obj - a reference to the remote object
Throws:
RemoteException - if the registry could not be found
java.net.MalformedURLException - if the name is not appropriately formatted
AlreadyBoundException - if the name is already bound

unbind

public static void unbind(java.lang.String name)
                   throws RemoteException,
                          NotBoundException,
                          java.net.MalformedURLException
Removes the binding for the specified name.

Parameters:
name - the name in URL format
Throws:
NotBoundException - if name is not bound
java.net.MalformedURLException - if the name is not appropriately formatted
RemoteException - if the registry could not be found

rebind

public static void rebind(java.lang.String name,
                          Remote obj)
                   throws RemoteException,
                          java.net.MalformedURLException
Rebinds the specified name to the specified remote object. A existing binding is for the name is replaced.

Parameters:
name - the name in URL format
obj - a reference to the remote object
Throws:
RemoteException - if the registry could not be found
java.net.MalformedURLException - if the name is not appropriately formatted

list

public static java.lang.String[] list(java.lang.String name)
                               throws RemoteException,
                                      java.net.MalformedURLException
Returns an array of all names bound in the registry.

Parameters:
name - a registry name in URL format.
Returns:
an array of names.
Throws:
java.net.MalformedURLException - if the name is not appropriately formatted
RemoteException - if the registry could not be found


The Ibis project