public abstract class AbstractLifecycleHandler extends java.lang.Object implements LifecycleHandler
LifecycleHandler
interface.Constructor and Description |
---|
AbstractLifecycleHandler(GriffonApplication application) |
Modifier and Type | Method and Description |
---|---|
protected GriffonApplication |
getApplication() |
boolean |
isUIThread()
True if the current thread is the UI thread.
|
<R> java.util.concurrent.Future<R> |
runFuture(java.util.concurrent.Callable<R> callable)
Executes a code block as a Future on a default ExecutorService.
|
<R> java.util.concurrent.Future<R> |
runFuture(java.util.concurrent.ExecutorService executorService,
java.util.concurrent.Callable<R> callable)
Executes a code block as a Future on an ExecutorService.
|
void |
runInsideUIAsync(java.lang.Runnable runnable)
Executes a code block asynchronously on the UI thread.
|
<R> R |
runInsideUISync(java.util.concurrent.Callable<R> callable)
Executes a code block synchronously on the UI thread.
|
void |
runInsideUISync(java.lang.Runnable runnable)
Executes a code block synchronously on the UI thread.
|
void |
runOutsideUI(java.lang.Runnable runnable)
Executes a code block outside of the UI thread.
|
void |
runOutsideUIAsync(java.lang.Runnable runnable)
Executes a code block on a background thread, always.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
execute
@Inject public AbstractLifecycleHandler(@Nonnull GriffonApplication application)
@Nonnull protected GriffonApplication getApplication()
public boolean isUIThread()
ThreadingHandler
isUIThread
in interface ThreadingHandler
@Nonnull public <R> java.util.concurrent.Future<R> runFuture(@Nonnull java.util.concurrent.Callable<R> callable)
ThreadingHandler
runFuture
in interface ThreadingHandler
@Nonnull public <R> java.util.concurrent.Future<R> runFuture(@Nonnull java.util.concurrent.ExecutorService executorService, @Nonnull java.util.concurrent.Callable<R> callable)
ThreadingHandler
runFuture
in interface ThreadingHandler
public void runInsideUIAsync(@Nonnull java.lang.Runnable runnable)
ThreadingHandler
runInsideUIAsync
in interface ThreadingHandler
public void runInsideUISync(@Nonnull java.lang.Runnable runnable)
ThreadingHandler
runInsideUISync
in interface ThreadingHandler
public void runOutsideUI(@Nonnull java.lang.Runnable runnable)
ThreadingHandler
runOutsideUI
in interface ThreadingHandler
public void runOutsideUIAsync(@Nonnull java.lang.Runnable runnable)
ThreadingHandler
runOutsideUIAsync
in interface ThreadingHandler
@Nullable public <R> R runInsideUISync(@Nonnull java.util.concurrent.Callable<R> callable)
ThreadingHandler
runInsideUISync
in interface ThreadingHandler