mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
Add py4j gateway to Monitor
This commit is contained in:
parent
c957b53f3a
commit
55b9873d19
@ -6,6 +6,6 @@ import org.slf4j.LoggerFactory;
|
||||
public class DevFlags {
|
||||
private static final Logger log = LoggerFactory.getLogger(DevFlags.class);
|
||||
|
||||
public static final boolean STRESS_TEST_MODE = false;
|
||||
public static final boolean STRESS_TEST_MODE = true;
|
||||
public static final boolean DEV_MODE = STRESS_TEST_MODE || false;
|
||||
}
|
||||
|
@ -81,5 +81,13 @@
|
||||
<artifactId>core</artifactId>
|
||||
<version>${project.parent.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--py4j-->
|
||||
<!-- http://mvnrepository.com/artifact/net.sf.py4j/py4j -->
|
||||
<dependency>
|
||||
<groupId>net.sf.py4j</groupId>
|
||||
<artifactId>py4j</artifactId>
|
||||
<version>0.10.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
26
monitor/src/main/java/io/bitsquare/monitor/Gateway.java
Normal file
26
monitor/src/main/java/io/bitsquare/monitor/Gateway.java
Normal file
@ -0,0 +1,26 @@
|
||||
package io.bitsquare.monitor;
|
||||
|
||||
import io.bitsquare.trade.offer.Offer;
|
||||
import io.bitsquare.trade.offer.OfferBookService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import py4j.GatewayServer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class Gateway {
|
||||
private static final Logger log = LoggerFactory.getLogger(Gateway.class);
|
||||
private OfferBookService offerBookService;
|
||||
|
||||
public Gateway(OfferBookService offerBookService) {
|
||||
this.offerBookService = offerBookService;
|
||||
|
||||
GatewayServer gatewayServer = new GatewayServer(this);
|
||||
gatewayServer.start();
|
||||
log.info("Gateway Server Started");
|
||||
}
|
||||
|
||||
public List<Offer> getOffers() {
|
||||
return offerBookService.getOffers();
|
||||
}
|
||||
}
|
@ -24,6 +24,7 @@ public class Monitor {
|
||||
private static Environment env;
|
||||
private final Injector injector;
|
||||
private final OfferBookService offerBookService;
|
||||
private final Gateway gateway;
|
||||
|
||||
private P2PService p2pService;
|
||||
|
||||
@ -67,5 +68,6 @@ public class Monitor {
|
||||
p2pService = injector.getInstance(P2PService.class);
|
||||
offerBookService = injector.getInstance(OfferBookService.class);
|
||||
p2pService.start(false, null);
|
||||
gateway = new Gateway(offerBookService);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user