com.sun.media.jsdt.impl
Interface AbstractNamingProxy

All Known Implementing Classes:
NamingProxy

public abstract interface AbstractNamingProxy

JSDT abstract Naming interface.

Version:
1.5 - 25th February 1999
Author:
Rich Burridge

Method Summary
 void bind(com.sun.media.jsdt.Naming naming, com.sun.media.jsdt.URLString urlString, java.lang.String name, java.lang.Object object)
           bind binds the name to the specified JSDT object.
 java.lang.Object getProxy()
           getProxy get a handle to the proxy for the Registry.
 void initProxy(java.util.Hashtable connections, java.lang.String host, int port)
           initProxy initialise the Registry proxy.
 java.lang.String[] list(com.sun.media.jsdt.Naming naming)
           list lists all the names of the known bound JSDT objects.
 java.lang.Object lookup(com.sun.media.jsdt.Naming naming, com.sun.media.jsdt.URLString urlString, java.lang.String name)
           lookup returns the JSDT object for the given name.
 void rebind(com.sun.media.jsdt.Naming naming, com.sun.media.jsdt.URLString urlString, java.lang.String name, java.lang.Object object)
           rebind rebinds the name to a new object, replacing any existing binding.
 void unbind(com.sun.media.jsdt.Naming naming, com.sun.media.jsdt.URLString urlString, java.lang.String name)
           unbind unbinds the object associated with this name.
 

Method Detail

initProxy

public void initProxy(java.util.Hashtable connections,
                      java.lang.String host,
                      int port)
               throws com.sun.media.jsdt.NoRegistryException,
                      com.sun.media.jsdt.NoSuchHostException
initProxy initialise the Registry proxy.
Parameters:
connections - the hash table of connections (keyed by host).
host - the host the Registry is running on.
port - the port number the Registry is running on.
Throws:
com.sun.media.jsdt.NoRegistryException - if no Registry process is running.
com.sun.media.jsdt.NoSuchHostException - if the host given does not exist.

getProxy

public java.lang.Object getProxy()
getProxy get a handle to the proxy for the Registry.
Returns:
a handle to the proxy for this Registry.

bind

public void bind(com.sun.media.jsdt.Naming naming,
                 com.sun.media.jsdt.URLString urlString,
                 java.lang.String name,
                 java.lang.Object object)
          throws com.sun.media.jsdt.ConnectionException,
                 com.sun.media.jsdt.NoRegistryException,
                 com.sun.media.jsdt.InvalidURLException,
                 com.sun.media.jsdt.AlreadyBoundException,
                 com.sun.media.jsdt.PortInUseException,
                 com.sun.media.jsdt.TimedOutException
bind binds the name to the specified JSDT object. The name should be of the form: jsdt://[:]/// where valid impl types are "lrmp", "rmi" and "socket". where valid object types are "Session" and "Client". So for example: bind("jsdt://stard:3355/socket/Session/chatSession", chatSession); bind("jsdt://stard:4386/socket/Client/fredClient", fredClient);
Parameters:
naming - handle to the Naming class that called this method.
urlString - the URLString object for the given name.
name - the name associated with this object.
object - the object to bind.
Throws:
com.sun.media.jsdt.ConnectionException - if a connection error occured.
com.sun.media.jsdt.NoRegistryException - if no Registry process is running.
com.sun.media.jsdt.InvalidURLException - if the url string given is invalid.
com.sun.media.jsdt.AlreadyBoundException - if this url string is already bound to an object.
com.sun.media.jsdt.PortInUseException - if this port is being used by another application.
com.sun.media.jsdt.TimedOutException - if no reply was received for this operation in the given timeout period.

rebind

public void rebind(com.sun.media.jsdt.Naming naming,
                   com.sun.media.jsdt.URLString urlString,
                   java.lang.String name,
                   java.lang.Object object)
            throws com.sun.media.jsdt.ConnectionException,
                   com.sun.media.jsdt.NoRegistryException,
                   com.sun.media.jsdt.InvalidURLException,
                   com.sun.media.jsdt.PortInUseException,
                   com.sun.media.jsdt.TimedOutException
rebind rebinds the name to a new object, replacing any existing binding.
Parameters:
naming - handle to the Naming class that called this method.
urlString - the URLString object for the given name.
name - the name associated with this new object.
object - the object to rebind.
Throws:
com.sun.media.jsdt.ConnectionException - if a connection error occured.
com.sun.media.jsdt.NoRegistryException - if no Registry process is running.
com.sun.media.jsdt.InvalidURLException - if the url string given is invalid.
com.sun.media.jsdt.PortInUseException - if this port is being used by another application.
com.sun.media.jsdt.TimedOutException - if no reply was received for this operation in the given timeout period.

unbind

public void unbind(com.sun.media.jsdt.Naming naming,
                   com.sun.media.jsdt.URLString urlString,
                   java.lang.String name)
            throws com.sun.media.jsdt.ConnectionException,
                   com.sun.media.jsdt.NoRegistryException,
                   com.sun.media.jsdt.InvalidURLException,
                   com.sun.media.jsdt.NotBoundException,
                   com.sun.media.jsdt.TimedOutException
unbind unbinds the object associated with this name.
Parameters:
naming - handle to the Naming class that called this method.
urlString - the URLString object for the given name.
name - the name of the object to unbind.
Throws:
com.sun.media.jsdt.ConnectionException - if a connection error occured.
com.sun.media.jsdt.NoRegistryException - if no Registry process is running.
com.sun.media.jsdt.InvalidURLException - if the url string given is invalid.
com.sun.media.jsdt.NotBoundException - if no object bound to this url string.
com.sun.media.jsdt.TimedOutException - if no reply was received for this operation in the given timeout period.

lookup

public java.lang.Object lookup(com.sun.media.jsdt.Naming naming,
                               com.sun.media.jsdt.URLString urlString,
                               java.lang.String name)
                        throws com.sun.media.jsdt.ConnectionException,
                               com.sun.media.jsdt.NoRegistryException,
                               com.sun.media.jsdt.InvalidURLException,
                               com.sun.media.jsdt.NotBoundException,
                               com.sun.media.jsdt.TimedOutException
lookup returns the JSDT object for the given name. The name should be of the form: jsdt://[:]/// where valid object types are "Session" and "Client". So for example: Session session = lookup("jsdt://stard:3355/socket/Session/chatSession"); Client client = lookup("jsdt://stard:4386/socket/Client/fredClient");
Parameters:
naming - handle to the Naming class that called this method.
urlString - the URLString object for the given name.
name - the name of the object to find.
Returns:
the resolved object.
Throws:
com.sun.media.jsdt.ConnectionException - if a connection error occured.
com.sun.media.jsdt.NoRegistryException - if no Registry process is running.
com.sun.media.jsdt.InvalidURLException - if the url string given is invalid.
com.sun.media.jsdt.NotBoundException - if no object bound to this url string.
com.sun.media.jsdt.TimedOutException - if no reply was received for this operation in the given timeout period.

list

public java.lang.String[] list(com.sun.media.jsdt.Naming naming)
                        throws com.sun.media.jsdt.ConnectionException,
                               com.sun.media.jsdt.NoRegistryException,
                               com.sun.media.jsdt.TimedOutException
list lists all the names of the known bound JSDT objects.
Parameters:
naming - handle to the Naming class that called this method.
Returns:
an array of Strings of the names of all the known bound Shared Data objects.
Throws:
com.sun.media.jsdt.ConnectionException - if a connection error occured.
com.sun.media.jsdt.NoRegistryException - if no Registry process is running.
com.sun.media.jsdt.TimedOutException - if no reply was received for this operation in the given timeout period.