1 7 8 16 17 package com.sun.corba.se.impl.protocol; 18 19 import java.io.IOException ; 20 import java.util.Iterator ; 21 import java.rmi.RemoteException ; 22 import java.nio.ByteBuffer ; 23 24 import javax.rmi.CORBA.Util ; 25 import javax.rmi.CORBA.Tie ; 26 27 import org.omg.CORBA.COMM_FAILURE ; 28 import org.omg.CORBA.INTERNAL ; 29 import org.omg.CORBA.SystemException ; 30 import org.omg.CORBA.CompletionStatus ; 31 import org.omg.CORBA.WrongTransaction ; 32 import org.omg.CORBA.Request ; 33 import org.omg.CORBA.NamedValue ; 34 import org.omg.CORBA.NVList ; 35 import org.omg.CORBA.Context ; 36 import org.omg.CORBA.ContextList ; 37 import org.omg.CORBA.ExceptionList ; 38 import org.omg.CORBA.TypeCode ; 39 import org.omg.CORBA.DATA_CONVERSION ; 40 import org.omg.CORBA.UNKNOWN ; 41 import org.omg.CORBA.portable.RemarshalException ; 42 import org.omg.CORBA_2_3.portable.InputStream ; 43 import org.omg.CORBA_2_3.portable.OutputStream ; 44 import org.omg.CORBA.portable.Delegate ; 45 import org.omg.CORBA.portable.ServantObject ; 46 import org.omg.CORBA.portable.ApplicationException ; 47 import org.omg.CORBA.portable.UnknownException ; 48 import org.omg.IOP.TAG_CODE_SETS ; 49 50 import com.sun.org.omg.SendingContext.CodeBase; 51 52 import com.sun.corba.se.pept.broker.Broker; 53 import com.sun.corba.se.pept.encoding.InputObject; 54 import com.sun.corba.se.pept.encoding.OutputObject; 55 import com.sun.corba.se.pept.protocol.ClientRequestDispatcher; 56 import com.sun.corba.se.pept.protocol.MessageMediator; 57 import com.sun.corba.se.pept.transport.Connection; 58 import com.sun.corba.se.pept.transport.ConnectionCache; 59 import com.sun.corba.se.pept.transport.ContactInfo; 60 61 import com.sun.corba.se.spi.ior.IOR; 62 import com.sun.corba.se.spi.ior.iiop.GIOPVersion; 63 import com.sun.corba.se.spi.ior.iiop.IIOPProfileTemplate; 64 import com.sun.corba.se.spi.ior.iiop.CodeSetsComponent; 65 import com.sun.corba.se.spi.oa.OAInvocationInfo; 66 import com.sun.corba.se.spi.oa.ObjectAdapterFactory; 67 import com.sun.corba.se.spi.orb.ORB; 68 import com.sun.corba.se.spi.orb.ORBVersion; 69 import com.sun.corba.se.spi.orb.ORBVersionFactory; 70 import com.sun.corba.se.spi.protocol.CorbaMessageMediator; 71 import com.sun.corba.se.spi.protocol.RequestDispatcherRegistry; 72 import com.sun.corba.se.spi.transport.CorbaContactInfo ; 73 import com.sun.corba.se.spi.transport.CorbaContactInfoList ; 74 import com.sun.corba.se.spi.transport.CorbaContactInfoListIterator ; 75 import com.sun.corba.se.spi.transport.CorbaConnection; 76 77 import com.sun.corba.se.spi.servicecontext.ServiceContext; 78 import com.sun.corba.se.spi.servicecontext.ServiceContexts; 79 import com.sun.corba.se.spi.servicecontext.UEInfoServiceContext; 80 import com.sun.corba.se.spi.servicecontext.CodeSetServiceContext; 81 import com.sun.corba.se.spi.servicecontext.MaxStreamFormatVersionServiceContext; 82 import com.sun.corba.se.spi.servicecontext.SendingContextServiceContext; 83 import com.sun.corba.se.impl.encoding.ByteBufferWithInfo; 84 import com.sun.corba.se.impl.encoding.CDRInputObject; 85 import com.sun.corba.se.impl.encoding.CDROutputObject; 86 import com.sun.corba.se.impl.encoding.CDROutputStream; 87 import com.sun.corba.se.impl.encoding.CodeSetComponentInfo; 88 import com.sun.corba.se.impl.encoding.CodeSetConversion; 89 import com.sun.corba.se.impl.encoding.MarshalOutputStream; 90 import com.sun.corba.se.impl.encoding.MarshalInputStream; 91 import com.sun.corba.se.impl.orbutil.ORBUtility; 92 import com.sun.corba.se.impl.orbutil.ORBConstants; 93 import com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage; 94 import com.sun.corba.se.impl.protocol.giopmsgheaders.KeyAddr; 95 import com.sun.corba.se.impl.protocol.giopmsgheaders.ProfileAddr; 96 import com.sun.corba.se.impl.protocol.giopmsgheaders.ReferenceAddr; 97 import com.sun.corba.se.impl.transport.CorbaContactInfoListIteratorImpl; 98 import com.sun.corba.se.impl.util.JDKBridge; 99 100 105 public class SharedCDRClientRequestDispatcherImpl 106 extends 107 CorbaClientRequestDispatcherImpl 108 { 109 117 public InputObject marshalingComplete(java.lang.Object self, 118 OutputObject outputObject) 119 throws 120 ApplicationException , 121 org.omg.CORBA.portable.RemarshalException 122 { 123 ORB orb = null; 124 CorbaMessageMediator messageMediator = null; 125 try { 126 messageMediator = (CorbaMessageMediator) 127 outputObject.getMessageMediator(); 128 129 orb = (ORB) messageMediator.getBroker(); 130 131 if (orb.subcontractDebugFlag) { 132 dprint(".marshalingComplete->: " + opAndId(messageMediator)); 133 } 134 135 CDROutputObject cdrOutputObject = (CDROutputObject) outputObject; 136 137 141 ByteBufferWithInfo bbwi = cdrOutputObject.getByteBufferWithInfo(); 142 cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); 143 144 CDRInputObject cdrInputObject = 145 new CDRInputObject(orb, null, bbwi.byteBuffer, 146 cdrOutputObject.getMessageHeader()); 147 messageMediator.setInputObject(cdrInputObject); 148 cdrInputObject.setMessageMediator(messageMediator); 149 150 154 ((CorbaMessageMediatorImpl)messageMediator).handleRequestRequest( 156 messageMediator); 157 158 try { cdrInputObject.close(); } 162 catch (IOException ex) { 163 167 if (orb.transportDebugFlag) { 168 dprint(".marshalingComplete: ignoring IOException - " + ex.toString()); 169 } 170 } 171 172 176 cdrOutputObject = (CDROutputObject) messageMediator.getOutputObject(); 177 bbwi = cdrOutputObject.getByteBufferWithInfo(); 178 cdrOutputObject.getMessageHeader().setSize(bbwi.byteBuffer, bbwi.getSize()); 179 cdrInputObject = 180 new CDRInputObject(orb, null, bbwi.byteBuffer, 181 cdrOutputObject.getMessageHeader()); 182 messageMediator.setInputObject(cdrInputObject); 183 cdrInputObject.setMessageMediator(messageMediator); 184 185 cdrInputObject.unmarshalHeader(); 186 187 InputObject inputObject = cdrInputObject; 188 189 return processResponse(orb, messageMediator, inputObject); 190 191 } finally { 192 if (orb.subcontractDebugFlag) { 193 dprint(".marshalingComplete<-: " + opAndId(messageMediator)); 194 } 195 } 196 } 197 198 protected void dprint(String msg) 199 { 200 ORBUtility.dprint("SharedCDRClientRequestDispatcherImpl", msg); 201 } 202 } 203 204 | Popular Tags |