mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-22 08:13:20 +00:00
Module Client, clss ClientBackEndModuleManager : ajout d'un listener sur NetworkService permettant de mettre à jours les modules sur réception d'une config serveur
This commit is contained in:
parent
93ff19af60
commit
253b463a97
@ -3,6 +3,7 @@ package com.pqt.client.module;
|
|||||||
import com.pqt.client.module.account.AccountService;
|
import com.pqt.client.module.account.AccountService;
|
||||||
import com.pqt.client.module.connection.ConnectionService;
|
import com.pqt.client.module.connection.ConnectionService;
|
||||||
import com.pqt.client.module.network.NetworkService;
|
import com.pqt.client.module.network.NetworkService;
|
||||||
|
import com.pqt.client.module.network.listeners.INetworkServiceListener;
|
||||||
import com.pqt.client.module.query.QueryExecutor;
|
import com.pqt.client.module.query.QueryExecutor;
|
||||||
import com.pqt.client.module.sale.SaleService;
|
import com.pqt.client.module.sale.SaleService;
|
||||||
import com.pqt.client.module.stat.StatService;
|
import com.pqt.client.module.stat.StatService;
|
||||||
@ -24,6 +25,27 @@ public class ClientBackEndModuleManager {
|
|||||||
accountService = new AccountService(queryExecutor);
|
accountService = new AccountService(queryExecutor);
|
||||||
statService = new StatService(queryExecutor);
|
statService = new StatService(queryExecutor);
|
||||||
networkService = new NetworkService(queryExecutor, connectionService);
|
networkService = new NetworkService(queryExecutor, connectionService);
|
||||||
|
|
||||||
|
networkService.addListener(new INetworkServiceListener() {
|
||||||
|
@Override
|
||||||
|
public void onPQTPingSuccessEvent(String host, Integer port) {
|
||||||
|
//No-op
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPQTPingFailureEvent(String host, Integer port, Throwable cause) {
|
||||||
|
//No-op
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNewServerConfigData() {
|
||||||
|
//On bind un refresh automatique des données
|
||||||
|
//sur la réception d'une nouvelle config serveur
|
||||||
|
stockService.refreshProductList();
|
||||||
|
accountService.refreshAccounts();
|
||||||
|
statService.refreshStats();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public SaleService getSaleService() {
|
public SaleService getSaleService() {
|
||||||
|
Loading…
Reference in New Issue
Block a user