本文整理汇总了Java中io.apiman.gateway.engine.async.IAsyncResult.getError方法的典型用法代码示例。如果您正苦于以下问题:Java IAsyncResult.getError方法的具体用法?Java IAsyncResult.getError怎么用?Java IAsyncResult.getError使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类io.apiman.gateway.engine.async.IAsyncResult
的用法示例。
在下文中一共展示了IAsyncResult.getError方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: verifyResult
import io.apiman.gateway.engine.async.IAsyncResult; //导入方法依赖的package包/类
/**
* Verify the session data.
*
* @param result the result of retrieving session data
* @param sessionId the ID of the session
* @param request the service request
* @param context the policy context
* @param config the policy configuration
* @return the result of the validation
*/
private ValidationResult verifyResult(IAsyncResult<Session> result, String sessionId, ApiRequest request,
IPolicyContext context, CookieValidateConfigBean config) {
final ValidationResult validationResult;
final Session sessionData = result.getResult();
if (result.isSuccess() && null != sessionData && StringUtils.isNotBlank(sessionData.getSessionId())) {
validationResult = verifySessionData(sessionData, sessionId, request, context, config);
} else {
//noinspection ThrowableResultOfMethodCallIgnored
if (null != result.getError()) {
LOGGER.error(MESSAGES.format("ErrorReadingSessionData", sessionId), result.getError());
}
// session not present
validationResult = new ValidationResult(false,
MESSAGES.format("MissingSessionData", sessionId));
}
return validationResult;
}
示例2: handle
import io.apiman.gateway.engine.async.IAsyncResult; //导入方法依赖的package包/类
@Override
public void handle(IAsyncResult<Void> result) {
if (result.isError()) {
log.error("Error {0}", result.getError());
throw new RuntimeException(result.getError());
}
}