public class ConcurrentUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static javafx.beans.property.ReadOnlyBooleanProperty |
createIsDoneProperty(javafx.concurrent.Worker<?> worker)
Returns a property that defines the state of the given worker.
|
static <T> DataFxService<T> |
createService(java.util.concurrent.Callable<T> callable) |
static DataFxService<java.lang.Void> |
createService(java.lang.Runnable runnable) |
static <T> DataFxService<T> |
createService(javafx.concurrent.Task<T> task) |
static <T> javafx.concurrent.Worker<T> |
executeService(java.util.concurrent.Executor executor,
javafx.concurrent.Service<T> service) |
static <V> javafx.beans.binding.BooleanBinding |
isFinishedProperty(javafx.concurrent.Worker<V> worker) |
static void |
runAndWait(java.lang.Runnable runnable)
Runs the given Runnable on the JavaFX Application Thread.
|
static <T> T |
runCallableAndWait(java.util.concurrent.Callable<T> callable)
Runs the given Callable on the JavaFX Application Thread.
|
static <T> void |
then(javafx.concurrent.Worker<T> worker,
java.util.function.Consumer<T> consumer)
The given consumer will be called once the worker is finished.
|
static <T> T |
waitFor(javafx.concurrent.Worker<T> worker)
This methods blocks until the worker is done and returns the result value of the worker.
|
public static void runAndWait(java.lang.Runnable runnable)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
ProcessChain for concurrent tasks and background tasks
instead of using this low level API.runnable - the runnable that will be executed on the JavaFX Application Threadjava.lang.InterruptedException - if the JavaFX Application Thread was interrupted while waitingjava.util.concurrent.ExecutionException - if the call of the run method of the Runnable threw an exceptionpublic static <T> T runCallableAndWait(java.util.concurrent.Callable<T> callable)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
ProcessChain for concurrent tasks and background tasks
instead of using this low level API.T - return type of the callablecallable - the callable that will be executed on the JavaFX Application Threadjava.lang.InterruptedException - if the JavaFX Application Thread was interrupted while waitingjava.util.concurrent.ExecutionException - if the call of the run method of the Callable threw an exceptionpublic static DataFxService<java.lang.Void> createService(java.lang.Runnable runnable)
public static <T> DataFxService<T> createService(java.util.concurrent.Callable<T> callable)
public static <T> DataFxService<T> createService(javafx.concurrent.Task<T> task)
public static <T> javafx.concurrent.Worker<T> executeService(java.util.concurrent.Executor executor,
javafx.concurrent.Service<T> service)
public static <V> javafx.beans.binding.BooleanBinding isFinishedProperty(javafx.concurrent.Worker<V> worker)
public static <T> void then(javafx.concurrent.Worker<T> worker,
java.util.function.Consumer<T> consumer)
T - the resukt type of the workerworker - the workerconsumer - the consumerpublic static javafx.beans.property.ReadOnlyBooleanProperty createIsDoneProperty(javafx.concurrent.Worker<?> worker)
worker - the workerpublic static <T> T waitFor(javafx.concurrent.Worker<T> worker)
throws java.lang.InterruptedException
T - result type of the workerworker - The workerjava.lang.InterruptedException - if the worker was canceled