protected void handleInvalidRequest(SerializationStrategy serializationStrategy, ClassLoader loader, Method method, Object target, DataByteArrayOutputStream responseStream, Runnable onComplete) {
//client made an invalid request
int pos = responseStream.position();
try {
Object value = null;
Throwable error = (Throwable)target;
serializationStrategy.encodeResponse(loader, null, value, error, responseStream);
} catch(Exception e) {
LOGGER.warn("Initial Encoding response for method "+method+" failed. Retrying",e);
// we failed to encode the response.. reposition and write that error.
try {
responseStream.position(pos);
serializationStrategy.encodeResponse(loader, null, null, new ServiceException(e.toString()), responseStream);
} catch (Exception unexpected) {
LOGGER.error("Error while servicing "+method,unexpected);
}
} finally {
onComplete.run();
}
}
AbstractInvocationStrategy.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:aries-rsa
作者:
评论列表
文章目录