當前位置: 首頁>>代碼示例>>Java>>正文


Java Futures.completedFuture方法代碼示例

本文整理匯總了Java中io.atomix.utils.concurrent.Futures.completedFuture方法的典型用法代碼示例。如果您正苦於以下問題:Java Futures.completedFuture方法的具體用法?Java Futures.completedFuture怎麽用?Java Futures.completedFuture使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在io.atomix.utils.concurrent.Futures的用法示例。


在下文中一共展示了Futures.completedFuture方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getServer

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
private CompletableFuture<LocalRaftServerProtocol> getServer(NodeId nodeId) {
  LocalRaftServerProtocol server = server(nodeId);
  if (server != null) {
    return Futures.completedFuture(server);
  } else {
    return Futures.exceptionalFuture(new ConnectException());
  }
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:LocalRaftClientProtocol.java

示例2: getServer

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
private CompletableFuture<TestPrimaryBackupServerProtocol> getServer(NodeId memberId) {
  TestPrimaryBackupServerProtocol server = server(memberId);
  if (server != null) {
    return Futures.completedFuture(server);
  } else {
    return Futures.exceptionalFuture(new ConnectException());
  }
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:TestPrimaryBackupServerProtocol.java

示例3: getClient

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
private CompletableFuture<TestPrimaryBackupClientProtocol> getClient(NodeId memberId) {
  TestPrimaryBackupClientProtocol client = client(memberId);
  if (client != null) {
    return Futures.completedFuture(client);
  } else {
    return Futures.exceptionalFuture(new ConnectException());
  }
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:TestPrimaryBackupServerProtocol.java

示例4: onMetadata

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<MetadataResponse> onMetadata(MetadataRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(MetadataResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例5: onKeepAlive

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<KeepAliveResponse> onKeepAlive(KeepAliveRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(KeepAliveResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例6: getClient

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
private CompletableFuture<LocalRaftClientProtocol> getClient(NodeId nodeId) {
  LocalRaftClientProtocol client = client(nodeId);
  if (client != null) {
    return Futures.completedFuture(client);
  } else {
    return Futures.exceptionalFuture(new ConnectException());
  }
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:LocalRaftServerProtocol.java

示例7: onCloseSession

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<CloseSessionResponse> onCloseSession(CloseSessionRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(CloseSessionResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例8: onInstall

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<InstallResponse> onInstall(InstallRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(InstallResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例9: onJoin

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<JoinResponse> onJoin(JoinRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(JoinResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例10: onReconfigure

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<ReconfigureResponse> onReconfigure(ReconfigureRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(ReconfigureResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例11: onLeave

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<LeaveResponse> onLeave(LeaveRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(LeaveResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例12: onTransfer

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<TransferResponse> onTransfer(TransferRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(TransferResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例13: onAppend

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<AppendResponse> onAppend(AppendRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(AppendResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例14: onPoll

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<PollResponse> onPoll(PollRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(PollResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java

示例15: onVote

import io.atomix.utils.concurrent.Futures; //導入方法依賴的package包/類
@Override
public CompletableFuture<VoteResponse> onVote(VoteRequest request) {
  logRequest(request);
  return Futures.completedFuture(logResponse(VoteResponse.builder()
      .withStatus(Status.ERROR)
      .withError(RaftError.Type.UNAVAILABLE)
      .build()));
}
 
開發者ID:atomix,項目名稱:atomix,代碼行數:9,代碼來源:InactiveRole.java


注:本文中的io.atomix.utils.concurrent.Futures.completedFuture方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。