Java 类org.eclipse.debug.core.model.IStreamMonitor 实例源码

项目:EclipsePlugins    文件:AntLauncher.java   
/**
 * Adds listener to monitor, and calls listener with any content monitor already has.
 * NOTE: This methods synchronises on monitor while listener is called. Listener may
 * not wait on any thread that waits for monitors monitor, what would result in dead-lock.
 */
public static void addAndNotifyStreamListener(IStreamMonitor monitor, IStreamListener listener) {
    // Synchronise on monitor to prevent writes to stream while we are adding listener.
    // It's weird to synchronise on monitor because that's a shared object, but that's
    // what ProcessConsole does.
    synchronized (monitor) {
        String contents = monitor.getContents();
        if (!contents.isEmpty()) {
            // Call to unknown code while synchronising on monitor. This is dead-lock prone!
            // Listener must not wait for other threads that are waiting in line to
            // synchronise on monitor.
            listener.streamAppended(contents, monitor);
        }
        monitor.addListener(listener);
    }
}
项目:tlaplus    文件:BroadcastStreamListener.java   
public synchronized void streamAppended(String text, IStreamMonitor monitor)
{
    // broadcast the message
    for (int i = 0; i < listeners.length; i++)
    {
        if (listeners[i] != null)
        {
            try
            {
                listeners[i].appendText(text);
            } catch (Exception e)
            {
                TLCActivator.logError("Error broadcasting the message", e);
            }
        }
    }
}
项目:tlaplus    文件:TLAPMBroadcastStreamListener.java   
public synchronized void streamAppended(String text, IStreamMonitor monitor)
{
    // broadcast the message
    for (int i = 0; i < listeners.length; i++)
    {
        if (listeners[i] != null)
        {
            try
            {
                listeners[i].appendText(text);
            } catch (Exception e)
            {
                ProverUIActivator.getDefault().logError("Error broadcasting the message", e);
            }
        }
    }
}
项目:gwt-eclipse-plugin    文件:GwtWtpPlugin.java   
private void onAfterCodeServerStarted(DebugEvent event) {
  if (!(event.getSource() instanceof IProcess)) {
    return;
  }

  IProcess runtimeProcess = (IProcess) event.getSource();
  final ILaunch launch = runtimeProcess.getLaunch();
  IProcess[] processes = launch.getProcesses();
  final IProcess process = processes[0];

  // Look for the links in the sdm console output
  consoleStreamListenerCodeServer = new IStreamListener() {
    @Override
    public void streamAppended(String text, IStreamMonitor monitor) {
      displayCodeServerUrlInDevMode(launch, text);
    }
  };

  // Listen to Console output
  streamMonitorCodeServer = process.getStreamsProxy().getOutputStreamMonitor();
  streamMonitorCodeServer.addListener(consoleStreamListenerCodeServer);
}
项目:eclipse-plugin    文件:CodenvyRunnerProcess.java   
@Override
public IStreamsProxy getStreamsProxy() {
    return new IStreamsProxy() {
        @Override
        public void write(String input) throws IOException {
        }

        @Override
        public IStreamMonitor getErrorStreamMonitor() {
            return errorStream;
        }

        @Override
        public IStreamMonitor getOutputStreamMonitor() {
            return outputStream;
        }
    };
}
项目:eclipse-plugin    文件:CodenvyBuilderProcess.java   
@Override
public IStreamsProxy getStreamsProxy() {
    return new IStreamsProxy() {
        @Override
        public void write(String input) throws IOException {
        }

        @Override
        public IStreamMonitor getErrorStreamMonitor() {
            return errorStream;
        }

        @Override
        public IStreamMonitor getOutputStreamMonitor() {
            return outputStream;
        }
    };
}
项目:thym    文件:TracingStreamListener.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    HybridCore.trace(text);
    if(delegate != null){
        delegate.streamAppended(text, monitor);
    }
}
项目:vdt-plugin    文件:RunningBuilds.java   
public void addMonListener(IConsole parserConsole, IStreamMonitor monitor, IStreamListener listener){
        if (parserListeners==null){
            MessageUI.error("BUG in addMonListener(): parserListeners=null - enable breakpoints");
            System.out.println("BUG in addMonListener(): parserListeners=null");
            return;
        }
//      synchronized (parserListeners){
            parserListeners.put(parserConsole, new MonListener(monitor, listener)); // java.lang.NullPointerException
//      }
    }
项目:launchpi    文件:RemoteProcess.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    if (text.length() == 0 && !shell.isActive()) {
        getSystemRegistry().fireEvent(
                new SystemResourceChangeEvent(RemoteProcess.this, ISystemResourceChangeEvents.EVENT_COMMAND_SHELL_FINISHED, cmdSubSystem));
    }
}
项目:egradle    文件:EGradleRuntimeProcess.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
}
项目:turnus    文件:TurnusProcess.java   
@Override
public IStreamMonitor getErrorStreamMonitor() {
    return errorMonitor;
}
项目:turnus    文件:TurnusProcess.java   
@Override
public IStreamMonitor getOutputStreamMonitor() {
    return outputMonitor;
}
项目:tlaplus    文件:ProverJob.java   
/**
 * This method sets up the mechanism for listening to the error and output streams
 * of the prover. It also sets the value of the field proverProcess.
 * 
 * @param process
 * @param monitor
 */
