com.vaadin.flow.component.internal.
Class DeadlockDetectingCompletableFuture<T>
- java.lang.Object
-
- java.util.concurrent.CompletableFuture<T>
-
- com.vaadin.flow.component.internal.DeadlockDetectingCompletableFuture<T>
-
All Implemented Interfaces:
CompletionStage<T>
,Future<T>
public class DeadlockDetectingCompletableFuture<T> extends CompletableFuture<T>
A completable future that will throw from blocking operations if the current thread holds the session lock.
This is used for pending JS results because a response providing the value cannot be processed while the session is locked.
Throwing is unfortunately only practical for this immediate instance, but there isn't any sensible way of also intercepting for instances derived using e.g.
thenAccept
.For internal use only. May be renamed or removed in a future release.
Since:
2.1.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.CompletableFuture
CompletableFuture.AsynchronousCompletionTask
-
-
Constructor Summary
Constructors Constructor Description DeadlockDetectingCompletableFuture(VaadinSession session)
Creates a new deadlock detecting completable future tied to the given session.
-
Method Summary
All Methods Modifier and Type Method Description T
get()
T
get(long timeout, TimeUnit unit)
T
join()
-
Methods inherited from class java.util.concurrent.CompletableFuture
acceptEither, acceptEitherAsync, acceptEitherAsync, allOf, anyOf, applyToEither, applyToEitherAsync, applyToEitherAsync, cancel, complete, completeAsync, completeAsync, completedFuture, completedStage, completeExceptionally, completeOnTimeout, copy, defaultExecutor, delayedExecutor, delayedExecutor, exceptionally, failedFuture, failedStage, getNow, getNumberOfDependents, handle, handleAsync, handleAsync, isCancelled, isCompletedExceptionally, isDone, 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
-
-
-
-
Constructor Detail
-
DeadlockDetectingCompletableFuture
public DeadlockDetectingCompletableFuture(VaadinSession session)
Creates a new deadlock detecting completable future tied to the given session.
Parameters:
session
- the session to use, ornull
to not do any deadlock checking
-
-
Method Detail
-
get
public T get() throws InterruptedException, ExecutionException
Specified by:
Overrides:
get
in classCompletableFuture<T>
Throws:
-
get
public T get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
Specified by:
Overrides:
get
in classCompletableFuture<T>
Throws:
-
join
public T join()
Overrides:
join
in classCompletableFuture<T>
-
-