diff --git a/app/src/main/java/lightcontainer/domains/client/StoreProcessor.java b/app/src/main/java/lightcontainer/domains/client/StoreProcessor.java index 718eb37..753a998 100644 --- a/app/src/main/java/lightcontainer/domains/client/StoreProcessor.java +++ b/app/src/main/java/lightcontainer/domains/client/StoreProcessor.java @@ -96,13 +96,13 @@ public class StoreProcessor extends UnicastThread implements AutoCloseable { } catch (IOException exception) { System.out.println("[ERROR] Problem with SBE (" + domain + ") : " + exception.getMessage()); - this.close(); + this.setRunning(false); } } // Fermeture du SBE try { - super.close(); + this.close(); this.fileFrontEnd.onStoreDisconnect(this.domain); } catch (Exception ioException) { System.out.println("[ERROR] Error while closing SBE (" + domain + ") : " + ioException.getMessage()); @@ -129,7 +129,7 @@ public class StoreProcessor extends UnicastThread implements AutoCloseable { synchronized (this) { this.protocolResult = null; if (responseCommand == null) { - this.close(); + this.setRunning(false); } fileFrontEnd.onStoreAvailable(this.getDomain(), responseCommand); } @@ -148,20 +148,6 @@ 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. */ diff --git a/app/src/main/java/lightcontainer/domains/client/UnicastThread.java b/app/src/main/java/lightcontainer/domains/client/UnicastThread.java index b363c10..58edce4 100644 --- a/app/src/main/java/lightcontainer/domains/client/UnicastThread.java +++ b/app/src/main/java/lightcontainer/domains/client/UnicastThread.java @@ -78,6 +78,7 @@ public abstract class UnicastThread extends Thread implements AutoCloseable { this.reader.close(); this.writer.close(); this.socket.close(); + setRunning(false); } protected boolean isRunning() {