diff options
Diffstat (limited to 'container-core')
-rw-r--r-- | container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java b/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java index edbe12b64c6..74bcb3a2e04 100644 --- a/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java +++ b/container-core/src/main/java/com/yahoo/container/handler/threadpool/ContainerThreadPool.java @@ -1,6 +1,8 @@ // Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.container.handler.threadpool; +import com.google.inject.Inject; +import com.yahoo.component.AbstractComponent; import com.yahoo.concurrent.ThreadFactoryFactory; import com.yahoo.container.handler.ThreadpoolConfig; import com.yahoo.container.protect.ProcessTerminator; @@ -20,10 +22,11 @@ import java.util.concurrent.TimeUnit; * @author bratseth * @author bjorncs */ -public class ContainerThreadPool implements AutoCloseable { +public class ContainerThreadPool extends AbstractComponent implements AutoCloseable { private final ExecutorServiceWrapper threadpool; + @Inject public ContainerThreadPool(ThreadpoolConfig config, Metric metric) { this(config, metric, new ProcessTerminator()); } @@ -48,6 +51,7 @@ public class ContainerThreadPool implements AutoCloseable { public Executor executor() { return threadpool; } @Override public void close() { closeInternal(); } + @Override public void deconstruct() { closeInternal(); super.deconstruct(); } /** * Shutdown the thread pool, give a grace period of 1 second before forcibly |