left -= amt;
in.write(buf, 0, amt);
}
// deserialize incoming buffer
MethodInvocationResult result = null;
try
{
// ask the executor to invoke the method
RemoteMethodInvocation mi = (RemoteMethodInvocation) SerializationHelper.deserialize(in.toByteArray());
result = new MethodInvocationResult(executor.invoke(addr, mi));
}
catch (ClassNotFoundException cnf)
{
log.error("Class Not Found during de-serializing of remote method invocation.",cnf);
result = new MethodInvocationResult(cnf);
}
catch (Throwable t)
{
if (logMethod && log.isDebugEnabled())
{
log.debug("Exception in method execution ...",t);
}
result = new MethodInvocationResult(t);
}
in = null;
// return the byte buffer result