log.entering ("com.sun.grid.jgrid.proxy.ComputeProxy", "processDirtyCall");
//Read arguments
ObjID[] ids = null;
long seqNum = -1L;
Lease lease = null;
log.log (Level.FINEST, "Reading arguments");
try {
ids = (ObjID[])objIn.readObject ();
seqNum = objIn.readLong ();
lease = (Lease)objIn.readObject ();
if (ids.length > 0) {
log.log (Level.FINE, "Dirty call for " + ids[0].toString ());
}
}
catch (ClassNotFoundException e) {
this.processException (out, new RemoteException ("Unable to find class", e));
log.throwing ("com.sun.grid.jgrid.ComputeEngine", "processDirtyCall", e);
return;
}
catch (ClassCastException e) {
this.processException (out, new RemoteException ("Incorrect argument type", e));
log.throwing ("com.sun.grid.jgrid.ComputeEngine", "processDirtyCall", e);
return;
}
//Write message type
log.log (Level.FINEST, "Writing return header");
out.writeByte (TransportConstants.Return);
MarshalOutputStream objOut = new MarshalOutputStream (out);
//Write message header
objOut.writeByte (TransportConstants.NormalReturn);
uid.write (objOut);
//If the lease we were passed has a valid VM ID, write it
if (lease.getVMID () != null) {
log.log (Level.FINEST, "Writing old lease object");
objOut.writeObject (lease);
}
//If not, create a valid lease and write it
else {
log.log (Level.FINEST, "Writing new lease object");
objOut.writeObject (new Lease (new VMID (), lease.getValue ()));
}
objOut.flush ();
log.exiting ("com.sun.grid.jgrid.proxy.ComputeProxy", "processDirtyCall");