com.sun.media.jsdt
Class SessionFactory

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

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

The SessionFactory class.

This is a factory class that is the basis for creating new sessions. These would be of the appropriate type (T.120, RMI, TCP/IP ...). The session would then be published by the naming service, and tied to a specific URL.

Since:
JSDT 1.0
Version:
1.5 - 25th February 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
SessionFactory()
           
 
Method Summary
static Session createSession(Client client, java.lang.String url, boolean autoJoin)
          Deprecated. This method is inconsistent with the way Sessions are now created. As of JSDT 1.5, the preferred way to do this is via the createSession(Client client, URLString url, boolean autoJoin) method.
static Session createSession(Client client, URLString urlString, boolean autoJoin)
           createSession is a class method that will create a new session.
static Session createSession(java.lang.String url)
          Deprecated. This method is inconsistent with the way ByteArrays, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createSession(Client client, URLString url, boolean autoJoin) method.
static Session createSession(java.lang.String url, SessionManager sessionManager)
          Deprecated. This method is inconsistent with the way Sessions are now created. As of JSDT 1.5, the preferred way to do this is via the createSession(URLString url, SessionManager sessionManager) method.
static Session createSession(URLString urlString, SessionManager sessionManager)
           createSession is a class method that will create a new session, and associate a session manager with that session.
static boolean sessionExists(java.lang.String url)
          Deprecated. This method is inconsistent with the way to check for Sessions now. As of JSDT 1.5, the preferred way to do this is via the sessionExists(URLString urlString) method.
static boolean sessionExists(URLString urlString)
           is a class method that checks if a Session with the given url string, already exists.
static boolean sessionManaged(URLString urlString)
           is a class method that checks if the Session with the given url is managed.
 
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

SessionFactory

public SessionFactory()
Method Detail

createSession

public static Session createSession(java.lang.String url)
                             throws ConnectionException,
                                    NoRegistryException,
                                    NoSuchHostException,
                                    InvalidURLException,
                                    NoSuchSessionException,
                                    PortInUseException,
                                    TimedOutException
Deprecated. This method is inconsistent with the way ByteArrays, Channels and Tokens are created. As of JSDT 1.5, the preferred way to do this is via the createSession(Client client, URLString url, boolean autoJoin) method.
createSession is a class method that will create a new session. If the Session already exists, a handle is returned to that Session.
Parameters:
url - the url for this session.
Returns:
an appropriate Session.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process running.
NoSuchHostException - if the host name in the url doesn't exist.
InvalidURLException - if url string given is invalid.
NoSuchSessionException - if a session of this type could not be returned.
PortInUseException - if this port is being used by another application.
TimedOutException - if no reply was received for this operation in the given timeout period.

createSession

public static Session createSession(Client client,
                                    URLString urlString,
                                    boolean autoJoin)
                             throws ConnectionException,
                                    InvalidClientException,
                                    InvalidURLException,
                                    NameInUseException,
                                    NoRegistryException,
                                    NoSuchClientException,
                                    NoSuchHostException,
                                    NoSuchSessionException,
                                    PermissionDeniedException,
                                    PortInUseException,
                                    TimedOutException
createSession is a class method that will create a new session. If the Session already exists, a handle is returned to that Session.
Parameters:
client - a client that will potentially be joined to this session.
urlString - the URLString for this session.
autoJoin - if true, automatically join the session when it's created.
Returns:
an appropriate Session.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
InvalidURLException - if the url string given is invalid.
NameInUseException - if a Client with this name is already joined to this Session.
NoRegistryException - if no Registry process running.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the host name in the url string doesn't exist.
NoSuchSessionException - if a session of this type could not be returned.
PermissionDeniedException - if this Client doesn't have permission for this operation.
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

createSession

public static Session createSession(Client client,
                                    java.lang.String url,
                                    boolean autoJoin)
                             throws ConnectionException,
                                    InvalidClientException,
                                    InvalidURLException,
                                    NameInUseException,
                                    NoRegistryException,
                                    NoSuchClientException,
                                    NoSuchHostException,
                                    NoSuchSessionException,
                                    PermissionDeniedException,
                                    PortInUseException,
                                    TimedOutException
