Package org.apache.zookeeper.util
Class ServiceUtils
- java.lang.Object
-
- org.apache.zookeeper.util.ServiceUtils
-
public abstract class ServiceUtils extends Object
Utilities for service management.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
requestSystemExit(int code)
Force shutdown of the JVM using System.exit.static void
setSystemExitProcedure(Consumer<Integer> systemExitProcedure)
Override system callback.
-
-
-
Method Detail
-
setSystemExitProcedure
public static void setSystemExitProcedure(Consumer<Integer> systemExitProcedure)
Override system callback. Useful for preventing the JVM to exit in tests or in applications that are running an in-process ZooKeeper server.- Parameters:
systemExitProcedure
-
-
requestSystemExit
public static void requestSystemExit(int code)
Force shutdown of the JVM using System.exit.- Parameters:
code
- the exit code- See Also:
ExitCode
-
-