public abstract class ThreadBoundProxy extends java.lang.Object implements ThreadBound
| Constructor and Description |
|---|
ThreadBoundProxy(ThreadBound enforcer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkThreadAccess()
Checks whether the current thread has access to this object.
|
void |
postAndWait(java.lang.Runnable r)
Synchronously executes a
Runnable on the thread that this object is bound to. |
<V> V |
postAndWait(UncheckedCallable<V> c)
Synchronously executes an
UncheckedCallable on the thread that this object is bound to,
and returns its result. |
void |
postDelayed(java.lang.Runnable r,
long delayMillis)
Asynchronously executes a
Runnable on the thread that this object is bound to
after the specified delay. |
void |
removeCallbacks(java.lang.Runnable r)
Removes any pending posts of the given
Runnable that are in the queue. |
void |
verifyThreadAccess()
Enforces that the current thread has access to this object.
|
public ThreadBoundProxy(ThreadBound enforcer)
public final boolean checkThreadAccess()
ThreadBoundcheckThreadAccess in interface ThreadBoundpublic final void verifyThreadAccess()
ThreadBoundverifyThreadAccess in interface ThreadBoundpublic final <V> V postAndWait(UncheckedCallable<V> c)
ThreadBoundUncheckedCallable on the thread that this object is bound to,
and returns its result.postAndWait in interface ThreadBoundV - the return type of the UncheckedCallablec - the UncheckedCallable to executeUncheckedCallable.call()public final void postAndWait(java.lang.Runnable r)
ThreadBoundRunnable on the thread that this object is bound to.postAndWait in interface ThreadBoundr - the Runnable to executepublic final void postDelayed(java.lang.Runnable r,
long delayMillis)
ThreadBoundRunnable on the thread that this object is bound to
after the specified delay.postDelayed in interface ThreadBoundr - the Runnable to executedelayMillis - The delay (in milliseconds) until the Runnable will be executed.public final void removeCallbacks(java.lang.Runnable r)
ThreadBoundRunnable that are in the queue.removeCallbacks in interface ThreadBoundr - the Runnable to remove from the queue