public class ObservableExecutor
extends java.lang.Object
implements java.util.concurrent.Executor
currentServices ListProperty. Each background task (
Callable,
Runnable, etc.) is wrapped in a
Service
The
ObservableExecutor can be used as a wrapper around a default
executor.| Type | Property and Description |
|---|---|
javafx.beans.property.ReadOnlyListProperty<javafx.concurrent.Service<?>> |
currentServices
Returns the a ListProperty that contains all currently scheduled and
running tasks.
|
| Constructor and Description |
|---|
ObservableExecutor()
Creates a new ObservableExecutor that uses a cached thread pool to handle
all commited tasks.
|
ObservableExecutor(ExceptionHandler exceptionHandler) |
ObservableExecutor(java.util.concurrent.Executor executor) |
ObservableExecutor(java.util.concurrent.Executor executor,
ExceptionHandler exceptionHandler)
Creates a new ObservableExecutor that uses the given executor to handle
all commited tasks.
|
| Modifier and Type | Method and Description |
|---|---|
ProcessChain<java.lang.Void> |
createProcessChain()
Creates a new ProcessChain that uses this executor as the executor for all background tasks.
|
javafx.beans.property.ReadOnlyListProperty<javafx.concurrent.Service<?>> |
currentServicesProperty()
Returns the a ListProperty that contains all currently scheduled and
running tasks.
|
void |
execute(java.lang.Runnable runnable)
Execute the given runnable at some time in the future.
|
static ObservableExecutor |
getDefaultInstance()
Returns the default executor.
|
<T> javafx.concurrent.Worker<T> |
submit(java.util.concurrent.Callable<T> callable)
Execute the given callable at some time in the future.
|
javafx.concurrent.Worker<java.lang.Void> |
submit(java.lang.Runnable runnable)
Execute the given runnable at some time in the future.
|
<T> javafx.concurrent.Worker<T> |
submit(javafx.concurrent.Service<T> service)
Execute the given service at some time in the future.
|
<T> javafx.concurrent.Worker<T> |
submit(javafx.concurrent.Task<T> task)
Execute the given task at some time in the future.
|
public javafx.beans.property.ReadOnlyListProperty<javafx.concurrent.Service<?>> currentServicesProperty
public ObservableExecutor()
public ObservableExecutor(java.util.concurrent.Executor executor)
public ObservableExecutor(ExceptionHandler exceptionHandler)
public ObservableExecutor(java.util.concurrent.Executor executor,
ExceptionHandler exceptionHandler)
executor - wrapped executor. It will be used to handle all task that
are commited to this executor.exceptionHandler - the exceptionhandlerpublic javafx.beans.property.ReadOnlyListProperty<javafx.concurrent.Service<?>> currentServicesProperty()
public <T> javafx.concurrent.Worker<T> submit(javafx.concurrent.Service<T> service)
T - The return type for the serviceservice - the service.public <T> javafx.concurrent.Worker<T> submit(javafx.concurrent.Task<T> task)
T - the return type for the tasktask - the task.public <T> javafx.concurrent.Worker<T> submit(java.util.concurrent.Callable<T> callable)
T - the return type for the workercallable - the callable. If a DataFxCallable is used
here a TaskStateHandler will be injected.public javafx.concurrent.Worker<java.lang.Void> submit(java.lang.Runnable runnable)
runnable - the runnable. If a DataFxRunnable is used
here a TaskStateHandler will be injected.public void execute(java.lang.Runnable runnable)
execute in interface java.util.concurrent.Executorrunnable - the runnable. If a DataFxRunnable is used
here a TaskStateHandler will be injected.public ProcessChain<java.lang.Void> createProcessChain()
ProcessChainpublic static ObservableExecutor getDefaultInstance()