public abstract class AbstractUIThreadManager extends Object implements UIThreadManager
Modifier and Type | Field and Description |
---|---|
protected static String |
ERROR_CALLABLE_NULL |
protected static String |
ERROR_RUNNABLE_NULL |
Constructor and Description |
---|
AbstractUIThreadManager() |
Modifier and Type | Method and Description |
---|---|
<R> Future<R> |
runFuture(Callable<R> callable)
Executes a code block as a Future on an ExecutorService.
|
<R> Future<R> |
runFuture(ExecutorService executorService,
Callable<R> callable)
Executes a code block as a Future on an ExecutorService.
|
void |
runOutsideUI(Runnable runnable)
Executes a code block outside of the UI thread.
|
void |
setExecutorServiceManager(ExecutorServiceManager executorServiceManager) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isUIThread, runInsideUIAsync, runInsideUISync
protected static final String ERROR_RUNNABLE_NULL
protected static final String ERROR_CALLABLE_NULL
@Inject public void setExecutorServiceManager(@Nonnull ExecutorServiceManager executorServiceManager)
@Nonnull public <R> Future<R> runFuture(@Nonnull Callable<R> callable)
runFuture
in interface ThreadingHandler
callable
- a code block to be executed@Nonnull public <R> Future<R> runFuture(@Nonnull ExecutorService executorService, @Nonnull Callable<R> callable)
runFuture
in interface ThreadingHandler
executorService
- the ExecutorService to use. Will use the default ExecutorService if null.callable
- a code block to be executedpublic void runOutsideUI(@Nonnull Runnable runnable)
ThreadingHandler
runOutsideUI
in interface ThreadingHandler