Class SingleTargetRequest<T>
- java.lang.Object
-
- java.util.concurrent.CompletableFuture<T>
-
- org.infinispan.remoting.transport.AbstractRequest<T>
-
- org.infinispan.remoting.transport.impl.SingleTargetRequest<T>
-
- All Implemented Interfaces:
Callable<Void>
,CompletionStage<T>
,Future<T>
,Request<T>
public class SingleTargetRequest<T> extends AbstractRequest<T>
Request implementation that waits for a response from a single target node.- Since:
- 9.1
- Author:
- Dan Berindei
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
-
Field Summary
-
Fields inherited from class org.infinispan.remoting.transport.AbstractRequest
repository, requestId, responseCollector
-
Fields inherited from interface org.infinispan.remoting.transport.impl.Request
NO_REQUEST_ID
-
-
Constructor Summary
Constructors Constructor Description SingleTargetRequest(ResponseCollector<T> wrapper, long requestId, RequestRepository repository, Address target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
onNewView(Set<Address> members)
Called when the node received a new cluster view.void
onResponse(Address sender, Response response)
Called when a response is received for this response.protected void
onTimeout()
Called when the timeout task scheduled withAbstractRequest.setTimeout(ScheduledExecutorService, long, TimeUnit)
expires.-
Methods inherited from class org.infinispan.remoting.transport.AbstractRequest
call, cancel, cancel, complete, completeExceptionally, getRequestId, setTimeout
-
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, completeAsync, completeAsync, completedFuture, completedStage, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, get, get, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, join, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, toString, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.concurrent.CompletionStage
acceptEither, acceptEitherAsync, acceptEitherAsync, applyToEither, applyToEitherAsync, applyToEitherAsync, exceptionally, handle, handleAsync, handleAsync, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsync
-
-
-
-
Constructor Detail
-
SingleTargetRequest
public SingleTargetRequest(ResponseCollector<T> wrapper, long requestId, RequestRepository repository, Address target)
-
-
Method Detail
-
onResponse
public void onResponse(Address sender, Response response)
Description copied from interface:Request
Called when a response is received for this response.
-
onNewView
public boolean onNewView(Set<Address> members)
Description copied from interface:Request
Called when the node received a new cluster view.- Returns:
true
if any of the request targets is not in the view.
-
onTimeout
protected void onTimeout()
Description copied from class:AbstractRequest
Called when the timeout task scheduled withAbstractRequest.setTimeout(ScheduledExecutorService, long, TimeUnit)
expires.- Specified by:
onTimeout
in classAbstractRequest<T>
-
-