Package org.apache.zookeeper.util
Class ServiceUtils
java.lang.Object
org.apache.zookeeper.util.ServiceUtils
Utilities for service management.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic void
requestSystemExit
(int code) Force shutdown of the JVM using System.exit.static void
setSystemExitProcedure
(Consumer<Integer> systemExitProcedure) Override system callback.
-
Field Details
-
SYSTEM_EXIT
Default strategy for shutting down the JVM. -
LOG_ONLY
No-op strategy, useful for tests.
-
-
Method Details
-
setSystemExitProcedure
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:
-