Java Code Examples for jetbrains.buildServer.agent.BuildFinishedStatus#INTERRUPTED

The following examples show how to use jetbrains.buildServer.agent.BuildFinishedStatus#INTERRUPTED . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CompositeBuildProcessImpl.java    From TeamCity.Virtual with Apache License 2.0 6 votes vote down vote up
@NotNull
protected BuildFinishedStatus waitForImpl() throws RunBuildException {
  if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
  for (BuildProcess proc = myProcessList.poll(); proc != null; proc = myProcessList.poll()) {
    myCurrentProcess.set(proc);
    try {
      proc.start();
      final BuildFinishedStatus status = proc.waitFor();
      if (status != BuildFinishedStatus.INTERRUPTED && status != BuildFinishedStatus.FINISHED_SUCCESS) return status;
    } finally {
      myCurrentProcess.set(null);
    }
    if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
  }
  if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
  return BuildFinishedStatus.FINISHED_SUCCESS;
}
 
Example 2
Source File: SyncBuildProcessAdapter.java    From teamcity-deployer-plugin with Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
public BuildFinishedStatus waitFor() throws RunBuildException {
  while (!isInterrupted() && !hasFinished) {
    try {
      Thread.sleep(1000);
    } catch (InterruptedException e) {
      throw new RunBuildException(e);
    }
  }
  return hasFinished ? statusCode : BuildFinishedStatus.INTERRUPTED;
}
 
Example 3
Source File: BuildProcessBase.java    From TeamCity.Virtual with Apache License 2.0 5 votes vote down vote up
@NotNull
public final BuildFinishedStatus waitFor() throws RunBuildException {
  try {
    if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
    BuildFinishedStatus status = waitForImpl();
    if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;

    return status;
  } finally {
    myIsFinished.set(true);
  }
}
 
Example 4
Source File: DelegatingBuildProcess.java    From TeamCity.Virtual with Apache License 2.0 5 votes vote down vote up
@NotNull
@Override
protected final BuildFinishedStatus waitForImpl() throws RunBuildException {
  try {
    final BuildProcess process = myAction.startImpl();
    myReference.set(process);

    if (isInterrupted()) return BuildFinishedStatus.INTERRUPTED;
    process.start();
    return process.waitFor();
  } finally {
    myReference.set(null);
    myAction.finishedImpl();
  }
}