Extract nested trys
Signed-off-by: Emmanuel Bigeon <emmanuel@bigeon.fr>
This commit is contained in:
parent
0bbe9d321d
commit
b5f1463864
@ -236,6 +236,21 @@ public class SocketConsoleApplicationShell implements Runnable, AutoCloseable {
|
||||
}
|
||||
runnable.setRunning(false);
|
||||
try {
|
||||
closeManager(appThNext);
|
||||
} catch (IOException e) {
|
||||
LOGGER.warning("Unable to close application correctly"); //$NON-NLS-1$
|
||||
LOGGER.log(Level.FINE, "Application closing caused an exception", //$NON-NLS-1$
|
||||
e);
|
||||
}
|
||||
LOGGER.info("Closing Server"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/** Close the console manager after writing the application shutdown
|
||||
* command.
|
||||
*
|
||||
* @param appThNext the thread containing the application
|
||||
* @throws IOException if the typyng or closing failed */
|
||||
private void closeManager(Thread appThNext) throws IOException {
|
||||
consoleManager.type(applicationShutdown);
|
||||
try {
|
||||
appThNext.join(ONE_TENTH_OF_SECOND);
|
||||
@ -246,12 +261,6 @@ public class SocketConsoleApplicationShell implements Runnable, AutoCloseable {
|
||||
e);
|
||||
}
|
||||
consoleManager.close();
|
||||
} catch (IOException e) {
|
||||
LOGGER.warning("Unable to close application correctly"); //$NON-NLS-1$
|
||||
LOGGER.log(Level.FINE, "Application closing caused an exception", //$NON-NLS-1$
|
||||
e);
|
||||
}
|
||||
LOGGER.info("Closing Server"); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/** @param runnable the runnable */
|
||||
|
Loading…
Reference in New Issue
Block a user