diff --git a/app/src/main/java/lightcontainer/domains/client/StoreProcessor.java b/app/src/main/java/lightcontainer/domains/client/StoreProcessor.java index 0741ba6..2efbfe2 100644 --- a/app/src/main/java/lightcontainer/domains/client/StoreProcessor.java +++ b/app/src/main/java/lightcontainer/domains/client/StoreProcessor.java @@ -91,7 +91,7 @@ public class StoreProcessor extends UnicastThread implements AutoCloseable { } catch (IOException exception) { System.out.println("[ERROR] Problem with SBE (" + domain + ") : " + exception.getMessage()); - this.setRunning(false); + this.close(); } } @@ -143,6 +143,20 @@ public class StoreProcessor extends UnicastThread implements AutoCloseable { } } + /** + * AutoClosable Function + * Close the Storage thread and resources. + * + * @since 1.0 + */ + @Override + public void close() { + if (this.isRunning()) { + this.setRunning(false); + System.out.println("[SBE] Fermeture de " + domain); + } + } + /** * Compare two StoreProcessor object to check if equals. */ @@ -170,7 +184,6 @@ public class StoreProcessor extends UnicastThread implements AutoCloseable { return this.domain; } - /** * Permet de mettre à jours la dernière annonce de ce SBE au FFE */