Cleanup for release stage

Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
2016-12-06 11:35:38 -05:00
parent 17ac47f15e
commit bf8d76750f
4 changed files with 155 additions and 35 deletions

View File

@@ -96,8 +96,7 @@ public class SocketConsoleApplicationShell implements Runnable, AutoCloseable {
public void run() {
try {
while (!socket.isClosed()) {
while (!socket.isClosed() &&
!consoleManager.available()) {
while (!socket.isClosed() && !consoleManager.available()) {
waitASec();
}
if (socket.isClosed()) {
@@ -192,7 +191,8 @@ public class SocketConsoleApplicationShell implements Runnable, AutoCloseable {
// Create the streams
runSokectServer();
} catch (final IOException e) {
LOGGER.log(Level.SEVERE,
LOGGER.severe("Communication error between client and server"); //$NON-NLS-1$
LOGGER.log(Level.FINE,
"Communication error between client and server", e); //$NON-NLS-1$
}
}
@@ -229,12 +229,20 @@ public class SocketConsoleApplicationShell implements Runnable, AutoCloseable {
LOGGER.log(Level.FINE,
"Socket closed with exception (probably due to server interruption)", //$NON-NLS-1$
e);
} catch (IOException e) {
throw e;
}
LOGGER.info("Closing client"); //$NON-NLS-1$
}
runnable.setRunning(false);
consoleManager.type(applicationShutdown);
consoleManager.close();
try {
consoleManager.type(applicationShutdown);
consoleManager.close();
} catch (IOException e) {
LOGGER.warning("Unable to close application correctly"); //$NON-NLS-1$
LOGGER.log(Level.FINE, "Application closing caused an exception",
e);
}
LOGGER.info("Closing Server"); //$NON-NLS-1$
}