private void setUpStreamListening(Process process, IProgressMonitor monitor)
{
    /*
     * This code proceeds as follows. First, we wrap the java.lang.Process in an IProcess by calling
     * DebugPlugin.newProcess(). An IProcess is an eclipse object with some
     * convenience methods. Then we create a TLAPMBroadcastStreamListener and add it as
     * a listener to the output and error streams of the IProcess.
     * 
     * The code is wrapped in two synchronized blocks to avoid a race condition on the
     * prover's output. The race condition can occur as follows. Calling DebugPlugin.newProcess()
     * creates instances of IStreamMonitor to monitor the output and error streams
     * of the prover. These monitors immediately start monitoring the streams and passing the
     * text from the streams to registered listeners. This means that they can potentially read
     * text from the prover's streams before the TLAPMBroadcastStreamListener is added as a listener.
     * This text would be lost. To solve this, this thread locks access to the prover's output and error
     * streams until after the TLAPMBroadcastStreamListener has been added as a listener.
     */
    if (process != null)
    {
        synchronized (process.getInputStream())
        {
            synchronized (process.getErrorStream())
            {
                /* 
                 * Calling DebugPlugin.newProcess()
                 * wraps the java.lang.Process in an IProcess with some
                 * convenience methods.
                 */
                proverProcess = DebugPlugin.newProcess(launch, process, getName());
                /*
                 * Setup the broadcasting of the prover output stream.
                 * We pass in the progress monitor to allow listeners
                 * to report progress.
                 */
                listener = new TLAPMBroadcastStreamListener(module, this, monitor);

                /*
                 * Send a string to the listener indicating
                 * that a new prover job is starting. This makes
                 * it easier to read the console.
                 */
                listener.streamAppended("---------------- New Prover Launch --------------\n", null);

                IStreamMonitor esMonitor = proverProcess.getStreamsProxy().getErrorStreamMonitor();
                IStreamMonitor osMonitor = proverProcess.getStreamsProxy().getOutputStreamMonitor();

                esMonitor.addListener(listener);
                osMonitor.addListener(listener);

                /*
                 * The output from the prover can be long, so buffering it can lead to an
                 * OutOfMemoryError. The following code turns off buffering.
                 */
                if (esMonitor instanceof IFlushableStreamMonitor && osMonitor instanceof IFlushableStreamMonitor)
                {
                    ((IFlushableStreamMonitor) esMonitor).setBuffered(false);
                    ((IFlushableStreamMonitor) osMonitor).setBuffered(false);
                }
            }
        }
    }
}
项目:typescript.java    文件:TscStreamListener.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    TypeScriptCompilerHelper.processMessage(text, this);
}
项目:brainfuck    文件:BfProcess.java   
@Override
public IStreamMonitor getErrorStreamMonitor() {
    return this.error;
}
项目:brainfuck    文件:BfProcess.java   
@Override
public IStreamMonitor getOutputStreamMonitor() {
    return this.output;
}
项目:brainfuck    文件:BfProcess.java   
BfOutputStream(IStreamMonitor monitor, String encoding) {
    this.monitor = monitor;
    this.encoding = encoding;
}
项目:chromedevtools    文件:ConsolePseudoProcess.java   
public IStreamMonitor getErrorStreamMonitor() {
  return NullStreamMonitor.INSTANCE;
}
项目:chromedevtools    文件:ConsolePseudoProcess.java   
public IStreamMonitor getOutputStreamMonitor() {
  return outputMonitor;
}
项目:thym    文件:AndroidSDKManager.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);
}
项目:thym    文件:AndroidSDKManager.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);
}
项目:thym    文件:AndroidSDKManager.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);
}
项目:thym    文件:AndroidSDKManager.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);

}
项目:thym    文件:XCodeBuild.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);

}
项目:thym    文件:XCodeBuild.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);
}
项目:thym    文件:IOSSimulator.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);
}
项目:thym    文件:TextDetectingStreamListener.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    if(text.contains(theText)){
        detected = true;
    }
}
项目:thym    文件:CordovaCLIStreamListener.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    message.append(text);
}
项目:thym    文件:WindowsRegistry.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);
}
项目:thym    文件:WindowsRegistry.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);
}
项目:thym    文件:WPEmulator.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    buffer.append(text);
}
项目:vdt-plugin    文件:RunningBuilds.java   
public IStreamMonitor getMonitor() {
    return monitor;
}
项目:vdt-plugin    文件:RunningBuilds.java   
public MonListener(IStreamMonitor monitor, IStreamListener listener) {
    super();
    this.monitor = monitor;
    this.listener = listener;
}
项目:vdt-plugin    文件:VDTRunnerConfiguration.java   
public IStreamMonitor getMonitor() {
    return monitor;
}
项目:vdt-plugin    文件:VDTRunnerConfiguration.java   
public MonListener(IStreamMonitor monitor, IStreamListener listener) {
    super();
    this.monitor = monitor;
    this.listener = listener;
}
项目:teavm    文件:TeaVMStreamsProxy.java   
@Override
public IStreamMonitor getErrorStreamMonitor() {
    return new TeaVMStreamMonitor();
}
项目:teavm    文件:TeaVMStreamsProxy.java   
@Override
public IStreamMonitor getOutputStreamMonitor() {
    return new TeaVMStreamMonitor();
}
项目:launchpi    文件:RemoteProcessStreamsProxy.java   
@Override
public IStreamMonitor getErrorStreamMonitor() {
    return errorStreamMonitor;
}
项目:launchpi    文件:RemoteProcessStreamsProxy.java   
@Override
public IStreamMonitor getOutputStreamMonitor() {
    return outputStreamMonitor;
}
项目:launchpi    文件:RPIDebugConfigurationDelegate.java   
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
    if (!remoteVmReadyForDebug && text.startsWith(DEBUG_READY_MESSAGE)) {
        remoteVmReadyForDebug = true;
    }
}