Wait for and then return the response HTTP status code.

@return HTTP status code of the response
@throws InterruptedException if interrupted while awaiting the response
@throws BOSHException on communication failure
432645
public int getHTTPStatus() throws InterruptedException, BOSHException {
        if (toThrow != null) {
            throw(toThrow);
        }
        lock.lock();
        try {
            if (!sent) {
                awaitResponse();
            }
        } finally {
            lock.unlock();
        }
        return statusCode;
    }
1318359
public boolean waitForWithOptions() throws InterruptedException {
    try {
      // [START ]
      Job completedJob =
          job.waitFor(
              RetryOption.initialRetryDelay(Duration.ofSeconds(1)),
              RetryOption.totalTimeout(Duration.ofMinutes(1)));
      if (completedJob == null) {
        // job no longer exists
      } else if (completedJob.getStatus().getError() != null) {
        // job failed, handle error
      } else {
        // job completed successfully
      }
      // [END ]
    } catch (BigQueryException e) {
      if (e.getCause() instanceof PollException) {
        return false;
      }
      throw e;
    }
    return true;
  }
1312911
public ReturnCode shutdown() throws InterruptedException {
        delegateCreated.await();
        // If we have a delegate, call shutdown to stop the server
        if (launcherDelegate != null && launcherDelegate.shutdown()) {
            // if shutdown stopped the server, we need to wait until we can obtain
            // the server lock (the serverLock is released in the finally block of
            // the go() method.. )
            return serverLock.waitForStop();
        }

        // Server did not propertly start (no delegate), so stop is fine.
        return ReturnCode.OK;
    }
992544
public synchronized void waitOnIgnoringInterruptions()
   {
      if (tc.isEntryEnabled()) SibTr.entry(tc, "waitOnIgnoringInterruptions");

      boolean interrupted;
      do
      {
         interrupted = false;
         try
         {
            waitOn();
         }
         catch (InterruptedException e)
         {
            // No FFDC code needed
            interrupted = true;
         }
      }
      while(interrupted);

      if (tc.isEntryEnabled()) SibTr.exit(tc, "waitOnIgnoringInterruptions");
   }
1232135
public T sync() {
        //if data is present there's no need to block
        if (data != null) {
            return data;
        }
        synchronized (this) {
            try {
                // wait();
                block.take();
            } catch (InterruptedException e) {
                if (interruptCause == null) {
                    interruptCause = e;
                }
            }
            if (interruptCause != null) {
                if (interruptCause instanceof DataSiftException) {
                    throw (DataSiftException) interruptCause;
                } else {
                    throw new DataSiftException("Interrupted while waiting for response", interruptCause);
                }
            }
            return data;
        }
    }
306192
public HttpStatus getStatusCode() {
        final Object statusCode = getHeader(HttpMessageHeaders.HTTP_STATUS_CODE);

        if (statusCode != null) {
            if (statusCode instanceof HttpStatus) {
                return (HttpStatus) statusCode;
            } else if (statusCode instanceof Integer) {
                return HttpStatus.valueOf((Integer) statusCode);
            } else {
                return HttpStatus.valueOf(Integer.valueOf(statusCode.toString()));
            }
        }

        return null;
    }
504780
public String responseMessage() {
        try {
            connect();
            return connection.getResponseMessage();
        } catch (Exception e) {
            throw new HttpException("Failed URL: " + url, e);
        }
    }
748599
public T take() throws InterruptedException {
        lock.lock();
        try {
            while(count == 0)
                not_empty.await();
            T el=buf[ri];
            buf[ri]=null;
            if(++ri == buf.length)
                ri=0;
            count--;
            not_full.signal();
            return el;
        }
        finally {
            lock.unlock();
        }
    }
1126510
private byte[] waitForResponse(int minASDULen, int maxASDULen, long timeout)
		throws KNXInvalidResponseException, KNXTimeoutException
	{
		long remaining = timeout;
		final long end = System.currentTimeMillis() + remaining;
		synchronized (indications) {
			while (remaining > 0) {
				try {
					while (indications.size() > 0) {
						final CEMI frame =
							((FrameEvent) indications.remove(0)).getFrame();
						final byte[] apdu = frame.getPayload();
						assert svcResponse == DataUnitBuilder.getAPDUService(apdu);
						if (apdu.length < minASDULen + 2 || apdu.length > maxASDULen + 2) {
							final String s = "invalid ASDU response length "
								+ (apdu.length - 2) + " bytes, expected " + minASDULen
								+ " to " + maxASDULen;
							logger.error("received response with " + s);
							throw new KNXInvalidResponseException(s);
						}
						if (svcResponse == IND_ADDR_RESPONSE
							|| svcResponse == IND_ADDR_SN_RESPONSE)
							return ((CEMILData) frame).getSource().toByteArray();
						indications.clear();
						return apdu;
					}
					indications.wait(remaining);
				}
				catch (final InterruptedException e) {}
				remaining = end - System.currentTimeMillis();
			}
		}
		throw new KNXTimeoutException("timeout occurred while waiting for data response");
	}
