uka.karmi.rmi
Class Naming

java.lang.Object
  extended byuka.karmi.rmi.Naming

public final class Naming
extends java.lang.Object

The Naming class is for bootstraping. It allows to get objects out of a remote registry. The remote object is addressed with an URL-like string: protocol://registryLocation:port/objectKey

For example: rmi://jakarta.ira.uka.de:1100/myObject

Look at LocateRegistry for more information about the "protocol://registryLocation:port" part of the string and its interpretation. The second part (after '/') is passed to the addressed registry. if there is no second part, the registry itself is used.

Author:
Christian Nester, Bernhard Haumacher

Constructor Summary
private Naming()
           
 
Method Summary
static void bind(java.lang.String name, Remote obj)
          Binds object into the addressed registry using the name afer '/'
private static Registry getRegistry(java.lang.String location)
           
static java.lang.String[] list(java.lang.String location)
          Returns the string list of objects registered in the addressed registry.
static Remote lookup(java.lang.String name)
          Finds remote object for this string.
static void rebind(java.lang.String name, Remote obj)
          Rebinds object into the addressed registry using the name afer '/'
static void unbind(java.lang.String name)
          Unbinds the object associated with this string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Naming

private Naming()
Method Detail

lookup

public static Remote lookup(java.lang.String name)
                     throws RemoteException,
                            NotBoundException,
                            java.net.MalformedURLException,
                            UnknownHostException
Finds remote object for this string. The string contains information to locate the registry and the registry key.

Parameters:
name - location and name of the object
Throws:
RemoteException
NotBoundException
java.net.MalformedURLException
UnknownHostException

bind

public static void bind(java.lang.String name,
                        Remote obj)
                 throws RemoteException,
                        AlreadyBoundException,
                        java.net.MalformedURLException,
                        UnknownHostException
Binds object into the addressed registry using the name afer '/'

Parameters:
obj - remote object that should be bound
name - location and name
Throws:
RemoteException
AlreadyBoundException
java.net.MalformedURLException
UnknownHostException

unbind

public static void unbind(java.lang.String name)
                   throws RemoteException,
                          NotBoundException,
                          java.net.MalformedURLException,
                          UnknownHostException
Unbinds the object associated with this string.

Parameters:
name - location and name of the remote object
Throws:
RemoteException
NotBoundException
java.net.MalformedURLException
UnknownHostException

rebind

public static void rebind(java.lang.String name,
                          Remote obj)
                   throws RemoteException,
                          java.net.MalformedURLException,
                          UnknownHostException
Rebinds object into the addressed registry using the name afer '/'

Parameters:
obj - remote object
name - location and name
Throws:
RemoteException
java.net.MalformedURLException
UnknownHostException

list

public static java.lang.String[] list(java.lang.String location)
                               throws RemoteException,
                                      java.net.MalformedURLException,
                                      UnknownHostException
Returns the string list of objects registered in the addressed registry.

Parameters:
location - location of the registry
Returns:
string list of registered remote objects
Throws:
RemoteException
java.net.MalformedURLException
UnknownHostException

getRegistry

private static Registry getRegistry(java.lang.String location)
                             throws RemoteException
Throws:
RemoteException