com.sun.media.jsdt
Class Naming

java.lang.Object
  |
  +--com.sun.media.jsdt.impl.JSDTObject
        |
        +--com.sun.media.jsdt.Naming

public final class Naming
extends com.sun.media.jsdt.impl.JSDTObject

The Naming class. This class provides simple URL based naming for JSDT objects. Based on the RMI Naming class.

Since:
JSDT 1.0
Version:
1.5 - 25th February 1999
Author:
Rich Burridge
See Also:
Serialized Form

Field Summary
 com.sun.media.jsdt.impl.AbstractNamingProxy po
          Handle to Naming class proxy.
 
Fields inherited from class com.sun.media.jsdt.impl.JSDTObject
giveTime, httpTunnelPort, maxQueueSize, maxThreadPoolSize, pingPeriod, registryAddress, registryPort, registryTime, showMessage, showStack, socketFactoryClass, SSLCipher, timeoutPeriod, TTL, versionString
 
Method Summary
static void bind(java.lang.String name, java.lang.Object object)
          Deprecated. This method is inconsistent with the way URL Strings are now handled by the Naming class. As of JSDT 1.5, the preferred way to do this is via the bind(URLString urlString, Object object) method.
static void bind(URLString urlString, java.lang.Object object)
           binds the url string to the specified JSDT object.
static java.lang.String[] list()
           lists all the url strings of the known bound JSDT objects.
static java.lang.String[] list(java.lang.String host, java.lang.String connectionType)
           lists all the url strings of the known bound JSDT objects on the given host.
static java.lang.Object lookup(java.lang.String name)
          Deprecated. This method is inconsistent with the way URL Strings are now handled by the Naming class. As of JSDT 1.5, the preferred way to do this is via the lookup(URLString urlString) method.
static java.lang.Object lookup(URLString urlString)
           returns the JSDT object for the given url string.
static void rebind(java.lang.String name, java.lang.Object object)
          Deprecated. This method is inconsistent with the way URL Strings are now handled by the Naming class. As of JSDT 1.5, the preferred way to do this is via the rebind(URLString urlString, Object object) method.
static void rebind(URLString urlString, java.lang.Object object)
           rebinds the url string to a new object, replacing any existing binding.
static void unbind(java.lang.String name, java.lang.Object object)
          Deprecated. This method is inconsistent with the way URL Strings are now handled by the Naming class. As of JSDT 1.5, the preferred way to do this is via the unbind(URLString urlString) method.
static void unbind(URLString urlString)
           unbinds the object associated with this url string.
 
Methods inherited from class com.sun.media.jsdt.impl.JSDTObject
error, getConnectionType, setConnectionType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

po

public com.sun.media.jsdt.impl.AbstractNamingProxy po
Handle to Naming class proxy.
Method Detail

bind

public static void bind(URLString urlString,
                        java.lang.Object object)
                 throws ConnectionException,
                        NoRegistryException,
                        NoSuchHostException,
                        InvalidURLException,
                        AlreadyBoundException,
                        PortInUseException,
                        TimedOutException
binds the url string to the specified JSDT object.
 The name should be of the form:
     jsdt://:///

 where  is the connection (or implementation) type
 (eg. "socket", "http", "lrmp" or "rmi"),
 and 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:
urlString - the URLString associated with this object.
object - the object to bind.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
NoSuchHostException - if the host name in the url string doesn't exist.
InvalidURLException - if the url string given is invalid.
AlreadyBoundException - if this url string is already bound to an object.
PortInUseException - if this port is being used by another application.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

bind

public static void bind(java.lang.String name,
                        java.lang.Object object)
                 throws ConnectionException,
                        NoRegistryException,
                        NoSuchHostException,
                        InvalidURLException,
                        AlreadyBoundException,
                        PortInUseException,
                        TimedOutException
Deprecated. This method is inconsistent with the way URL Strings are now handled by the Naming class. As of JSDT 1.5, the preferred way to do this is via the bind(URLString urlString, Object object) method.
binds the name to the specified JSDT object.
 The name should be of the form:
     jsdt://[:]///

 where  is the implementation type (eg. "socket"),
 and 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:
name - the name associated with this object.
object - the object to bind.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
NoSuchHostException - if the host name in the url doesn't exist.
InvalidURLException - if the url string given is invalid.
AlreadyBoundException - if this url string is already bound to an object.
PortInUseException - if this port is being used by another application.
TimedOutException - if no reply was received for this operation in the given timeout period.

rebind

public static void rebind(URLString urlString,
                          java.lang.Object object)
                   throws ConnectionException,
                          NoRegistryException,
                          NoSuchHostException,
                          InvalidURLException,
                          PortInUseException,
                          TimedOutException
