public abstract class AbstractThreadingHandler extends Object implements ThreadingHandler
Constructor and Description |
---|
AbstractThreadingHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
isUIThread()
True if the current thread is the UI thread.
|
<R> Future<R> |
runFuture(Callable<R> callable)
Executes a code block as a Future on a default ExecutorService.
|
<R> Future<R> |
runFuture(ExecutorService executorService,
Callable<R> callable)
Executes a code block as a Future on an ExecutorService.
|
void |
runInsideUIAsync(Runnable runnable)
Executes a code block asynchronously on the UI thread.
|
<R> R |
runInsideUISync(Callable<R> callable)
Executes a code block synchronously on the UI thread.
|
void |
runInsideUISync(Runnable runnable)
Executes a code block synchronously on the UI thread.
|
void |
runOutsideUI(Runnable runnable)
Executes a code block outside of the UI thread.
|
void |
runOutsideUIAsync(Runnable runnable)
Executes tje code block on a background thread, always.
|
void |
setUIThreadManager(UIThreadManager uiThreadManager) |
@Inject public void setUIThreadManager(@Nonnull UIThreadManager uiThreadManager)
public boolean isUIThread()
ThreadingHandler
isUIThread
in interface ThreadingHandler
public void runInsideUIAsync(@Nonnull Runnable runnable)
ThreadingHandler
runInsideUIAsync
in interface ThreadingHandler
public void runInsideUISync(@Nonnull Runnable runnable)
ThreadingHandler
runInsideUISync
in interface ThreadingHandler
public void runOutsideUI(@Nonnull Runnable runnable)
ThreadingHandler
runOutsideUI
in interface ThreadingHandler
public void runOutsideUIAsync(@Nonnull Runnable runnable)
ThreadingHandler
runOutsideUIAsync
in interface ThreadingHandler
@Nonnull public <R> Future<R> runFuture(@Nonnull ExecutorService executorService, @Nonnull Callable<R> callable)
ThreadingHandler
runFuture
in interface ThreadingHandler
@Nonnull public <R> Future<R> runFuture(@Nonnull Callable<R> callable)
ThreadingHandler
runFuture
in interface ThreadingHandler
@Nullable public <R> R runInsideUISync(@Nonnull Callable<R> callable)
ThreadingHandler
runInsideUISync
in interface ThreadingHandler