/[classpath]/classpath/gnu/java/rmi/server/UnicastRef.java
ViewVC logotype

Diff of /classpath/gnu/java/rmi/server/UnicastRef.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by mark, Tue Jan 22 22:26:57 2002 UTC revision 1.3 by cbj, Thu Mar 21 05:40:11 2002 UTC
# Line 107  private Object invokeCommon(Remote obj, Line 107  private Object invokeCommon(Remote obj,
107                  objid.write(out);                  objid.write(out);
108                  out.writeInt(opnum);                  out.writeInt(opnum);
109                  out.writeLong(hash);                  out.writeLong(hash);
110                    /*
111                  if (params != null) {                  if (params != null) {
112                          for (int i = 0; i < params.length; i++) {                          for (int i = 0; i < params.length; i++) {
113                                  if (params[i] instanceof UnicastRemoteObject) {                                  if (params[i] instanceof UnicastRemoteObject) {
# Line 117  private Object invokeCommon(Remote obj, Line 118  private Object invokeCommon(Remote obj,
118                                  }                                  }
119                          }                          }
120                  }                  }
121                    */
122                    // must handle primitive class and their wrapper classes
123                    Class clss[] = method.getParameterTypes();
124                for(int i = 0; i < clss.length; i++)
125                    ((RMIObjectOutputStream)out).writeValue(params[i], clss[i]);
126    
127                  out.flush();                  out.flush();
128          }          }
# Line 139  private Object invokeCommon(Remote obj, Line 145  private Object invokeCommon(Remote obj,
145    
146                  returncode = in.readUnsignedByte();                  returncode = in.readUnsignedByte();
147                  ack = UID.read(in);                  ack = UID.read(in);
148                  returnval = in.readObject();                  //returnval = in.readObject();
149                    Class cls = method.getReturnType();
150            if(cls == Void.TYPE){
151                returnval = null;
152            }else
153                returnval = ((RMIObjectInputStream)in).readValue(cls);
154          }          }
155          catch (IOException e3) {          catch (IOException e3) {
156                  throw new RemoteException("call return failed: ", e3);                  throw new RemoteException("call return failed: ", e3);
157          }          }
158    
159        /* if DGCAck is necessary
160        //According to RMI wire protocol, send a DGCAck
161        // to indicate receiving return value
162        dout.writeByte(MESSAGE_DGCACK);
163        ack.write(dout);
164        out.flush();
165        */
166        
167          manager.discardConnection(conn);          manager.discardConnection(conn);
168    
169          if (returncode != RETURN_ACK) {          if (returncode != RETURN_ACK) {
# Line 183  public void writeExternal(ObjectOutput o Line 202  public void writeExternal(ObjectOutput o
202          }          }
203          manager.write(out);          manager.write(out);
204          objid.write(out);          objid.write(out);
205          out.writeByte(RETURN_ACK);          // This byte is somewhat confusing when interoperating with JDK
206            out.writeByte(0); //RETURN_ACK);
207  }  }
208    
209  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {  public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
210          manager = UnicastConnectionManager.read(in);          manager = UnicastConnectionManager.read(in);
211          objid = ObjID.read(in);          objid = ObjID.read(in);
212          if (in.readByte() != RETURN_ACK) {          byte ack = in.readByte();
213            // This byte is somewhat confusing when interoperating with JDK
214            if (ack != RETURN_ACK && ack != 0/*jdk ack value*/) {
215                  throw new IOException("no ack found");                  throw new IOException("no ack found");
216          }          }
217  }  }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26