net.sourceforge.esw.transport
Class Namespace

java.lang.Object
  |
  +--net.sourceforge.esw.transport.Namespace

public class Namespace
extends java.lang.Object

This object is responsible for binding objects for client use, and for allowing clients to lookup a specific object bound in a namespace.

See Also:
Transport

Field Summary
protected static INamespaceDelegate delegate
          Delegates the binding and lookup to specific transport mechinisms.
 
Constructor Summary
Namespace()
           
 
Method Summary
static void bind(java.lang.String aName, java.lang.Object aObject)
          Binds the specified Object to the Specified name in this VM's Namespace.
static void bind(java.lang.String aName, java.lang.Object aObject, java.lang.String aHost, java.lang.String aPort)
          Binds the specified Object to the Specified name in the specified hosts VM's Namespace.
static java.lang.Object lookup(java.lang.String aHost, java.lang.String aName)
          Performs a Peer to Peer lookup of a Object at the speicied host, and the name the object is bound to on that host.
static java.lang.Object lookup(java.lang.String aHost, java.lang.String aPort, java.lang.String aName)
          Performs a Peer to Peer lookup of a Object at the speicied host, the port on that host, and the name the object is bound to on that host.
static void setNamespaceDelegate(INamespaceDelegate aDelegate)
          Sets the INamespaceDelegate used for the handling of Transport.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delegate

protected static INamespaceDelegate delegate
Delegates the binding and lookup to specific transport mechinisms. The default is using RMI for transport.
Constructor Detail

Namespace

public Namespace()
Method Detail

bind

public static void bind(java.lang.String aName,
                        java.lang.Object aObject)
                 throws java.lang.Exception
Binds the specified Object to the Specified name in this VM's Namespace.

Parameters:
aName - the name with which to bind the specified object.
aObject - the Object to bind to the specified name.
Throws:
java.lang.Exception - if there is an error during the binding of the specified object.

bind

public static void bind(java.lang.String aName,
                        java.lang.Object aObject,
                        java.lang.String aHost,
                        java.lang.String aPort)
                 throws java.lang.Exception
Binds the specified Object to the Specified name in the specified hosts VM's Namespace.

Parameters:
aName - the name with which to bind the specified object.
aObject - the Object to bind to the specified name.
aHost - the name of the host with which to bind the specified object.
aPort - the port of the host with which to bind the specified object.
Throws:
java.lang.Exception - if there is an error during the binding of the specified object.

lookup

public static java.lang.Object lookup(java.lang.String aHost,
                                      java.lang.String aName)
                               throws java.lang.Exception
Performs a Peer to Peer lookup of a Object at the speicied host, and the name the object is bound to on that host.

Parameters:
aHost - the name of the host with which to find the specified object.
aName - the name with which to find the specified object.
Throws:
java.lang.Exception - id there is an error during the lookup of the object.

lookup

public static java.lang.Object lookup(java.lang.String aHost,
                                      java.lang.String aPort,
                                      java.lang.String aName)
                               throws java.lang.Exception
Performs a Peer to Peer lookup of a Object at the speicied host, the port on that host, and the name the object is bound to on that host.

Parameters:
aHost - the name of the host with which to find the specified object.
aPort - the port of the host with which to find the specified object.
aName - the name with which to find the specified object.
Throws:
java.lang.Exception - id there is an error during the lookup of the object.

setNamespaceDelegate

public static void setNamespaceDelegate(INamespaceDelegate aDelegate)
Sets the INamespaceDelegate used for the handling of Transport.

Parameters:
aDelegate - the new delegate


Copyright 2002 Free Software Foundation. All Rights Reserved.