public class KriptonTaskExecutor extends TaskExecutor
| Modifier and Type | Method and Description |
|---|---|
void |
executeOnDiskIO(Runnable runnable)
Executes the given task in the disk IO thread pool.
|
static KriptonTaskExecutor |
getInstance()
Returns an instance of the task executor.
|
static Executor |
getIOThreadExecutor()
Gets the IO thread executor.
|
static Executor |
getMainThreadExecutor()
Gets the main thread executor.
|
boolean |
isMainThread()
Returns true if the current thread is the main thread, false otherwise.
|
void |
postToMainThread(Runnable runnable)
Posts the given task to the main thread.
|
void |
setDelegate(TaskExecutor taskExecutor)
Sets a delegate to handle task execution requests.
|
executeOnMainThreadpublic static KriptonTaskExecutor getInstance()
public void setDelegate(TaskExecutor taskExecutor)
If you have a common executor, you can set it as the delegate and App Toolkit components will use your executors. You may also want to use this for your tests.
Calling this method with null sets it to the default
TaskExecutor.
taskExecutor - The task executor to handle task requests.public void executeOnDiskIO(Runnable runnable)
TaskExecutorexecuteOnDiskIO in class TaskExecutorrunnable - The runnable to run in the disk IO thread pool.public void postToMainThread(Runnable runnable)
TaskExecutorpostToMainThread in class TaskExecutorrunnable - The runnable to run on the main thread.public static Executor getMainThreadExecutor()
public static Executor getIOThreadExecutor()
public boolean isMainThread()
TaskExecutorisMainThread in class TaskExecutorCopyright © 2019. All rights reserved.