public void disconnect() { synchronized (overflowLock) { document = null; partitions.clear(); connected = false; try { inputStream.close(); } catch (IOException e) { } } }
@Override public void disconnect() { synchronized (overflowLock) { document = null; partitions.clear(); connected = false; try { inputStream.close(); } catch (IOException e) { } } }
/** * Disposes this console. */ protected void dispose() { super.dispose(); partitioner.disconnect(); //make a copy of the open streams and close them all //a copy is needed as close the streams results in a callback that //removes the streams from the openStreams collection (bug 152794) Object[] allStreams= openStreams.toArray(); for (int i = 0; i < allStreams.length; i++) { Object stream = allStreams[i]; if (stream instanceof IOConsoleInputStream) { IOConsoleInputStream is = (IOConsoleInputStream) stream; try { is.close(); } catch (IOException e) { } } else if (stream instanceof IOConsoleOutputStream) { IOConsoleOutputStream os = (IOConsoleOutputStream) stream; try { os.close(); } catch (IOException e) { } } } inputStream = null; }