//Write message type
log.log (Level.FINEST, "Writing return header");
out.writeByte (TransportConstants.Return);
MarshalOutputStream objOut = new MarshalOutputStream (out);
//Write message header
if (returnValue instanceof Throwable) {
log.log (Level.FINER, "Exceptional return");
objOut.writeByte (TransportConstants.ExceptionalReturn);
//If the exception is a RemoteException, wrap it in a RemoteException
if (!(returnValue instanceof RemoteException)) {
log.log (Level.FINEST, "Wrapping exception in RemoteException");
returnValue = new RemoteException ("An error occured while processing the Computable object", (Throwable)returnValue);
}
}
else {
log.log (Level.FINER, "Normal return");
objOut.writeByte (TransportConstants.NormalReturn);
}
uid.write (objOut);
//Write results
log.log (Level.FINEST, "Writing results");
objOut.writeObject (returnValue);
objOut.flush ();
log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processComputeCall");
}