src/share/classes/sun/rmi/transport/StreamRemoteCall.java

Print this page




 181             throw new StreamCorruptedException("result already in progress");
 182         else
 183             resultStarted = true;
 184 
 185         // write out return header
 186         // return header, part 1 (read by Transport)
 187         DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
 188         wr.writeByte(TransportConstants.Return);// transport op
 189         getOutputStream(true);  // creates a MarshalOutputStream
 190         // return header, part 2 (read by client-side RemoteCall)
 191         if (success)            //
 192             out.writeByte(TransportConstants.NormalReturn);
 193         else
 194             out.writeByte(TransportConstants.ExceptionalReturn);
 195         out.writeID();          // write id for gcAck
 196         return out;
 197     }
 198 
 199     /**
 200      * Do whatever it takes to execute the call.

 201      */

 202     public void executeCall() throws Exception {
 203         byte returnType;
 204 
 205         // read result header
 206         DGCAckHandler ackHandler = null;
 207         try {
 208             if (out != null) {
 209                 ackHandler = out.getDGCAckHandler();
 210             }
 211             releaseOutputStream();
 212             DataInputStream rd = new DataInputStream(conn.getInputStream());
 213             byte op = rd.readByte();
 214             if (op != TransportConstants.Return) {
 215                 if (Transport.transportLog.isLoggable(Log.BRIEF)) {
 216                     Transport.transportLog.log(Log.BRIEF,
 217                         "transport return code invalid: " + op);
 218                 }
 219                 throw new UnmarshalException("Transport return code invalid");
 220             }
 221             getInputStream();




 181             throw new StreamCorruptedException("result already in progress");
 182         else
 183             resultStarted = true;
 184 
 185         // write out return header
 186         // return header, part 1 (read by Transport)
 187         DataOutputStream wr = new DataOutputStream(conn.getOutputStream());
 188         wr.writeByte(TransportConstants.Return);// transport op
 189         getOutputStream(true);  // creates a MarshalOutputStream
 190         // return header, part 2 (read by client-side RemoteCall)
 191         if (success)            //
 192             out.writeByte(TransportConstants.NormalReturn);
 193         else
 194             out.writeByte(TransportConstants.ExceptionalReturn);
 195         out.writeID();          // write id for gcAck
 196         return out;
 197     }
 198 
 199     /**
 200      * Do whatever it takes to execute the call.
 201      * (Exception thrown before fallthrough can occur)
 202      */
 203     @SuppressWarnings("fallthrough")
 204     public void executeCall() throws Exception {
 205         byte returnType;
 206 
 207         // read result header
 208         DGCAckHandler ackHandler = null;
 209         try {
 210             if (out != null) {
 211                 ackHandler = out.getDGCAckHandler();
 212             }
 213             releaseOutputStream();
 214             DataInputStream rd = new DataInputStream(conn.getInputStream());
 215             byte op = rd.readByte();
 216             if (op != TransportConstants.Return) {
 217                 if (Transport.transportLog.isLoggable(Log.BRIEF)) {
 218                     Transport.transportLog.log(Log.BRIEF,
 219                         "transport return code invalid: " + op);
 220                 }
 221                 throw new UnmarshalException("Transport return code invalid");
 222             }
 223             getInputStream();