Search in sources :

Example 1 with SystemExitService

use of com.github.robozonky.util.SystemExitService in project robozonky by RoboZonky.

the class App method exit.

/**
 * Will terminate the application. Call this on every exit of the app to ensure proper termination. Failure to do
 * so may result in unpredictable behavior of this instance of RoboZonky or future ones.
 * @param result Will be passed to {@link System#exit(int)}.
 */
public static void exit(final ShutdownHook.Result result) {
    App.SHUTDOWN_HOOKS.execute(result);
    final SystemExitService exit = SystemExitServiceLoader.load();
    LOGGER.trace("System exit service received: {}.", exit);
    exit.newSystemExit().call(result.getReturnCode().getCode());
}
Also used : SystemExitService(com.github.robozonky.util.SystemExitService)

Aggregations

SystemExitService (com.github.robozonky.util.SystemExitService)1