Search in sources :

Example 16 with RuntimeStartInterruptedException

use of org.eclipse.che.api.workspace.server.spi.RuntimeStartInterruptedException in project devspaces-images by redhat-developer.

the class StartSynchronizer method interrupt.

/**
 * Interrupts workspace start if it is in progress and is not interrupted yet
 *
 * @return true if workspace start is interrupted, false otherwise
 */
public synchronized boolean interrupt() {
    if (!isStarting) {
        return false;
    }
    startFailure.completeExceptionally(new RuntimeStartInterruptedException(runtimeId));
    if (startThread != null) {
        startThread.interrupt();
        // set to not to interrupt twice
        startThread = null;
    }
    return true;
}
Also used : RuntimeStartInterruptedException(org.eclipse.che.api.workspace.server.spi.RuntimeStartInterruptedException)

Aggregations

RuntimeStartInterruptedException (org.eclipse.che.api.workspace.server.spi.RuntimeStartInterruptedException)16 Test (org.testng.annotations.Test)10 InfrastructureException (org.eclipse.che.api.workspace.server.spi.InfrastructureException)6 InternalInfrastructureException (org.eclipse.che.api.workspace.server.spi.InternalInfrastructureException)6 CompletableFuture (java.util.concurrent.CompletableFuture)4 ExecutionException (java.util.concurrent.ExecutionException)4 TimeoutException (java.util.concurrent.TimeoutException)4 Scope (io.opentracing.Scope)2 Span (io.opentracing.Span)2 LinkedHashMap (java.util.LinkedHashMap)2 CompletionException (java.util.concurrent.CompletionException)2 CopyOnWriteArrayList (java.util.concurrent.CopyOnWriteArrayList)2 ValidationException (org.eclipse.che.api.core.ValidationException)2 StateException (org.eclipse.che.api.workspace.server.spi.StateException)2 EnvironmentContext (org.eclipse.che.commons.env.EnvironmentContext)2 KubernetesMachineImpl (org.eclipse.che.workspace.infrastructure.kubernetes.model.KubernetesMachineImpl)2