From 7cac782a61b01761a888559fc493c36a0e33af3a Mon Sep 17 00:00:00 2001 From: EndMove Date: Sat, 26 Feb 2022 17:53:53 +0100 Subject: [PATCH] Start the server when the repository get it. --- .../java/lightcontainer/repository/ClientHandlerRepository.java | 2 ++ .../lightcontainer/repository/StoreProcessorRepository.java | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/src/main/java/lightcontainer/repository/ClientHandlerRepository.java b/app/src/main/java/lightcontainer/repository/ClientHandlerRepository.java index 8cc9383..e96050f 100644 --- a/app/src/main/java/lightcontainer/repository/ClientHandlerRepository.java +++ b/app/src/main/java/lightcontainer/repository/ClientHandlerRepository.java @@ -32,6 +32,7 @@ public class ClientHandlerRepository implements AutoCloseable, UnicastCHR { /** * Setter, allow to define the ServerListener of a repository. + * & Start the server. * @param server ServerListener to set as default. * * @since 1.0 @@ -39,6 +40,7 @@ public class ClientHandlerRepository implements AutoCloseable, UnicastCHR { @Override public void setServerListener(UnicastServerListener server) { this.server = server; + server.start(); } /** diff --git a/app/src/main/java/lightcontainer/repository/StoreProcessorRepository.java b/app/src/main/java/lightcontainer/repository/StoreProcessorRepository.java index 7ed9a74..01fe81a 100644 --- a/app/src/main/java/lightcontainer/repository/StoreProcessorRepository.java +++ b/app/src/main/java/lightcontainer/repository/StoreProcessorRepository.java @@ -31,6 +31,7 @@ public class StoreProcessorRepository implements AutoCloseable, MulticastSPR { /** * Setter, allow to define the ServerListener of a repository. + * & start the server. * @param server ServerListener to set as default. * * @since 1.0 @@ -38,6 +39,7 @@ public class StoreProcessorRepository implements AutoCloseable, MulticastSPR { @Override public void setServerListener(MulticastServerListener server) { this.server = server; + server.run(); } /**