Class RoboExecutorService
- java.lang.Object
-
- org.robolectric.android.util.concurrent.RoboExecutorService
-
- All Implemented Interfaces:
Executor,ExecutorService
public class RoboExecutorService extends Object implements ExecutorService
Executor service that runs all operations on the background scheduler.
-
-
Constructor Summary
Constructors Constructor Description RoboExecutorService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanawaitTermination(long l, TimeUnit timeUnit)voidexecute(Runnable runnable)<T> List<Future<T>>invokeAll(Collection<? extends Callable<T>> callables)<T> List<Future<T>>invokeAll(Collection<? extends Callable<T>> callables, long l, TimeUnit timeUnit)<T> TinvokeAny(Collection<? extends Callable<T>> callables)<T> TinvokeAny(Collection<? extends Callable<T>> callables, long l, TimeUnit timeUnit)booleanisShutdown()booleanisTerminated()voidshutdown()List<Runnable>shutdownNow()Future<?>submit(Runnable runnable)<T> Future<T>submit(Runnable runnable, T t)<T> Future<T>submit(Callable<T> tCallable)
-
-
-
Method Detail
-
shutdown
public void shutdown()
- Specified by:
shutdownin interfaceExecutorService
-
shutdownNow
public List<Runnable> shutdownNow()
- Specified by:
shutdownNowin interfaceExecutorService
-
isShutdown
public boolean isShutdown()
- Specified by:
isShutdownin interfaceExecutorService
-
isTerminated
public boolean isTerminated()
- Specified by:
isTerminatedin interfaceExecutorService
-
awaitTermination
public boolean awaitTermination(long l, TimeUnit timeUnit) throws InterruptedException- Specified by:
awaitTerminationin interfaceExecutorService- Throws:
InterruptedException
-
submit
public <T> Future<T> submit(Callable<T> tCallable)
- Specified by:
submitin interfaceExecutorService
-
submit
public <T> Future<T> submit(Runnable runnable, T t)
- Specified by:
submitin interfaceExecutorService
-
submit
public Future<?> submit(Runnable runnable)
- Specified by:
submitin interfaceExecutorService
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> callables) throws InterruptedException
- Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAll
public <T> List<Future<T>> invokeAll(Collection<? extends Callable<T>> callables, long l, TimeUnit timeUnit) throws InterruptedException
- Specified by:
invokeAllin interfaceExecutorService- Throws:
InterruptedException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> callables) throws InterruptedException, ExecutionException
- Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionException
-
invokeAny
public <T> T invokeAny(Collection<? extends Callable<T>> callables, long l, TimeUnit timeUnit) throws InterruptedException, ExecutionException, TimeoutException
- Specified by:
invokeAnyin interfaceExecutorService- Throws:
InterruptedExceptionExecutionExceptionTimeoutException
-
-