Java 类com.intellij.util.concurrency.SequentialTaskExecutor 实例源码

项目:intellij-ce-playground    文件:BuildManager.java   
@NotNull
private ProjectData getProjectData(String projectPath) {
  synchronized (myProjectDataMap) {
    ProjectData data = myProjectDataMap.get(projectPath);
    if (data == null) {
      data = new ProjectData(new SequentialTaskExecutor(PooledThreadExecutor.INSTANCE));
      myProjectDataMap.put(projectPath, data);
    }
    return data;
  }
}
项目:intellij-ce-playground    文件:BuildManager.java   
private Future<Pair<RequestFuture<PreloadedProcessMessageHandler>, OSProcessHandler>> launchPreloadedBuildProcess(final Project project, SequentialTaskExecutor projectTaskQueue) throws Exception {
  ensureListening();

  // launching build process from projectTaskQueue ensures that no other build process for this project is currently running
  return projectTaskQueue.submit(new Callable<Pair<RequestFuture<PreloadedProcessMessageHandler>, OSProcessHandler>>() {
    public Pair<RequestFuture<PreloadedProcessMessageHandler>, OSProcessHandler> call() throws Exception {
      if (project.isDisposed()) {
        return null;
      }
      final RequestFuture<PreloadedProcessMessageHandler> future = new RequestFuture<PreloadedProcessMessageHandler>(new PreloadedProcessMessageHandler(), UUID.randomUUID(), new CancelBuildSessionAction<PreloadedProcessMessageHandler>());
      try {
        myMessageDispatcher.registerBuildMessageHandler(future, null);
        final OSProcessHandler processHandler = launchBuildProcess(project, myListenPort, future.getRequestID(), true);
        final StringBuffer errors = new StringBuffer();
        processHandler.addProcessListener(new StdOutputCollector(errors));
        STDERR_OUTPUT.set(processHandler, errors);

        processHandler.startNotify();
        return Pair.create(future, processHandler);
      }
      catch (Throwable e) {
        handleProcessExecutionFailure(future.getRequestID(), e);
        throw e instanceof Exception? (Exception)e : new RuntimeException(e);
      }
    }
  });
}
项目:intellij-ce-playground    文件:JavaBuilder.java   
public JavaBuilder(Executor tasksExecutor) {
  super(BuilderCategory.TRANSLATOR);
  myTaskRunner = new SequentialTaskExecutor(tasksExecutor);
  //add here class processors in the sequence they should be executed
}
项目:intellij-ce-playground    文件:BuildManager.java   
private ProjectData(@NotNull SequentialTaskExecutor taskQueue) {
  this.taskQueue = taskQueue;
}
项目:intellij-ce-playground    文件:ServerTaskExecutorImpl.java   
public ServerTaskExecutorImpl() {
  myTaskExecutor = new SequentialTaskExecutor(PooledThreadExecutor.INSTANCE);
}
项目:tools-idea    文件:JavaBuilder.java   
public JavaBuilder(Executor tasksExecutor) {
  super(BuilderCategory.TRANSLATOR);
  myTaskRunner = new SequentialTaskExecutor(tasksExecutor);
  //add here class processors in the sequence they should be executed
}
项目:tools-idea    文件:BuildManager.java   
private ProjectData(SequentialTaskExecutor taskQueue) {
  this.taskQueue = taskQueue;
}
项目:tools-idea    文件:ServerTaskExecutorImpl.java   
public ServerTaskExecutorImpl() {
  myTaskExecutor = new SequentialTaskExecutor(POOLED_THREAD_EXECUTOR);
}
项目:consulo    文件:ServerTaskExecutorImpl.java   
public ServerTaskExecutorImpl() {
  myTaskExecutor = SequentialTaskExecutor.createSequentialApplicationPoolExecutor("ServerTaskExecutorImpl pool");
}