} catch (NoSuchMethodException nsme) {
// server error, no such method
mresp = new MethodResponse(
MethodResponse.ResultCode.REMOTE_OBJECT_EXCEPTION,
null, new SimpleRpcException("no such method m=" + methodName));
} catch (IllegalAccessException iae) {
// server error, method not accessible
mresp = new MethodResponse(
MethodResponse.ResultCode.REMOTE_OBJECT_EXCEPTION,
null, new SimpleRpcException("method not accessible, m=" + methodName));
} catch (InvocationTargetException ite) {
// real business object exception
mresp = new MethodResponse(
MethodResponse.ResultCode.REMOTE_OBJECT_EXCEPTION,
null, ite.getTargetException());
}
} else {
// server error, invalid method name
mresp = new MethodResponse(
MethodResponse.ResultCode.REMOTE_OBJECT_EXCEPTION,
null, new SimpleRpcException("no such method m=" + methodName));
}
} else {
// return server error, could not find object
mresp = new MethodResponse(
MethodResponse.ResultCode.SERVER_ERROR,
null, new SimpleRpcException("object not found objectId=" + objectId));
}
} else {
// return server error, invalid key
mresp = new MethodResponse(
MethodResponse.ResultCode.SERVER_ERROR,
null, new SimpleRpcException("invalid objectId=" + objectId));
}
// write response
oos.writeObject(mresp);
oos.flush();
}
// finish client serving
oos.close();
}
} catch (UnknownHostException e) {
throw new SimpleRpcException(e);
} catch (IOException e) {
throw new SimpleRpcException(e);
} catch (ClassNotFoundException e) {
throw new SimpleRpcException(e);
} finally {
// close the object output stream
if (oos != null) {
try {