FileDocCategorySizeDatePackage
DefaultSocketFactory.javaAPI DocJava SE 5 API3210Fri Aug 26 14:54:24 BST 2005com.sun.corba.se.impl.legacy.connection

DefaultSocketFactory

public class DefaultSocketFactory extends Object implements com.sun.corba.se.spi.legacy.connection.ORBSocketFactory

Fields Summary
private com.sun.corba.se.spi.orb.ORB
orb
private static com.sun.corba.se.impl.logging.ORBUtilSystemException
wrapper
Constructors Summary
public DefaultSocketFactory()


     
    
    
Methods Summary
public java.net.ServerSocketcreateServerSocket(java.lang.String type, int port)

	if (! type.equals(ORBSocketFactory.IIOP_CLEAR_TEXT)) {
	    throw wrapper.defaultCreateServerSocketGivenNonIiopClearText( type ) ;
	}

	ServerSocket serverSocket;

	if (orb.getORBData().acceptorSocketType().equals(ORBConstants.SOCKETCHANNEL)) {
	    ServerSocketChannel serverSocketChannel =
		ServerSocketChannel.open();
	    serverSocket = serverSocketChannel.socket();
	} else {
	    serverSocket = new ServerSocket();
	}
	serverSocket.bind(new InetSocketAddress(port));
	return serverSocket;
    
public java.net.SocketcreateSocket(com.sun.corba.se.spi.transport.SocketInfo socketInfo)

	Socket socket;

	if (orb.getORBData().acceptorSocketType().equals(ORBConstants.SOCKETCHANNEL)) {
	    InetSocketAddress address = 
		new InetSocketAddress(socketInfo.getHost(), 
				      socketInfo.getPort());
	    SocketChannel socketChannel = SocketChannel.open(address);
	    socket = socketChannel.socket();
	} else {
	    socket = new Socket(socketInfo.getHost(), 
				socketInfo.getPort());
	}

	// REVISIT - this is done in SocketOrChannelConnectionImpl
	try {
	    socket.setTcpNoDelay(true);
	} catch (Exception e) {
	    ;
	}
	return socket;
    
public com.sun.corba.se.spi.transport.SocketInfogetEndPointInfo(org.omg.CORBA.ORB orb, com.sun.corba.se.spi.ior.IOR ior, com.sun.corba.se.spi.transport.SocketInfo socketInfo)

        IIOPProfileTemplate temp = 
	    (IIOPProfileTemplate)ior.getProfile().getTaggedProfileTemplate() ;
	IIOPAddress primary = temp.getPrimaryAddress() ;

	return new EndPointInfoImpl(ORBSocketFactory.IIOP_CLEAR_TEXT,
				    primary.getPort(),
				    primary.getHost().toLowerCase());
    
public voidsetORB(com.sun.corba.se.spi.orb.ORB orb)

	this.orb = orb;