本文整理匯總了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));
}