本文整理汇总了Java中com.caucho.hessian.client.HessianConnectionException类的典型用法代码示例。如果您正苦于以下问题:Java HessianConnectionException类的具体用法?Java HessianConnectionException怎么用?Java HessianConnectionException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HessianConnectionException类属于com.caucho.hessian.client包,在下文中一共展示了HessianConnectionException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getErrorCode
import com.caucho.hessian.client.HessianConnectionException; //导入依赖的package包/类
protected int getErrorCode(Throwable e) {
if (e instanceof HessianConnectionException) {
if (e.getCause() != null) {
Class<?> cls = e.getCause().getClass();
if (SocketTimeoutException.class.equals(cls)) {
return RpcException.TIMEOUT_EXCEPTION;
}
}
return RpcException.NETWORK_EXCEPTION;
} else if (e instanceof HessianMethodSerializationException) {
return RpcException.SERIALIZATION_EXCEPTION;
}
return super.getErrorCode(e);
}
示例2: convertHessianAccessException
import com.caucho.hessian.client.HessianConnectionException; //导入依赖的package包/类
/**
* Convert the given Hessian access exception to an appropriate
* Spring RemoteAccessException.
* @param ex the exception to convert
* @return the RemoteAccessException to throw
*/
protected RemoteAccessException convertHessianAccessException(Throwable ex) {
if (ex instanceof HessianConnectionException || ex instanceof ConnectException) {
return new RemoteConnectFailureException(
"Cannot connect to Hessian remote service at [" + getServiceUrl() + "]", ex);
}
else {
return new RemoteAccessException(
"Cannot access Hessian remote service at [" + getServiceUrl() + "]", ex);
}
}
示例3: getErrorCode
import com.caucho.hessian.client.HessianConnectionException; //导入依赖的package包/类
protected int getErrorCode(Throwable e) {
if (e instanceof HessianConnectionException) {
if (e.getCause() != null) {
Class<?> cls = e.getCause().getClass();
if (SocketTimeoutException.class.equals(cls)) {
return JahhanErrorCode.TIMEOUT_EXCEPTION;
}
}
return JahhanErrorCode.NETWORK_EXCEPTION;
} else if (e instanceof HessianMethodSerializationException) {
return JahhanErrorCode.SERIALIZATION_EXCEPTION;
}
return super.getErrorCode(e);
}