mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 01:41:11 +01:00
Merge pull request #4461 from ghubstan/1-singleton-coreapi
Make CoreApi a singleton
This commit is contained in:
commit
604dabbb46
@ -4,6 +4,8 @@ import joptsimple.ArgumentAcceptingOptionSpec;
|
||||
import joptsimple.OptionSet;
|
||||
import joptsimple.OptionSpec;
|
||||
|
||||
import com.google.common.annotations.VisibleForTesting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@ -17,6 +19,7 @@ import java.util.List;
|
||||
* the command line with those provided via config file, such that those provided at the
|
||||
* command line take precedence over those provided in the config file.
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public class CompositeOptionSet {
|
||||
|
||||
private final List<OptionSet> optionSets = new ArrayList<>();
|
||||
|
@ -31,6 +31,7 @@ import bisq.common.app.Version;
|
||||
import org.bitcoinj.core.Coin;
|
||||
|
||||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@ -42,6 +43,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||
* Provides high level interface to functionality of core Bisq features.
|
||||
* E.g. useful for different APIs to access data of different domains of Bisq.
|
||||
*/
|
||||
@Singleton
|
||||
@Slf4j
|
||||
public class CoreApi {
|
||||
|
||||
|
@ -62,7 +62,6 @@ public class BisqAppMain extends BisqExecutable {
|
||||
log.debug("onSetupComplete");
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// First synchronous execution tasks
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -87,7 +86,6 @@ public class BisqAppMain extends BisqExecutable {
|
||||
Application.launch(BisqApp.class);
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// As application is a JavaFX application we need to wait for onApplicationLaunched
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
@ -123,21 +121,13 @@ public class BisqAppMain extends BisqExecutable {
|
||||
|
||||
@Override
|
||||
protected void startApplication() {
|
||||
// We need to be in user thread! We mapped at launchApplication already...
|
||||
|
||||
// Once the UI is ready we get onApplicationStarted called and start the setup there
|
||||
// We need to be in user thread! We mapped at launchApplication already. Once
|
||||
// the UI is ready we get onApplicationStarted called and start the setup there.
|
||||
application.startApplication(this::onApplicationStarted);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onApplicationStarted() {
|
||||
super.onApplicationStarted();
|
||||
|
||||
/*
|
||||
if (runWithGrpcApi()) {
|
||||
CoreApi coreApi = injector.getInstance(CoreApi.class);
|
||||
bisqGrpcServer = new BisqGrpcServer(coreApi);
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user