当前位置: 首页>>代码示例>>Java>>正文


Java IStreamMonitor类代码示例

本文整理汇总了Java中org.eclipse.debug.core.model.IStreamMonitor的典型用法代码示例。如果您正苦于以下问题:Java IStreamMonitor类的具体用法?Java IStreamMonitor怎么用?Java IStreamMonitor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IStreamMonitor类属于org.eclipse.debug.core.model包,在下文中一共展示了IStreamMonitor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addAndNotifyStreamListener

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
/**
 * 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);
	}
}
 
开发者ID:wpilibsuite,项目名称:EclipsePlugins,代码行数:21,代码来源:AntLauncher.java

示例2: streamAppended

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
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);
            }
        }
    }
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:18,代码来源:BroadcastStreamListener.java

示例3: streamAppended

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
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);
            }
        }
    }
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:18,代码来源:TLAPMBroadcastStreamListener.java

示例4: onAfterCodeServerStarted

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
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);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:23,代码来源:GwtWtpPlugin.java

示例5: getStreamsProxy

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@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;
        }
    };
}
 
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:19,代码来源:CodenvyRunnerProcess.java

示例6: streamAppended

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
	HybridCore.trace(text);
	if(delegate != null){
		delegate.streamAppended(text, monitor);
	}
}
 
开发者ID:eclipse,项目名称:thym,代码行数:8,代码来源:TracingStreamListener.java

示例7: addMonListener

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
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
//		}
	}
 
开发者ID:Elphel,项目名称:vdt-plugin,代码行数:11,代码来源:RunningBuilds.java

示例8: streamAppended

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@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));
	}
}
 
开发者ID:tsvetan-stoyanov,项目名称:launchpi,代码行数:8,代码来源:RemoteProcess.java

示例9: streamAppended

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
}
 
开发者ID:de-jcup,项目名称:egradle,代码行数:4,代码来源:EGradleRuntimeProcess.java

示例10: getErrorStreamMonitor

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@Override
public IStreamMonitor getErrorStreamMonitor() {
	return errorMonitor;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:5,代码来源:TurnusProcess.java

示例11: getOutputStreamMonitor

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@Override
public IStreamMonitor getOutputStreamMonitor() {
	return outputMonitor;
}
 
开发者ID:turnus,项目名称:turnus,代码行数:5,代码来源:TurnusProcess.java

示例12: setUpStreamListening

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
/**
 * 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);
                }
            }
        }
    }
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:70,代码来源:ProverJob.java

示例13: streamAppended

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@Override
public void streamAppended(String text, IStreamMonitor monitor) {
	TypeScriptCompilerHelper.processMessage(text, this);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:5,代码来源:TscStreamListener.java

示例14: getErrorStreamMonitor

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@Override
public IStreamMonitor getErrorStreamMonitor() {
	return this.error;
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:5,代码来源:BfProcess.java

示例15: getOutputStreamMonitor

import org.eclipse.debug.core.model.IStreamMonitor; //导入依赖的package包/类
@Override
public IStreamMonitor getOutputStreamMonitor() {
	return this.output;
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:5,代码来源:BfProcess.java


注:本文中的org.eclipse.debug.core.model.IStreamMonitor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。