Deprecated. This method is inconsistent with the way Sessions are now created. As of JSDT 1.5, the preferred way to do this is via the createSession(Client client, URLString url, boolean autoJoin) method.
createSession is a class method that will create a new session. If the Session already exists, a handle is returned to that Session.
Parameters:
client - a client that will potentially be joined to this session.
url - the url for this session.
autoJoin - if true, automatically join the session when it's created.
Returns:
an appropriate Session.
Throws:
ConnectionException - if a connection error occured.
InvalidClientException - if the Client is invalid is some way (ie. its getName() method returns null).
InvalidURLException - if url string given is invalid.
NameInUseException - if a Client with this name is already joined to this Session.
NoRegistryException - if no Registry process running.
NoSuchClientException - if this Client doesn't exist.
NoSuchHostException - if the host name in the url doesn't exist.
NoSuchSessionException - if a session of this type could not be returned.
PermissionDeniedException - if this Client doesn't have permission for this operation.
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.3

createSession

public static Session createSession(URLString urlString,
                                    SessionManager sessionManager)
                             throws ConnectionException,
                                    NoRegistryException,
                                    NoSuchHostException,
                                    InvalidURLException,
                                    NoSuchSessionException,
                                    ManagerExistsException,
                                    PermissionDeniedException,
                                    PortInUseException,
                                    TimedOutException
createSession is a class method that will create a new session, and associate a session manager with that session. If the Session already exists, a handle is returned to that Session.
Parameters:
urlString - the URLString for this session.
sessionManager - the session manager to associate with this session.
Returns:
an appropriate Session.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process running.
NoSuchHostException - if the host name in the url string doesn't exist.
InvalidURLException - if the url string given is invalid.
NoSuchSessionException - if a session of this type could not be returned.
ManagerExistsException - if a manager already exists for this session.
PermissionDeniedException - if this Session was previously created without a manager attached. You should not be able to add a manager afterwards.
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

createSession

public static Session createSession(java.lang.String url,
                                    SessionManager sessionManager)
                             throws ConnectionException,
                                    NoRegistryException,
                                    NoSuchHostException,
                                    InvalidURLException,
                                    NoSuchSessionException,
                                    ManagerExistsException,
                                    PermissionDeniedException,
                                    PortInUseException,
                                    TimedOutException
Deprecated. This method is inconsistent with the way Sessions are now created. As of JSDT 1.5, the preferred way to do this is via the createSession(URLString url, SessionManager sessionManager) method.
createSession is a class method that will create a new session, and associate a session manager with that session. If the Session already exists, a handle is returned to that Session.
Parameters:
url - the url for this session.
sessionManager - the session manager to associate with this session.
Returns:
an appropriate Session.
Throws:
ConnectionException - if a connection error occured.
NoRegistryException - if no Registry process running.
NoSuchHostException - if the host name in the url doesn't exist.
InvalidURLException - if url string given is invalid.
NoSuchSessionException - if a session of this type could not be returned.
ManagerExistsException - if a manager already exists for this session.
PermissionDeniedException - if this Session was previously created without a manager attached. You should not be able to add a manager afterwards.
PortInUseException - if this port is being used by another application.
TimedOutException - if no reply was received for this operation in the given timeout period.

sessionExists

public static boolean sessionExists(URLString urlString)
                             throws ConnectionException,
                                    NoSuchHostException,
                                    NoRegistryException,
                                    InvalidURLException,
                                    TimedOutException
is a class method that checks if a Session with the given url string, already exists.
Parameters:
urlString - the Session URLString to check.
Returns:
true if the Session 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

sessionExists

public static boolean sessionExists(java.lang.String url)
                             throws ConnectionException,
                                    NoSuchHostException,
                                    NoRegistryException,
                                    InvalidURLException,
                                    TimedOutException
Deprecated. This method is inconsistent with the way to check for Sessions now. As of JSDT 1.5, the preferred way to do this is via the sessionExists(URLString urlString) method.
is a class method that checks if a Session with the given url already exists.
Parameters:
url - the Session url to check.
Returns:
true if the Session 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.

sessionManaged

public static boolean sessionManaged(URLString urlString)
                              throws ConnectionException,
                                     NoSuchHostException,
                                     NoRegistryException,
                                     NoSuchSessionException,
                                     InvalidURLException,
                                     TimedOutException
is a class method that checks if the Session with the given url is managed.
Parameters:
urlString - the Session URLString to check.
Returns:
true if the Session is managed; false if it isn'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.
NoSuchSessionException - if the session name in the url string doesn't exist.
InvalidURLException - if url string given is invalid.
TimedOutException - if no reply was received for this operation in the given timeout period.
Since:
JSDT 1.5