本文整理汇总了Java中org.apache.thrift.async.AsyncMethodCallback.onError方法的典型用法代码示例。如果您正苦于以下问题:Java AsyncMethodCallback.onError方法的具体用法?Java AsyncMethodCallback.onError怎么用?Java AsyncMethodCallback.onError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.thrift.async.AsyncMethodCallback
的用法示例。
在下文中一共展示了AsyncMethodCallback.onError方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handle
import org.apache.thrift.async.AsyncMethodCallback; //导入方法依赖的package包/类
private static void handle(Callable<?> task, AsyncMethodCallback resultHandler) {
try {
resultHandler.onComplete(task.call());
} catch (Throwable cause) {
resultHandler.onError(convert(cause));
}
}
示例2: watchRepository
import org.apache.thrift.async.AsyncMethodCallback; //导入方法依赖的package包/类
@Override
public void watchRepository(
String projectName, String repositoryName, Revision lastKnownRevision,
String pathPattern, long timeoutMillis, AsyncMethodCallback resultHandler) {
if (watchService.isServerStopping()) {
resultHandler.onError(new CentralDogmaException(ErrorCode.SHUTTING_DOWN));
return;
}
final Repository repo = projectManager.get(projectName).repos().get(repositoryName);
final CompletableFuture<com.linecorp.centraldogma.common.Revision> future =
watchService.watchRepository(repo, convert(lastKnownRevision), pathPattern, timeoutMillis);
handleWatchRepositoryResult(future, resultHandler);
}
示例3: logAndInvokeOnError
import org.apache.thrift.async.AsyncMethodCallback; //导入方法依赖的package包/类
private static void logAndInvokeOnError(
String operationName, AsyncMethodCallback resultHandler, Throwable cause) {
final CentralDogmaException cde = convert(cause);
CentralDogmaExceptions.log(operationName, cde);
resultHandler.onError(cde);
}
示例4: unimplemented
import org.apache.thrift.async.AsyncMethodCallback; //导入方法依赖的package包/类
private static void unimplemented(AsyncMethodCallback resultHandler) {
resultHandler.onError(new CentralDogmaException(ErrorCode.UNIMPLEMENTED));
}