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