diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2018-03-07 14:51:18 +0100 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2018-03-07 14:53:33 +0100 |
commit | 9659d28f1083f8ce9c67db3fb708f5b96740fba4 (patch) | |
tree | c27be4f85bdd4cd626abcfc5ed7b0228cfc78e97 /infra/cfg-init/src/main | |
parent | a604b493ab32467635ec1767b2747bcf8f22cae9 (diff) |
Move shutdown hook registration to dedicated provider
This change would allow using ShutdownHandlerImpl in integration tests.
Change-Id: I854f65d03b9e1a495fda7211fd1b7fd51b4e5ba3
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'infra/cfg-init/src/main')
-rw-r--r-- | infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/ShutdownHandler.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/ShutdownHandler.java b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/ShutdownHandler.java index fc350da6e..6a0096e1e 100644 --- a/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/ShutdownHandler.java +++ b/infra/cfg-init/src/main/java/io/fd/honeycomb/data/init/ShutdownHandler.java @@ -19,15 +19,20 @@ package io.fd.honeycomb.data.init; import javax.annotation.Nonnull; /** - * Handles closing of closeable components + * Handles closing of closeable components. */ public interface ShutdownHandler { /** - * Register component to be properly closed on shutdown + * Registers component to be properly closed on shutdown. * * @param name component name * @param component closeable component */ void register(@Nonnull final String name, @Nonnull final AutoCloseable component); + + /** + * Performs shutdown for all registered components. + */ + void performShutdown(); } |