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.Runnable
public void execute(java.lang.Runnable r)
execute
in interface java.util.concurrent.Executor
public void shutdown()
shutdown
in interface java.util.concurrent.ExecutorService
public java.util.List<java.lang.Runnable> shutdownNow()
Calling this method will throw an UnsupportedOperationException
.
shutdownNow
in interface java.util.concurrent.ExecutorService
public boolean isShutdown()
isShutdown
in interface java.util.concurrent.ExecutorService
public boolean isTerminated()
isTerminated
in interface java.util.concurrent.ExecutorService
public 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.ExecutorService
java.lang.InterruptedException
public <T> java.util.concurrent.Future<T> submit(java.util.concurrent.Callable<T> task)
submit
in interface java.util.concurrent.ExecutorService
public <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.ExecutorService
public java.util.concurrent.Future<?> submit(java.lang.Runnable task)
Calling this method will throw an UnsupportedOperationException
.
submit
in interface java.util.concurrent.ExecutorService
public <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.ExecutorService
java.lang.InterruptedException
public <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.ExecutorService
java.lang.InterruptedException
public <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.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
public <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.ExecutorService
java.lang.InterruptedException
java.util.concurrent.ExecutionException
java.util.concurrent.TimeoutException