402827
private Object waitingGet(boolean interruptible) {
        Signaller q = null;
        boolean queued = false;
        int spins = SPINS;
        Object r;
        while ((r = result) == null) {
            if (spins > 0) {
                if (ThreadLocalRandom.nextSecondarySeed() >= 0)
                    --spins;
            }
            else if (q == null)
                q = new Signaller(interruptible, 0L, 0L);
            else if (!queued)
                queued = tryPushStack(q);
            else {
                try {
                    ForkJoinPool.managedBlock(q);
                } catch (InterruptedException ie) { // currently cannot happen
                    q.interrupted = true;
                }
                if (q.interrupted && interruptible)
                    break;
            }
        }
        if (q != null) {
            q.thread = null;
            if (q.interrupted) {
                if (interruptible)
                    cleanStack();
                else
                    Thread.currentThread().interrupt();
            }
        }
        if (r != null)
            postComplete();
        return r;
    }
1156974
function () {
                if (headerResponse !== null) {
                    return headerResponse;
                }
                // Read status and normalize an IE9 bug (http://bugs.jquery.com/ticket/1450).
                var status = xhr.status === 1223 ? 204 : xhr.status;
                var statusText = xhr.statusText || 'OK';
                // Parse headers from XMLHttpRequest - this step is lazy.
                var headers = new HttpHeaders(xhr.getAllResponseHeaders());
                // Read the response URL from the XMLHttpResponse instance and fall back on the
                // request URL.
                var url = getResponseUrl(xhr) || req.url;
                // Construct the HttpHeaderResponse and memoize it.
                headerResponse = new HttpHeaderResponse({ headers: headers, status: status, statusText: statusText, url: url });
                return headerResponse;
            }
148681
public void waitForCompletion() throws InterruptedException {
        try {
            waitForCompletion(0L);
        } catch (AsyncTimeoutException ate) {
            // cannot happen since arg of 0L means wait forever
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Unexpected timeout on blocking wait call, exception: " + ate.getMessage());
            }
            FFDCFilter.processException(ate,
                                        getClass().getName() + ".waitForCompletion", "268", this);
            InterruptedException ie = new InterruptedException("Unexpected timeout");
            ie.initCause(ate);
            throw ie;
        }
    }
1044329
private S waitForCompletionAndThrowIfUploadFailed() throws IOException {
    try {
      return uploadOperation.get();
    } catch (InterruptedException e) {
      // If we were interrupted, we need to cancel the upload operation.
      uploadOperation.cancel(true);
      IOException exception = new ClosedByInterruptException();
      exception.addSuppressed(e);
      throw exception;
    } catch (ExecutionException e) {
      if (e.getCause() instanceof Error) {
        throw (Error) e.getCause();
      }
      throw new IOException("Upload failed", e.getCause());
    }
  }
83430
private byte[] waitForResponse(final IndividualAddress from, final int minAsduLen, final int maxAsduLen,
		final long timeout, final Optional<List<IndividualAddress>> responders)
			throws KNXInvalidResponseException, KNXTimeoutException, InterruptedException
	{
		long remaining = timeout;
		final long end = System.currentTimeMillis() + remaining;
		synchronized (indications) {
			while (remaining > 0) {
				while (indications.size() > 0) {
					final CEMI frame = indications.remove().getFrame();
					final byte[] apdu = frame.getPayload();
					if (svcResponse != DataUnitBuilder.getAPDUService(apdu))
						continue;
					// broadcasts set parameter from to null; we then accept every sender address
					if (from != null) {
						if (!((CEMILData) frame).getSource().equals(from))
							continue;
					}
					if (apdu.length < minAsduLen + 2 || apdu.length > maxAsduLen + 2) {
						final String s = "invalid ASDU response length " + (apdu.length - 2)
								+ " bytes, expected " + minAsduLen + " to " + maxAsduLen;
						logger.error("received response with " + s);
						throw new KNXInvalidResponseException(s);
					}
					if (svcResponse == IND_ADDR_RESPONSE || svcResponse == IND_ADDR_SN_RESPONSE)
						return ((CEMILData) frame).getSource().toByteArray();
					indications.clear();
					responders.ifPresent((l) -> l.add(((CEMILData) frame).getSource()));
					return apdu;
				}
				indications.wait(remaining);
				remaining = end - System.currentTimeMillis();
			}
		}
		throw new KNXTimeoutException("timeout occurred while waiting for data response");
	}
839519
public JsonObject sendQuery(FutureAPIResponse response)
      throws ExecutionException, InterruptedException, IOException {
    int status = response.get().getStatus();
    String message = response.get().getMessage();

    if (status != HTTP_OK) {
      throw new IOException(status + " " + message);
    }
    return ((JsonObject) parser.parse(message));
  }
805801
public void waitForData() throws InterruptedException {
        try {
            if (registryRemote == null) {
                waitForValue();
                return;
            }
            getRegistryRemote().waitForData();
        } catch (CouldNotPerformException ex) {
            ExceptionPrinter.printHistory("Could not wait until " + getName() + " is ready!", ex, logger);
        }
    }
324510
@Override
    public Message call() throws InterruptedException {
        AbstractExpectation.LOGGER.info("Thread blocked waiting for message to pass condition {}.",
                this.getBlockingCondition());
        try {
            this.latch.await();
            this.manager.unsetExpectation(this);
            AbstractExpectation.LOGGER.info("Condition passed.");
            if (this.actionFuture != null) {
                this.waitUntilActionComplete();
            }
            AbstractExpectation.LOGGER.info("Expectation processing passed.");
            return this.stash;
        } finally {
            this.manager.unsetExpectation(this); // in case await() throws
            this.actionFuture = null;
            AbstractExpectation.LOGGER.info("Thread unblocked.");
        }
    }