public class SerialExecutor extends AbstractExecutorService
| Constructor and Description |
|---|
SerialExecutor(Executor executor)
Create serial executor
|
| Modifier and Type | Method and Description |
|---|---|
void |
assertOwner()
Assert, that the current thread executes the
currentlyExecutedJob. |
boolean |
awaitTermination(long timeout,
TimeUnit unit) |
boolean |
checkOwner()
Check, if current thread executes the
currentlyExecutedJob. |
static SerialExecutor |
create(Executor executor)
Create serial executor from provided executor.
|
void |
execute(Runnable command) |
boolean |
isShutdown() |
boolean |
isTerminated() |
void |
shutdown()
.
|
List<Runnable> |
shutdownNow()
.
|
int |
shutdownNow(Collection<Runnable> jobs)
Shutdown this executor and add all pending task from
tasks to
the provided collection. |
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitpublic SerialExecutor(Executor executor)
executor - target executor. If null, the executor is
shutdown.public void execute(Runnable command)
public void assertOwner()
currentlyExecutedJob.ConcurrentModificationException - if current thread doesn't execute
the currentlyExecutedJob.public boolean checkOwner()
currentlyExecutedJob.true, if current thread executes the
currentlyExecutedJob, false, otherwise.public final void shutdown()
executor.public final List<Runnable> shutdownNow()
executor.shutdownNow(Collection)public int shutdownNow(Collection<Runnable> jobs)
tasks to
the provided collection.jobs - collection to add pending jobs.shutdownNow()public boolean isShutdown()
public boolean isTerminated()
public boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
InterruptedExceptionpublic static SerialExecutor create(Executor executor)
executor - target executor. if null, no serial executor is
created.null, if provided executor is
null.Copyright © 2019 Eclipse Foundation. All rights reserved.