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

SocketFactoryConnectionImpl

public class SocketFactoryConnectionImpl extends com.sun.corba.se.impl.transport.SocketOrChannelConnectionImpl
author
Harold Carr

Fields Summary
Constructors Summary
public SocketFactoryConnectionImpl(com.sun.corba.se.spi.orb.ORB orb, com.sun.corba.se.spi.transport.CorbaContactInfo contactInfo, boolean useSelectThreadToWait, boolean useWorkerThread)

	super(orb, useSelectThreadToWait, useWorkerThread);

	// REVISIT - probably need a contact info for both
	// client and server for removing connections from cache?
	this.contactInfo = contactInfo;

	boolean isBlocking = !useSelectThreadToWait;
	SocketInfo socketInfo = 
	    // REVISIT - case - needs interface method
	    ((SocketFactoryContactInfoImpl)contactInfo).socketInfo;
	try {
	    socket = 
		orb.getORBData().getLegacySocketFactory().createSocket(socketInfo);
	    socketChannel = socket.getChannel();
	    if (socketChannel != null) {
		socketChannel.configureBlocking(isBlocking);
	    } else {
		// IMPORTANT: non-channel-backed sockets must use
		// dedicated reader threads.
		setUseSelectThreadToWait(false);
	    }
	    if (orb.transportDebugFlag) {
		dprint(".initialize: connection created: " + socket);
	    }
	} catch (GetEndPointInfoAgainException ex) {
	    throw wrapper.connectFailure(
                ex, socketInfo.getType(), socketInfo.getHost(),
		Integer.toString(socketInfo.getPort())) ;
	} catch (Exception ex) {
	    throw wrapper.connectFailure(
                ex, socketInfo.getType(), socketInfo.getHost(),
		Integer.toString(socketInfo.getPort())) ;
	}
	state = OPENING;
    
Methods Summary
public voiddprint(java.lang.String msg)

	ORBUtility.dprint("SocketFactoryConnectionImpl", msg);
    
public java.lang.StringtoString()

        synchronized ( stateEvent ){
            return 
		"SocketFactoryConnectionImpl[" + " "
		+ (socketChannel == null ?
		   socket.toString() : socketChannel.toString()) + " "
		+ getStateString( state ) + " "
		+ shouldUseSelectThreadToWait() + " "
		+ shouldUseWorkerThreadForEvent()
		+ "]" ;
        }