com.sun.media.jsdt.template
Class NamingProxy

java.lang.Object
  |
  +--com.sun.media.jsdt.template.templateJSDTObject
        |
        +--com.sun.media.jsdt.template.NamingProxy

public final class NamingProxy
extends com.sun.media.jsdt.template.templateJSDTObject
implements AbstractNamingProxy

JSDT Naming proxy class.

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

Constructor Summary
NamingProxy()
           
 
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NamingProxy

public NamingProxy()
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.
Specified by:
initProxy in interface AbstractNamingProxy
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.
Specified by:
getProxy in interface AbstractNamingProxy
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);
Specified by:
bind in interface AbstractNamingProxy
Parameters:
naming - handle to the Naming class that called this method.
- 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.
Specified by:
rebind in interface AbstractNamingProxy
Parameters:
naming - handle to the Naming class that called this method.
- 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.
Specified by:
unbind in interface AbstractNamingProxy
Parameters:
naming - handle to the Naming class that called this method.
- 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");
Specified by:
lookup in interface AbstractNamingProxy
Parameters:
naming - handle to the Naming class that called this method.
- 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.
Specified by:
list in interface AbstractNamingProxy
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.