Voyager ORB

com.objectspace.voyager
Class Namespace

java.lang.Object
  |
  +--com.objectspace.voyager.Namespace

public class Namespace
extends java.lang.Object

Namespace contains static methods that allow an identifier to be bound to an object for later lookup. An identifier can be a simple string, an URL indicating another Voyager server, a path in a directory, or a format recognized by one of Voyager's pluggable transport layers (such as a CORBA IOR). Once bound, an identifier can be rebound or unbound.

Version:
3.0

Method Summary
static void bind(java.lang.String name, java.lang.Object object)
          Bind a name to the specified object.
static java.lang.Object lookup(java.lang.String name)
          Return a proxy to the object associated with the specified name.
static void rebind(java.lang.String name, java.lang.Object object)
          Rebind a name to the specified object.
static void setServerURL(java.lang.Object obj)
          Sets the URL to the server the Namespace will be communicating with to perform the naming calls.
static void unbind(java.lang.String name)
          Unbind the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setServerURL

public static void setServerURL(java.lang.Object obj)
Sets the URL to the server the Namespace will be communicating with to perform the naming calls. This method is valid in the light voyager clients only. It is useful if bind(), rebind(), unbind() and lookup() methods must be executed on the host other than the one specified in the parameter e.x. Namespace.bind( "rmi://Dallas:8000/MyObject" ) would be executed on Dallas:8000, but if setServerURL() was called first with "//London:9000", then the method will get executed on London:9000 which then will delegate the call to Dallas:8000
Parameters:
Object - obj - If the parameter is an instance of a String class, the expected format is //host:port. Both host and port are the mandatory elements If the parameter is an instance of an Applet class, then the codebase of the applet is obtained and used to set the server's URL.

lookup

public static java.lang.Object lookup(java.lang.String name)
                               throws NamespaceException
Return a proxy to the object associated with the specified name.
Parameters:
name - The name to lookup.
Throws:
NamespaceException - The name was not in a recognized format or the object was not found.

bind

public static void bind(java.lang.String name,
                        java.lang.Object object)
                 throws NamespaceException
Bind a name to the specified object.
Parameters:
name - The name.
object - The object.
Throws:
NamespaceException - The name was not in a recognized format or the name was already bound.

rebind

public static void rebind(java.lang.String name,
                          java.lang.Object object)
                   throws NamespaceException
Rebind a name to the specified object.
Parameters:
name - The name.
object - The object.
Throws:
NamespaceException - The name was not in a recognized format.

unbind

public static void unbind(java.lang.String name)
                   throws NamespaceException
Unbind the specified name.
Parameters:
name - The name.
Throws:
NamespaceException - The name was not in a recognized format.

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240