public abstract class SerializedExecutor extends Object implements Executor
| Constructor and Description |
|---|
SerializedExecutor(String name,
Executor underlyingExecutor)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable command) |
protected abstract void |
runException(Runnable command,
Throwable t)
An exception occurred in the last command executed; this reports that to
the subclass of SerializedExecutor.
|
protected abstract void runException(Runnable command, Throwable t)
The default implementation of this method throws an exception, which is considered an error (see below). Implementors have two alternatives: Arrange not to throw from your commands' run(), or if they do, provide an override of this method that handles any exception that is thrown.
It is an error for this to throw an exception, and doing so will terminate the thread with an IllegalStateException. Derivers must handle any reported exceptions in other ways.
command - the command that caused the exceptiont - the exceptionCopyright © 2021 The Apache Software Foundation. All rights reserved.