com.sun.media.jsdt
Class ClientFactory

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

public class ClientFactory
extends com.sun.media.jsdt.impl.JSDTObject

The ClientFactory class. This is a factory class that is used to create a special Client that can be invited to join a Session, ByteArray, Channel or Token. If you do not need this functionality, then you should just implement the Client interface. See the JSDT User Guide for examples of using both a normal Client and the ClientFactory.

Since:
JSDT 1.3
Version:
1.5 - 7th January 1999
Author:
Rich Burridge
See Also:
Serialized Form

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
 
Constructor Summary
ClientFactory()
           
 
Method Summary
static boolean clientExists(java.lang.String url)
          Deprecated. This method is inconsistent with the way to check for special Clients now. As of JSDT 1.5, the preferred way to do this is via the clientExists(URLString urlString) method.
static boolean clientExists(URLString urlString)
           is a class method that checks if a Client with the given url string already exists.
static void createClient(java.lang.String url, Client client, ClientListener listener)
          Deprecated. This method is inconsistent with the way special Clients are now created. As of JSDT 1.5, the preferred way to do this is via the createClient(URLString urlString, Client client, ClientListener listener) method.
static void createClient(URLString urlString, Client client, ClientListener listener)
           createClient is a class method that will create a new special Client of the appropriate type.
 
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
 

Constructor Detail

ClientFactory

public ClientFactory()
Method Detail

createClient

public static void createClient(URLString urlString,
                                Client client,
                                ClientListener listener)
                         throws ConnectionException,
                                InvalidClientException,
                                InvalidURLException,
                                NoRegistryException,
                                NoSuchHostException,
                                NoSuchClientException,
                                PortInUseException,
                                TimedOutException
createClient is a class method that will create a new special Client of the appropriate type. This Client will be capable of being invited to join a JSDT Session. If a Client with this URL already existed in the registry, then it will be rebound with these new client and listener objects.
Parameters:
urlString - the URLString for this client.
client - the Client to use for authentication purposes.
listener - the ClientListener to send invite/expel events to.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null, or returns a name that is not the same as the object name portion of the URLString parameter).
InvalidURLException - if the url string given is invalid.
NoRegistryException - if no Registry process running.
NoSuchHostException - if the host name in the url string doesn't exist.
NoSuchClientException - if a Client of this type doesn't exist.
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
See Also:
Client, ClientListener

createClient

public static void createClient(java.lang.String url,
                                Client client,
                                ClientListener listener)
                         throws ConnectionException,
                                InvalidClientException,
                                InvalidURLException,
                                NoRegistryException,
                                NoSuchHostException,
                                NoSuchClientException,
                                PortInUseException,
                                TimedOutException
Deprecated. This method is inconsistent with the way special Clients are now created. As of JSDT 1.5, the preferred way to do this is via the createClient(URLString urlString, Client client, ClientListener listener) method.
createClient is a class method that will create a new special Client of the appropriate type. This Client will be capable of being invited to join a JSDT Session. If a Client with this URL already existed in the registry, then it will be rebound with these new client and listener objects.
Parameters:
url - the url for this client.
client - the Client to use for authentication purposes.
listener - the ClientListener to send invite/expel events to.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null, or returns a name that is not the same as the object name portion of the URL String parameter).
InvalidURLException - if url string given is invalid.
NoRegistryException - if no Registry process running.
NoSuchHostException - if the host name in the url doesn't exist.
NoSuchClientException - if a Client of this type doesn't exist.
PortInUseException - if this port is being used by another application.
TimedOutException - if no reply was received for this operation in the given timeout period.
See Also:
Client, ClientListener

clientExists

public static boolean clientExists(URLString urlString)
                            throws ConnectionException,
                                   NoSuchHostException,
                                   NoRegistryException,
                                   InvalidURLException,
                                   TimedOutException
is a class method that checks if a Client with the given url string already exists.
Parameters:
urlString - the Client URLString to check.
Returns:
true if the Client already exists; false if it doesn't.
Throws:
ConnectionException - if a connection error occured.
NoSuchHostException - if if the host name in the url string doesn't exist.
NoRegistryException - if no Registry process running.
InvalidURLException - if the url string given is invalid.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5

clientExists

public static boolean clientExists(java.lang.String url)
                            throws ConnectionException,
                                   NoSuchHostException,
                                   NoRegistryException,
                                   InvalidURLException,
                                   TimedOutException
Deprecated. This method is inconsistent with the way to check for special Clients now. As of JSDT 1.5, the preferred way to do this is via the clientExists(URLString urlString) method.
is a class method that checks if a Client with the given url already exists.
Parameters:
url - the Client url to check.
Returns:
true if the Client already exists; false if it doesn't.
Throws:
ConnectionException - if a connection error occured.
NoSuchHostException - if if the host name in the url doesn't exist.
NoRegistryException - if no Registry process running.
InvalidURLException - if url string given is invalid.
TimedOutException - if no reply was received for this operation in the given timeout period.