public static void installAsShutdownHook ( Logger logger , long delayMillis ) { checkArgument ( delayMillis >= 0 , "delay must be >= 0" ) ; // install the blocking shutdown hook Thread shutdownHook = new JvmShutdownSafeguard ( delayMillis ) ; ShutdownHookUtil . addShutdownHookThread ( shutdownHook , JvmShutdownSafeguard . class . getSimpleName ( ) , logger ) ; }
Installs the safeguard shutdown hook . The maximum time that the JVM is allowed to spend on shutdown before being killed is the given number of milliseconds .