Package org.apache.flink.util
Class ShutdownHookUtil
- java.lang.Object
-
- org.apache.flink.util.ShutdownHookUtil
-
public class ShutdownHookUtil extends Object
Utils class for dealing with JVM shutdown hooks.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ThreadaddShutdownHook(AutoCloseable service, String serviceName, org.slf4j.Logger logger)Adds a shutdown hook to the JVM and returns the Thread, which has been registered.static booleanaddShutdownHookThread(Thread shutdownHook, String serviceName, org.slf4j.Logger logger)Adds a shutdown hook to the JVM.static voidremoveShutdownHook(Thread shutdownHook, String serviceName, org.slf4j.Logger logger)Removes a shutdown hook from the JVM.
-
-
-
Method Detail
-
addShutdownHook
public 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.
-
addShutdownHookThread
public static boolean addShutdownHookThread(Thread shutdownHook, String serviceName, org.slf4j.Logger logger)
Adds a shutdown hook to the JVM.- Parameters:
shutdownHook- Shutdown hook to be registered.serviceName- The name of service.logger- The logger to log.- Returns:
- Whether the hook has been successfully registered.
-
-