dist1.acb.common.transport
Class SocketFactories

java.lang.Object
  extended bydist1.acb.common.transport.SocketFactories

public class SocketFactories
extends java.lang.Object

The main purpose is to create abstraction for creating sockets for different types of objcets.

Version:
$Revision: 1.4 $
Author:
Alexander Stasiv

Method Summary
static javax.net.ServerSocketFactory getServerSocketFactory(java.lang.Object forObject)
          Returns ServerSocketFactory for specific object (the type of object takes into considiration).
static javax.net.ServerSocketFactory getServerSocketFactoryForClass(java.lang.Class forClass)
          Returns ServerSocketFactory for specific class.
static javax.net.SocketFactory getSocketFactory(java.lang.Object forObject)
          Returns SocketFactory for specific object (the type of object takes into considiration).
static javax.net.SocketFactory getSocketFactoryForClass(java.lang.Class forClass)
          Returns SocketFactory for specific class.
static void registerServerSocketFactory(java.lang.String forClass, javax.net.ServerSocketFactory factory)
          Registers new ServerSocketFactory for specific type (class) of objects.
static void registerSocketFactory(java.lang.String forClass, javax.net.SocketFactory factory)
          Registers new SocketFactory for specific type (class) of objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServerSocketFactory

public static javax.net.ServerSocketFactory getServerSocketFactory(java.lang.Object forObject)
Returns ServerSocketFactory for specific object (the type of object takes into considiration). Usually the method is invoked in an abstracton.

Parameters:
forObject - The object
Returns:
The ServerSocketFactory
Throws:
java.lang.RuntimeException - if the appropriate factory was not found

getServerSocketFactoryForClass

public static javax.net.ServerSocketFactory getServerSocketFactoryForClass(java.lang.Class forClass)
Returns ServerSocketFactory for specific class. Usually the method is invoked in an abstracton.

Parameters:
forClass - The class
Returns:
The ServerSocketFactory
Throws:
java.lang.RuntimeException - if the appropriate factory was not found

getSocketFactory

public static javax.net.SocketFactory getSocketFactory(java.lang.Object forObject)
Returns SocketFactory for specific object (the type of object takes into considiration). Usually the method is invoked in an abstracton.

Parameters:
forObject - The object
Returns:
The SocketFactory
Throws:
java.lang.RuntimeException - if the appropriate factory was not found

getSocketFactoryForClass

public static javax.net.SocketFactory getSocketFactoryForClass(java.lang.Class forClass)
Returns SocketFactory for specific class. Usually the method is invoked in an abstracton.

Parameters:
forClass - The object
Returns:
The SocketFactory
Throws:
java.lang.RuntimeException - if the appropriate factory was not found

registerServerSocketFactory

public static void registerServerSocketFactory(java.lang.String forClass,
                                               javax.net.ServerSocketFactory factory)
                                        throws java.lang.ClassNotFoundException
Registers new ServerSocketFactory for specific type (class) of objects. Usually the method is invoked in concrete realization of a socket manager.

Parameters:
forClass - Name of the type (class)
factory - The factory
Throws:
java.lang.ClassNotFoundException - If the class was not found

registerSocketFactory

public static void registerSocketFactory(java.lang.String forClass,
                                         javax.net.SocketFactory factory)
                                  throws java.lang.ClassNotFoundException
Registers new SocketFactory for specific type (class) of objects. Usually the method is invoked in concrete realization of a socket manager.

Parameters:
forClass - Name of the type (class)
factory - The factory
Throws:
java.lang.ClassNotFoundException - If the class was not found


Copyright © 2004 Phoenix Team (CMU/AIT). All Rights Reserved.