public class SingleThreadExecutor
extends java.lang.Object
implements java.lang.Runnable, java.util.concurrent.ExecutorService
| Constructor and Description |
|---|
SingleThreadExecutor()
Creates a single thread executor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
This method is unsupported by this implementation.
|
void |
execute(java.lang.Runnable r) |
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
This method is unsupported by this implementation.
|
<T> java.util.List<java.util.concurrent.Future<T>> |
invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
This method is unsupported by this implementation.
|
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
This method is unsupported by this implementation.
|
<T> T |
invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
This method is unsupported by this implementation.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
run() |
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow()
This method is unsupported by this implementation.
|
<T> java.util.concurrent.Future<T> |
submit(java.util.concurrent.Callable<T> task) |
java.util.concurrent.Future<?> |
submit(java.lang.Runnable task)
This method is unsupported by this implementation.
|
<T> java.util.concurrent.Future<T> |
submit(java.lang.Runnable task,
T result)
This method is unsupported by this implementation.
|
public SingleThreadExecutor()
A new thread is created and started immediately.
public void run()
run in interface java.lang.Runnablepublic void execute(java.lang.Runnable r)
execute in interface java.util.concurrent.Executorpublic void shutdown()
shutdown in interface java.util.concurrent.ExecutorServicepublic java.util.List<java.lang.Runnable> shutdownNow()
Calling this method will throw an UnsupportedOperationException.
shutdownNow in interface java.util.concurrent.ExecutorServicepublic boolean isShutdown()
isShutdown in interface java.util.concurrent.ExecutorServicepublic boolean isTerminated()
isTerminated in interface java.util.concurrent.ExecutorServicepublic boolean awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
Calling this method will throw an UnsupportedOperationException.
awaitTermination in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionpublic <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
submit in interface java.util.concurrent.ExecutorServicepublic <T> java.util.concurrent.Future<T> submit(java.lang.Runnable task,
T result)
Calling this method will throw an UnsupportedOperationException.
submit in interface java.util.concurrent.ExecutorServicepublic java.util.concurrent.Future<?> submit(java.lang.Runnable task)
Calling this method will throw an UnsupportedOperationException.
submit in interface java.util.concurrent.ExecutorServicepublic <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
throws java.lang.InterruptedException
Calling this method will throw an UnsupportedOperationException.
invokeAll in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionpublic <T> java.util.List<java.util.concurrent.Future<T>> invokeAll(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
Calling this method will throw an UnsupportedOperationException.
invokeAll in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionpublic <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException
Calling this method will throw an UnsupportedOperationException.
invokeAny in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionpublic <T> T invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException,
java.util.concurrent.ExecutionException,
java.util.concurrent.TimeoutException
Calling this method will throw an UnsupportedOperationException.
invokeAny in interface java.util.concurrent.ExecutorServicejava.lang.InterruptedExceptionjava.util.concurrent.ExecutionExceptionjava.util.concurrent.TimeoutException