/** * 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; }
public void closeStream() { if (fStreamMonitor == null) { return; } synchronized (fStreamMonitor) { fStreamMonitor.removeListener(this); if (!fFlushed) { String contents = fStreamMonitor.getContents(); streamAppended(contents, fStreamMonitor); } fListenerRemoved = true; try { if (fStream != null) { fStream.close(); } } catch (IOException e) { } } }
private void notifyParitioner(String encodedString) throws IOException { try { partitioner.streamAppended(this, encodedString); if (activateOnWrite) { console.activate(); } else { ConsolePlugin.getDefault().getConsoleManager().warnOfContentChange(console); } } catch (IOException e) { if (!closed) { close(); } throw e; } }
private void notifyParitioner(String encodedString) throws IOException { try { partitioner.streamAppended(this, encodedString); if (activateOnWrite) { console.activate(); } else { ConsolePlugin.getDefault().getConsoleManager().warnOfContentChange(console); } } catch (IOException e) { if (!closed) { close(); } throw e; } }