Refactor: add new setup method to CommonSetup with config (WIP) and call it at doExecute. Move AsciiLogo to CommonSetup

This commit is contained in:
chimp1984 2020-09-30 21:53:29 -05:00
parent fe7ccbd6f9
commit b6e97e371e
No known key found for this signature in database
GPG key ID: 9801B4EC591F90E3
2 changed files with 11 additions and 5 deletions

View file

@ -18,6 +18,8 @@
package bisq.common.setup;
import bisq.common.UserThread;
import bisq.common.app.AsciiLogo;
import bisq.common.config.Config;
import bisq.common.crypto.CryptoUtils;
import bisq.common.crypto.LimitedKeyStrengthException;
import bisq.common.util.Utilities;
@ -33,10 +35,13 @@ import lombok.extern.slf4j.Slf4j;
@Slf4j
public class CommonSetup {
public static void setup(Config config) {
AsciiLogo.showAsciiLogo();
setSystemProperties();
}
public static void setup(UncaughtExceptionHandler uncaughtExceptionHandler) {
setupErrorHandler(uncaughtExceptionHandler);
setSystemProperties();
}
protected static void setSystemProperties() {

View file

@ -32,13 +32,13 @@ import bisq.network.p2p.P2PService;
import bisq.common.UserThread;
import bisq.common.app.AppModule;
import bisq.common.app.AsciiLogo;
import bisq.common.app.DevEnv;
import bisq.common.config.BisqHelpFormatter;
import bisq.common.config.Config;
import bisq.common.config.ConfigException;
import bisq.common.handlers.ResultHandler;
import bisq.common.proto.persistable.PersistedDataHost;
import bisq.common.setup.CommonSetup;
import bisq.common.setup.GracefulShutDownHandler;
import bisq.common.util.Utilities;
@ -103,9 +103,10 @@ public abstract class BisqExecutable implements GracefulShutDownHandler, BisqSet
///////////////////////////////////////////////////////////////////////////////////////////
protected void doExecute() {
AsciiLogo.showAsciiLogo();
configUserThread();
CommonSetup.setup(config);
CoreSetup.setup(config);
configUserThread();
addCapabilities();
Signal.handle(new Signal("INT"), signal -> {