GCLC swt code compliance
This commit is contained in:
@@ -142,34 +142,35 @@ public class SocketConsoleApplicationShell implements Runnable {
|
||||
* @see java.lang.Runnable#run() */
|
||||
@Override
|
||||
public void run() {
|
||||
// Create the server
|
||||
try (ServerSocket actualServerSocket = new ServerSocket(port)) {
|
||||
this.serverSocket = actualServerSocket;
|
||||
running = true;
|
||||
// Create the streams
|
||||
try (PipedOutputStream outStream = new PipedOutputStream();
|
||||
BufferedWriter writer = new BufferedWriter(
|
||||
new OutputStreamWriter(outStream))) {
|
||||
new OutputStreamWriter(outStream));
|
||||
InputStreamReader isr = new InputStreamReader(consoleInput);
|
||||
BufferedReader inBuf = new BufferedReader(isr)) {
|
||||
consoleInput.connect(outStream);
|
||||
try (InputStreamReader isr = new InputStreamReader(
|
||||
consoleInput);
|
||||
BufferedReader inBuf = new BufferedReader(isr);) {
|
||||
consoleManager.setInput(inBuf);
|
||||
runSokectServer(writer);
|
||||
// Close the application
|
||||
// Pass command to application
|
||||
if (app.isRunning()) {
|
||||
writer.write(applicationShutdown + EOL);
|
||||
writer.flush();
|
||||
}
|
||||
consoleManager.setInput(inBuf);
|
||||
runSokectServer(writer);
|
||||
// Close the application
|
||||
// Pass command to application
|
||||
if (app.isRunning()) {
|
||||
writer.write(applicationShutdown + EOL);
|
||||
writer.flush();
|
||||
}
|
||||
}
|
||||
} catch (final IOException e) {
|
||||
} catch (
|
||||
|
||||
final IOException e) {
|
||||
LOGGER.log(Level.SEVERE,
|
||||
"Communication error between client and server", e); //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
/** @param appTh the application thread
|
||||
* @param writer the writer to the application
|
||||
/** @param writer the writer to the application
|
||||
* @throws IOException if the communication with the client failed */
|
||||
private void runSokectServer(BufferedWriter writer) throws IOException {
|
||||
final ConsoleRunnable runnable = new ConsoleRunnable(app,
|
||||
|
||||
Reference in New Issue
Block a user