rebinds the url string to a new object, replacing any existing binding.
Parameters:
urlString - the URLString associated with this new object.
object - the object to rebind.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
NoSuchHostException - if the host name in the url string doesn't exist.
InvalidURLException - if the url string given is invalid.
PortInUseException - if this port is being used by another application.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

rebind

public static void rebind(java.lang.String name,
                          java.lang.Object object)
                   throws ConnectionException,
                          NoRegistryException,
                          NoSuchHostException,
                          InvalidURLException,
                          PortInUseException,
                          TimedOutException
Deprecated. This method is inconsistent with the way URL Strings are now handled by the Naming class. As of JSDT 1.5, the preferred way to do this is via the rebind(URLString urlString, Object object) method.
rebinds the name to a new object, replacing any existing binding.
Parameters:
name - the name associated with this new object.
object - the object to rebind.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
NoSuchHostException - if the host name in the url doesn't exist.
InvalidURLException - if the url string given is invalid.
PortInUseException - if this port is being used by another application.
TimedOutException - if no reply was received for this operation in the given timeout period.

unbind

public static void unbind(URLString urlString)
                   throws ConnectionException,
                          NoRegistryException,
                          NoSuchHostException,
                          InvalidURLException,
                          NotBoundException,
                          TimedOutException
unbinds the object associated with this url string.
Parameters:
urlString - the URLString of the object to unbind.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
NoSuchHostException - if the host name in the url string doesn't exist.
InvalidURLException - if the url string given is invalid.
NotBoundException - if no object bound to this url string.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

unbind

public static void unbind(java.lang.String name,
                          java.lang.Object object)
                   throws ConnectionException,
                          NoRegistryException,
                          NoSuchHostException,
                          InvalidURLException,
                          NotBoundException,
                          TimedOutException
Deprecated. This method is inconsistent with the way URL Strings are now handled by the Naming class. As of JSDT 1.5, the preferred way to do this is via the unbind(URLString urlString) method.
unbinds the object associated with this name.
Parameters:
name - the name of the object to unbind.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
NoSuchHostException - if the host name in the url doesn't exist.
InvalidURLException - if the url string given is invalid.
NotBoundException - if no object bound to this url string.
TimedOutException - if no reply was received for this operation in the given timeout period.

lookup

public static java.lang.Object lookup(URLString urlString)
                               throws ConnectionException,
                                      NoRegistryException,
                                      NoSuchHostException,
                                      InvalidURLException,
                                      NotBoundException,
                                      TimedOutException
returns the JSDT object for the given url string.
 The name should be of the form:
     jsdt://:///

 where  is the connection (or implementation) type 
 (eg. "socket", "http", "lrmp" or "rmi"),
 and 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:
urlString - the URLString of the object to find.
Returns:
the resolved object.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
NoSuchHostException - if the host name in the url string doesn't exist.
InvalidURLException - if the url string given is invalid.
NotBoundException - if no object bound to this url string.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

lookup

public static java.lang.Object lookup(java.lang.String name)
                               throws ConnectionException,
                                      NoRegistryException,
                                      NoSuchHostException,
                                      InvalidURLException,
                                      NotBoundException,
                                      TimedOutException
Deprecated. This method is inconsistent with the way URL Strings are now handled by the Naming class. As of JSDT 1.5, the preferred way to do this is via the lookup(URLString urlString) method.
returns the JSDT object for the given name.
 The name should be of the form:
     jsdt://[:]///

 where  is the implementation type (eg. "socket"),
 and 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:
name - the name of the object to find.
Returns:
the resolved object.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
NoSuchHostException - if the host name in the url doesn't exist.
InvalidURLException - if the url string given is invalid.
NotBoundException - if no object bound to this url string.
TimedOutException - if no reply was received for this operation in the given timeout period.

list

public static java.lang.String[] list()
                               throws ConnectionException,
                                      NoRegistryException,
                                      TimedOutException
lists all the url strings of the known bound JSDT objects.
Returns:
an array of Strings of the names of all the known bound JSDT objects, or null if there are no bound objects.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process is running.
TimedOutException - if no reply was received for this operation in the given timeout period.

list

public static java.lang.String[] list(java.lang.String host,
                                      java.lang.String connectionType)
                               throws ConnectionException,
                                      NoSuchHostException,
                                      NoRegistryException,
                                      TimedOutException
lists all the url strings of the known bound JSDT objects on the given host.
Parameters:
host - host name of the machine to look for bound JSDT objects on.
connectType - implementation connection type (eg. "socket").
Returns:
an array of Strings of the names of all the known bound JSDT objects on the given host, or null if there are no bound objects.
Throws:
ConnectionException - if a connection error occured.
NoSuchHostException - if the host doesn't exist.
NoRegistryException - if no Registry process is running.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5