/** * Tests whether LogViewer thread is still running. * @return <code>false</code> if thread was stopped or its output window * was closed, <code>true</code> otherwise. */ public boolean isOpen() { InputOutput io = inOut; return !(io == null || stop || (isStarted && io.isClosed())); }
public static CachedInputOutput get(InputOutput inputOutput) { CachedInputOutput result = null; synchronized (InputOutputCache.class) { for (Iterator<Entry<InputOutput, CachedInputOutput>> it = AVAILABLE.entrySet().iterator(); it.hasNext();) { Entry<InputOutput, CachedInputOutput> entry = it.next(); final InputOutput free = entry.getKey(); final CachedInputOutput data = entry.getValue(); if (free.isClosed()) { it.remove(); continue; } if (free.equals(inputOutput)) { result = data; ACTIVE_DISPLAY_NAMES.add(result.getDisplayName()); it.remove(); } LOGGER.log(Level.FINEST, "Pooled: {0}", data.getDisplayName()); } } return result; }
final CachedInputOutput data = entry.getValue(); if (free.isClosed()) { it.remove(); continue;
public void run() { final int MAX_LINES = 10000; String line; shouldStop = io.isClosed(); if (!shouldStop) { try { if (lines >= MAX_LINES) { io.getOut().reset(); lines = ring.output(); } // end of if (lines >= MAX_LINES) while ((line = ins.readLine()) != null) { if ((line = ring.add(line)) != null) { io.getOut().println(line); lines++; } // end of if ((line = ring.add(line)) != null) } }catch (IOException e) { Logger.getLogger(LogViewerSupport.class.getName()).log(Level.INFO, null, e); } task.schedule(10000); } else { ///System.out.println("end of infinite loop for log viewer\n\n\n\n"); stopUpdatingLogViewer(); } } /* display the log viewer dialog
/** * display the log viewer dialog * @param forced reset view if true, otherwise refresh * @return The output window * @throws java.io.IOException encountered issue while doing a reset on the stdout */ public InputOutput showLogViewer(boolean forced) throws IOException{ io = UISupport.getServerIO(url); working = true; if (forced &&(io.isClosed())){ initRingerDone=false; io.getOut().reset(); } io.select(); return io; }
if (log.isClosed()) { if (HgModuleConfig.getDefault().getAutoOpenOutput()) { Mercurial.LOG.fine("Creating OutputLogger for " + repositoryRootString);
/** Remove this server instance and stop it if it has been started from within the IDE */ public void remove() { DebuggerManager.getDebuggerManager().removeDebuggerListener(debuggerStateListener); stopIfStartedByIde(); // close the server io window if (getUrl() != null) { InputOutput io = UISupport.getServerIO(url); if (io != null && !io.isClosed()) { io.closeInputOutput(); } ServerRegistry.getInstance().removeServerInstance(getUrl()); } else { LOGGER.log(Level.WARNING, "Trying to remove {0}, but url is null", server != null ? server.getShortName() : null); } }