Commit d4c59c3b authored by Mathieu Lirzin's avatar Mathieu Lirzin

Improved: Inline ‘StartupControlPanel#createLogDirectoryIfMissing’.

Use a lambda instead of an anonymous class to implement a thread.
parent df5dde37
......@@ -63,7 +63,7 @@ final class StartupControlPanel {
createLogDirectoryIfMissing(config.logDir.toString());
if (config.useShutdownHook) {
createRuntimeShutdownHook(loader, serverState);
Runtime.getRuntime().addShutdownHook(new Thread(() -> shutdownServer(loader, serverState)));
} else {
System.out.println("Shutdown hook disabled");
}
......@@ -140,15 +140,6 @@ final class StartupControlPanel {
}
}
private static void createRuntimeShutdownHook(ContainerLoader loader, AtomicReference<ServerState> serverState) {
Runtime.getRuntime().addShutdownHook(new Thread() {
@Override
public void run() {
shutdownServer(loader, serverState);
}
});
}
private static void loadContainers(Config config,
ContainerLoader loader,
List<StartupCommand> ofbizCommands,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment