FileDocCategorySizeDatePackage
ConnectionFactory.javaAPI DocAndroid 1.5 API1751Wed May 06 22:42:46 BST 2009com.android.im.engine

ConnectionFactory

public class ConnectionFactory extends Object
The factory used to create an instance of ImConnection.

Fields Summary
private static ConnectionFactory
sInstance
Constructors Summary
private ConnectionFactory()

    
Methods Summary
public ImConnectioncreateConnection(ConnectionConfig config)
Creates a new ImConnection.

return
the new ImConnection.
throws
IMException if an error occurs during creating a connection.

        if ("IMPS".equals(config.getProtocolName())) {
            return new ImpsConnection((ImpsConnectionConfig) config);
        } else {
            throw new ImException("Unsupported protocol");
        }
    
public static synchronized com.android.im.engine.ConnectionFactorygetInstance()
Gets the singleton instance of the factory.

return
the singleton instance.

        if (sInstance == null) {
            sInstance = new ConnectionFactory();
        }
        return sInstance;