public abstract class AbstractThreadPoolService
extends AbstractService
implements java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ScheduledExecutorService |
executor |
protected java.lang.String |
traceObjectId |
| Constructor and Description |
|---|
AbstractThreadPoolService(java.lang.String traceObjectId,
java.util.concurrent.ScheduledExecutorService executor)
Creates a new instance of the AbstractThreadPoolService class.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected abstract java.util.concurrent.CompletableFuture<java.lang.Void> |
doRun()
Main execution of the Service.
|
protected void |
doStart() |
protected void |
doStop() |
protected void |
errorHandler(java.lang.Throwable ex)
When overridden in a derived class, handles an exception that is caught by the execution of run().
|
protected abstract java.time.Duration |
getShutdownTimeout()
Gets a value indicating how much to wait for the service to shut down, before failing it.
|
protected java.lang.Throwable |
getStopException()
Gets a pointer to the current Stop Exception, if any is set.
|
protected final java.lang.String traceObjectId
protected final java.util.concurrent.ScheduledExecutorService executor
public AbstractThreadPoolService(java.lang.String traceObjectId,
java.util.concurrent.ScheduledExecutorService executor)
traceObjectId - An identifier to use for logging purposes. This will be included at the beginning of all
log calls initiated by this Service.executor - The Executor to use for async callbacks and operations.public void close()
close in interface java.lang.AutoCloseableprotected void doStart()
protected void doStop()
protected abstract java.time.Duration getShutdownTimeout()
protected abstract java.util.concurrent.CompletableFuture<java.lang.Void> doRun()
protected java.lang.Throwable getStopException()
protected void errorHandler(java.lang.Throwable ex)
ex - The Exception.