public class ComponentMainThreadExecutorServiceAdapter extends ScheduledExecutorServiceAdapter implements ComponentMainThreadExecutor
ScheduledExecutorService
which shall be used as a
ComponentMainThreadExecutor
. It enhances the given executor with an assert that the current thread is the
main thread of the executor.ComponentMainThreadExecutor.DummyComponentMainThreadExecutor
Constructor and Description |
---|
ComponentMainThreadExecutorServiceAdapter(ScheduledExecutorService scheduledExecutorService,
Runnable mainThreadCheck) |
Modifier and Type | Method and Description |
---|---|
void |
assertRunningInMainThread()
Returns true if the method was called in the thread of this executor.
|
execute, schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
schedule, schedule, scheduleAtFixedRate, scheduleWithFixedDelay
public ComponentMainThreadExecutorServiceAdapter(@Nonnull ScheduledExecutorService scheduledExecutorService, @Nonnull Runnable mainThreadCheck)
public void assertRunningInMainThread()
ComponentMainThreadExecutor
assertRunningInMainThread
in interface ComponentMainThreadExecutor
Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.