FileDocCategorySizeDatePackage
CorbaContactInfoBase.javaAPI DocJava SE 5 API8090Fri Aug 26 14:54:32 BST 2005com.sun.corba.se.impl.transport

CorbaContactInfoBase

public abstract class CorbaContactInfoBase extends Object implements com.sun.corba.se.spi.transport.CorbaContactInfo
author
Harold Carr

Fields Summary
protected com.sun.corba.se.spi.orb.ORB
orb
protected com.sun.corba.se.spi.transport.CorbaContactInfoList
contactInfoList
protected com.sun.corba.se.spi.ior.IOR
effectiveTargetIOR
protected short
addressingDisposition
protected com.sun.corba.se.pept.transport.OutboundConnectionCache
connectionCache
Constructors Summary
Methods Summary
public com.sun.corba.se.pept.encoding.InputObjectcreateInputObject(com.sun.corba.se.pept.broker.Broker broker, com.sun.corba.se.pept.protocol.MessageMediator messageMediator)

	// REVISIT: Duplicate of acceptor code.
	CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
	    messageMediator;
	return new CDRInputObject((ORB)broker,
				  (CorbaConnection)messageMediator.getConnection(),
				  corbaMessageMediator.getDispatchBuffer(),
				  corbaMessageMediator.getDispatchHeader());
    
public com.sun.corba.se.pept.protocol.MessageMediatorcreateMessageMediator(com.sun.corba.se.pept.broker.Broker broker, com.sun.corba.se.pept.transport.ContactInfo contactInfo, com.sun.corba.se.pept.transport.Connection connection, java.lang.String methodName, boolean isOneWay)

	// REVISIT: Would like version, ior, requestid, etc., decisions
	// to be in client subcontract.  Cannot pass these to this
	// factory method because it breaks generic abstraction.
	// Maybe set methods on mediator called from subcontract
	// after creation?
	CorbaMessageMediator messageMediator =
 	    new CorbaMessageMediatorImpl(
	        (ORB) broker,
		contactInfo,
 		connection,
 		GIOPVersion.chooseRequestVersion( (ORB)broker,
		     effectiveTargetIOR),
 		effectiveTargetIOR,
 		((CorbaConnection)connection).getNextRequestId(),
 		getAddressingDisposition(),
 		methodName,
 		isOneWay);

	return messageMediator;
    
public com.sun.corba.se.pept.protocol.MessageMediatorcreateMessageMediator(com.sun.corba.se.pept.broker.Broker broker, com.sun.corba.se.pept.transport.Connection conn)

	ORB orb = (ORB) broker;
	CorbaConnection connection = (CorbaConnection) conn;

        if (orb.transportDebugFlag) {
	    if (connection.shouldReadGiopHeaderOnly()) {
		dprint(
		".createMessageMediator: waiting for message header on connection: "
		+ connection);
	    } else {
		dprint(
		".createMessageMediator: waiting for message on connection: "
		+ connection);
	    }
	}

	Message msg = null;

	if (connection.shouldReadGiopHeaderOnly()) {
	    // read giop header only
	    msg = MessageBase.readGIOPHeader(orb, connection);
	} else {
	    // read entire giop message
	    msg = MessageBase.readGIOPMessage(orb, connection);
	}

	ByteBuffer byteBuffer = msg.getByteBuffer();
	msg.setByteBuffer(null);
	CorbaMessageMediator messageMediator =
	    new CorbaMessageMediatorImpl(orb, connection, msg, byteBuffer);

	return messageMediator;
    
public com.sun.corba.se.pept.encoding.OutputObjectcreateOutputObject(com.sun.corba.se.pept.protocol.MessageMediator messageMediator)

	CorbaMessageMediator corbaMessageMediator = (CorbaMessageMediator)
	    messageMediator;
	
	OutputObject outputObject = 
	    new CDROutputObject(orb, messageMediator, 
				corbaMessageMediator.getRequestHeader(),
				corbaMessageMediator.getStreamFormatVersion());

	messageMediator.setOutputObject(outputObject);
	return outputObject;
    
protected voiddprint(java.lang.String msg)

	ORBUtility.dprint("CorbaContactInfoBase", msg);
    
public com.sun.corba.se.pept.protocol.MessageMediatorfinishCreatingMessageMediator(com.sun.corba.se.pept.broker.Broker broker, com.sun.corba.se.pept.transport.Connection conn, com.sun.corba.se.pept.protocol.MessageMediator messageMediator)

	ORB orb = (ORB) broker;
	CorbaConnection connection = (CorbaConnection) conn;
	CorbaMessageMediator corbaMessageMediator =
	              (CorbaMessageMediator)messageMediator;

        if (orb.transportDebugFlag) {
	    dprint(
	    ".finishCreatingMessageMediator: waiting for message body on connection: "
		+ connection);
	}

	Message msg = corbaMessageMediator.getDispatchHeader();
	msg.setByteBuffer(corbaMessageMediator.getDispatchBuffer());

	// read giop body only
	msg = MessageBase.readGIOPBody(orb, connection, msg);

	ByteBuffer byteBuffer = msg.getByteBuffer();
	msg.setByteBuffer(null);
	corbaMessageMediator.setDispatchHeader(msg);
	corbaMessageMediator.setDispatchBuffer(byteBuffer);

	return corbaMessageMediator;
    
public shortgetAddressingDisposition()

	return addressingDisposition;
    
public com.sun.corba.se.pept.broker.BrokergetBroker()

	return orb;
    
public com.sun.corba.se.pept.protocol.ClientRequestDispatchergetClientRequestDispatcher()

	int scid =
	    getEffectiveProfile().getObjectKeyTemplate().getSubcontractId() ;
	RequestDispatcherRegistry scr = orb.getRequestDispatcherRegistry() ;
	return scr.getClientRequestDispatcher( scid ) ;
    
public com.sun.corba.se.pept.transport.OutboundConnectionCachegetConnectionCache()

	return connectionCache;
    
public com.sun.corba.se.pept.transport.ContactInfoListgetContactInfoList()

	return contactInfoList;
    
public com.sun.corba.se.spi.ior.iiop.IIOPProfilegetEffectiveProfile()

	return effectiveTargetIOR.getProfile();
    
public com.sun.corba.se.spi.ior.IORgetEffectiveTargetIOR()

	return effectiveTargetIOR ;
    
public com.sun.corba.se.spi.ior.IORgetTargetIOR()

	return  contactInfoList.getTargetIOR();
    
public voidsetAddressingDisposition(short addressingDisposition)

        this.addressingDisposition = addressingDisposition;
    
public voidsetConnectionCache(com.sun.corba.se.pept.transport.OutboundConnectionCache connectionCache)

	this.connectionCache = connectionCache;
    
public java.lang.StringtoString()

	return
	    "CorbaContactInfoBase[" 
	    + "]";