public class ShutdownHookUtil extends Object
Modifier and Type | Method and Description |
---|---|
static Thread |
addShutdownHook(AutoCloseable service,
String serviceName,
org.slf4j.Logger logger)
Adds a shutdown hook to the JVM and returns the Thread, which has been registered.
|
static boolean |
addShutdownHookThread(Thread shutdownHook,
String serviceName,
org.slf4j.Logger logger)
Adds a shutdown hook to the JVM.
|
static void |
removeShutdownHook(Thread shutdownHook,
String serviceName,
org.slf4j.Logger logger)
Removes a shutdown hook from the JVM.
|
public static Thread addShutdownHook(AutoCloseable service, String serviceName, org.slf4j.Logger logger)
public static boolean addShutdownHookThread(Thread shutdownHook, String serviceName, org.slf4j.Logger logger)
shutdownHook
- Shutdown hook to be registered.serviceName
- The name of service.logger
- The logger to log.Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.