Package org.jgroups.blocks
Class UnicastRequest<T>
java.lang.Object
java.util.concurrent.CompletableFuture<T>
org.jgroups.blocks.Request<T>
org.jgroups.blocks.UnicastRequest<T>
- All Implemented Interfaces:
CompletionStage<T>,Future<T>
Sends a request to a single target destination
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTaskNested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State -
Field Summary
FieldsFields inherited from class org.jgroups.blocks.Request
corr, options, req_id, start_time -
Constructor Summary
ConstructorsConstructorDescriptionUnicastRequest(RequestCorrelator corr, Address target, RequestOptions options) -
Method Summary
Modifier and TypeMethodDescriptionprotected Tget()protected Tjoin()voidmemberUnreachable(Address mbr) voidreceiveResponse(Object response_value, Address sender, boolean is_exception) Callback (called by RequestCorrelator or Transport).booleanvoidsendRequest(Message msg) voidsiteUnreachable(String site) toString()voidvoidviewChange(View view, boolean handle_previous_subgroups) If the target address is not a member of the new view, we'll mark the response as suspected and unblock the caller of execute()waitForCompletion(long timeout, TimeUnit unit) Blocks until all responses have been received and returns result or throws exceptionMethods inherited from class org.jgroups.blocks.Request
cancel, corrDone, execute, requestId, requestId, setResponseFilterMethods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, complete, completeAsync, completeAsync, completedFuture, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, exceptionallyAsync, exceptionallyAsync, exceptionallyCompose, exceptionallyComposeAsync, exceptionallyComposeAsync, exceptionNow, failedFuture, failedStage, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, minimalCompletionStage, newIncompleteFuture, obtrudeException, obtrudeValue, orTimeout, resultNow, runAfterBoth, runAfterBothAsync, runAfterBothAsync, runAfterEither, runAfterEitherAsync, runAfterEitherAsync, runAsync, runAsync, state, supplyAsync, supplyAsync, thenAccept, thenAcceptAsync, thenAcceptAsync, thenAcceptBoth, thenAcceptBothAsync, thenAcceptBothAsync, thenApply, thenApplyAsync, thenApplyAsync, thenCombine, thenCombineAsync, thenCombineAsync, thenCompose, thenComposeAsync, thenComposeAsync, thenRun, thenRunAsync, thenRunAsync, toCompletableFuture, whenComplete, whenCompleteAsync, whenCompleteAsync
-
Field Details
-
target
-
-
Constructor Details
-
UnicastRequest
-
-
Method Details
-
sendRequest
- Specified by:
sendRequestin classRequest<T>- Throws:
Exception
-
receiveResponse
Callback (called by RequestCorrelator or Transport). Adds a response to the response table. When all responses have been received,execute()returns.- Specified by:
receiveResponsein classRequest<T>
-
siteUnreachable
- Specified by:
siteUnreachablein classRequest<T>
-
memberUnreachable
- Specified by:
memberUnreachablein classRequest<T>
-
viewChange
If the target address is not a member of the new view, we'll mark the response as suspected and unblock the caller of execute()- Specified by:
viewChangein classRequest<T>
-
transportClosed
public void transportClosed()- Specified by:
transportClosedin classRequest<T>
-
get
- Specified by:
getin interfaceFuture<T>- Overrides:
getin classCompletableFuture<T>- Throws:
InterruptedExceptionExecutionException
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException - Specified by:
getin interfaceFuture<T>- Overrides:
getin classCompletableFuture<T>- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
join
- Overrides:
joinin classCompletableFuture<T>
-
getNow
- Overrides:
getNowin classCompletableFuture<T>
-
waitForCompletion
Description copied from class:RequestBlocks until all responses have been received and returns result or throws exception- Specified by:
waitForCompletionin classRequest<T>- Throws:
Exception
-
waitForCompletion
- Specified by:
waitForCompletionin classRequest<T>- Throws:
Exception
-
toString
-
responsesComplete
public boolean responsesComplete() -
around
-
getResult
- Throws:
Exception
-