FileDocCategorySizeDatePackage
SocketOrChannelContactInfoImpl.javaAPI DocJava SE 5 API4335Fri Aug 26 14:54:34 BST 2005com.sun.corba.se.impl.transport

SocketOrChannelContactInfoImpl

public class SocketOrChannelContactInfoImpl extends CorbaContactInfoBase implements SocketInfo
author
Harold Carr

Fields Summary
protected boolean
isHashCodeCached
protected int
cachedHashCode
protected String
socketType
protected String
hostname
protected int
port
Constructors Summary
protected SocketOrChannelContactInfoImpl()


    // XREVISIT 
    // See SocketOrChannelAcceptorImpl.createMessageMediator
    // See SocketFactoryContactInfoImpl.constructor()
    // See SocketOrChannelContactInfoImpl.constructor()
     
    
    
protected SocketOrChannelContactInfoImpl(ORB orb, CorbaContactInfoList contactInfoList)

	this.orb = orb;
	this.contactInfoList = contactInfoList;
    
public SocketOrChannelContactInfoImpl(ORB orb, CorbaContactInfoList contactInfoList, String socketType, String hostname, int port)

	this(orb, contactInfoList);
	this.socketType = socketType;
	this.hostname = hostname;
	this.port     = port;
    
public SocketOrChannelContactInfoImpl(ORB orb, CorbaContactInfoList contactInfoList, IOR effectiveTargetIOR, short addressingDisposition, String socketType, String hostname, int port)

	this(orb, contactInfoList, socketType, hostname, port);
	this.effectiveTargetIOR = effectiveTargetIOR;
	this.addressingDisposition = addressingDisposition;
    
Methods Summary
public com.sun.corba.se.pept.transport.ConnectioncreateConnection()

	Connection connection =
	    new SocketOrChannelConnectionImpl(orb, this, 
					      socketType, hostname, port);
	return connection;
    
protected voiddprint(java.lang.String msg)

	ORBUtility.dprint("SocketOrChannelContactInfoImpl", msg);
    
public booleanequals(java.lang.Object obj)

	if (obj == null) {
	    return false;
	} else if (!(obj instanceof SocketOrChannelContactInfoImpl)) {
	    return false;
	}

	SocketOrChannelContactInfoImpl other =
	    (SocketOrChannelContactInfoImpl) obj;

        if (port != other.port) {
            return false;
	}
        if (!hostname.equals(other.hostname)) {
            return false;
        }
	if (socketType == null) {
	    if (other.socketType != null) {
		return false;
	    }
	} else if (!socketType.equals(other.socketType)) {
	    return false;
	}
        return true;
    
public java.lang.StringgetConnectionCacheType()

	return CorbaTransportManager.SOCKET_OR_CHANNEL_CONNECTION_CACHE;
    
public java.lang.StringgetHost()

	return hostname;
    
public java.lang.StringgetMonitoringName()

	return "SocketConnections";
    
public intgetPort()

	return port;
    
public java.lang.StringgetType()

	return socketType;
    
public inthashCode()

	if (! isHashCodeCached) {
	    cachedHashCode = socketType.hashCode() ^ hostname.hashCode() ^ port;
	    isHashCodeCached = true;
	}
	return cachedHashCode;
    
public booleanisConnectionBased()

	return true;
    
public booleanshouldCacheConnection()

	return true;
    
public java.lang.StringtoString()

	return
	    "SocketOrChannelContactInfoImpl[" 
	    + socketType + " "
	    + hostname + " "
	    + port
	    + "]";