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) { |
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 |
} |
} |
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) { |
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 |
} |
} |