FileDocCategorySizeDatePackage
SharedCDRClientRequestDispatcherImpl.javaAPI DocJava SE 5 API7454Fri Aug 26 14:54:32 BST 2005com.sun.corba.se.impl.protocol

SharedCDRClientRequestDispatcherImpl

public class SharedCDRClientRequestDispatcherImpl extends CorbaClientRequestDispatcherImpl
ClientDelegate is the RMI client-side subcontract or representation It implements RMI delegate as well as our internal ClientRequestDispatcher interface.

Fields Summary
Constructors Summary
Methods Summary
protected voiddprint(java.lang.String msg)

	ORBUtility.dprint("SharedCDRClientRequestDispatcherImpl", msg);
    
public com.sun.corba.se.pept.encoding.InputObjectmarshalingComplete(java.lang.Object self, com.sun.corba.se.pept.encoding.OutputObject outputObject)

      ORB orb = null;
      CorbaMessageMediator messageMediator = null;
      try {
	messageMediator = (CorbaMessageMediator)
	    outputObject.getMessageMediator();

	orb = (ORB) messageMediator.getBroker();

	if (orb.subcontractDebugFlag) {
	    dprint(".marshalingComplete->: " + opAndId(messageMediator));
	}

	CDROutputObject cdrOutputObject = (CDROutputObject) outputObject;

	//
	// Create server-side input object.
	//

	ByteBufferWithInfo bbwi = cdrOutputObject.getByteBufferWithInfo();
	cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize());

	CDRInputObject cdrInputObject =
	    new CDRInputObject(orb, null, bbwi.byteBuffer,
			       cdrOutputObject.getMessageHeader());
	messageMediator.setInputObject(cdrInputObject);
	cdrInputObject.setMessageMediator(messageMediator);

	//
	// Dispatch
	//

	// REVISIT: Impl cast.
	((CorbaMessageMediatorImpl)messageMediator).handleRequestRequest(
            messageMediator);

        // InputStream must be closed on the InputObject so that its
        // ByteBuffer can be released to the ByteBufferPool. We must do
        // this before we re-assign the cdrInputObject reference below.
        try { cdrInputObject.close(); }
        catch (IOException ex) {
            // No need to do anything since we're done with the input stream
            // and cdrInputObject will be re-assigned a new client-side input
            // object, (i.e. won't result in a corba error).
           
            if (orb.transportDebugFlag) {
               dprint(".marshalingComplete: ignoring IOException - " + ex.toString());
            }
        }

	//
	// Create client-side input object
	//

	cdrOutputObject = (CDROutputObject) messageMediator.getOutputObject();
	bbwi = cdrOutputObject.getByteBufferWithInfo();
	cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize());
	cdrInputObject =
	    new CDRInputObject(orb, null, bbwi.byteBuffer,
			       cdrOutputObject.getMessageHeader());
	messageMediator.setInputObject(cdrInputObject);
	cdrInputObject.setMessageMediator(messageMediator);

	cdrInputObject.unmarshalHeader();

	InputObject inputObject = cdrInputObject;

	return processResponse(orb, messageMediator, inputObject);

      } finally {
        if (orb.subcontractDebugFlag) {
	    dprint(".marshalingComplete<-: " + opAndId(messageMediator));
	}
      }