TaskExecutor interface.
Every submitted task is invoked in a separate thread.
In case something does not interact well with JavaFX, you can use the HeadlessExecutorService
| Modifier and Type | Field and Description |
|---|---|
| private final ExecutorService | |
| private static final Logger | |
| private final ScheduledExecutorService | |
| private final WeakHashMap |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private Exception | |
| public DelayTaskThrottler | createThrottler(int delay)
Implements org. Creates a new task throttler, and registers it so that it gets properly shutdown. |
| public <V> Future | execute(BackgroundTask<V>
the task to run task)Implements org. Runs the given task and returns a Future representing that task. |
| public <V> Future | execute(Task<V>
the task to run task)Implements org. Runs the given task and returns a Future representing that task. |
| private <V> Task | Returns: a new Task objectthe BackgroundTask to wrap task)Generates a wrapper JavaFX |
| public static void | runAndWaitInJavaFXThread(Runnable
the action)Runnable to runRuns the specified |
| public static <V> V | |
| public static void | |
| public <V> Future | schedule(BackgroundTask<V>
the task to execute task, long the time from now to delay execution delay, TimeUnit the time unit of the delay parameter unit)Implements org. Submits a one-shot task that becomes enabled after the given delay. |
| public void |
| executor | back to summary |
|---|---|
| private final ExecutorService executor | |
| LOGGER | back to summary |
|---|---|
| private static final Logger LOGGER | |
| scheduledExecutor | back to summary |
|---|---|
| private final ScheduledExecutorService scheduledExecutor | |
| throttlers | back to summary |
|---|---|
| private final WeakHashMap<DelayTaskThrottler, Void> throttlers | |
| UiTaskExecutor | back to summary |
|---|---|
| public UiTaskExecutor() | |
| convertToException | back to summary |
|---|---|
| private Exception convertToException(Throwable throwable) | |
| createThrottler | back to summary |
|---|---|
| public DelayTaskThrottler createThrottler(int delay) Implements org. Doc from org. Creates a new task throttler, and registers it so that it gets properly shutdown.
| |
| execute | back to summary |
|---|---|
| public <V> Future Implements org. Doc from org. Runs the given task and returns a Future representing that task.
| |
| execute | back to summary |
|---|---|
| public <V> Future Implements org. Doc from org. Runs the given task and returns a Future representing that task. Usually, you want to use the other method | |
| getJavaFXTask | back to summary |
|---|---|
| private <V> Task Generates a wrapper JavaFX
| |
| runAndWaitInJavaFXThread | back to summary |
|---|---|
| public static void runAndWaitInJavaFXThread(Runnable action) Runs the specified
| |
| runInJavaFXThread | back to summary |
|---|---|
| public static <V> V runInJavaFXThread(Callable<V> callable) | |
| runInJavaFXThread | back to summary |
|---|---|
| public static void runInJavaFXThread(Runnable runnable) | |
| schedule | back to summary |
|---|---|
| public <V> Future Implements org. Doc from org. Submits a one-shot task that becomes enabled after the given delay.
| |
| shutdown | back to summary |
|---|---|
| public void shutdown() Implements org. Shuts everything down. After termination, this method returns.
| |