public long getTimeout() { return context.getTimeout(); }
@Override public long getTimeout() { return this.delegate.getTimeout(); } }
@Override public Object getAsyncResult(long timeToWait) { if (this.mockRequest.getAsyncContext() != null && timeToWait == -1) { long requestTimeout = this.mockRequest.getAsyncContext().getTimeout(); timeToWait = requestTimeout == -1 ? Long.MAX_VALUE : requestTimeout; } if (!awaitAsyncDispatch(timeToWait)) { throw new IllegalStateException("Async result for handler [" + this.handler + "]" + " was not set during the specified timeToWait=" + timeToWait); } Object result = this.asyncResult.get(); Assert.state(result != RESULT_NONE, () -> "Async result for handler [" + this.handler + "] was not set"); return this.asyncResult.get(); }
@Override public void onTimeout(AsyncEvent e) { if (complete) return; span.tag("error", String.format("Timed out after %sms", e.getAsyncContext().getTimeout())); handler.handleSend(adaptResponse(e), null, span); complete = true; }
public boolean suspend(long timeout) { if (isPending && timeout != 0) { long currentTimeout = context.getTimeout(); timeout = currentTimeout + timeout; } else { isPending = true; } isNew = false; isResumed = false; context.setTimeout(timeout); updateMessageForSuspend(); return true; } protected void updateMessageForSuspend() {
@Override public long getTimeout() { return delegate.getTimeout(); } }
@Override public long getTimeout() { return actx.getTimeout(); }
@Override public long getTimeout() { return asyncContext.getTimeout(); }
@Override public long getTimeout() { return delegate.getTimeout(); }
@Override public long getTimeout() { return this.asyncContext.getTimeout(); }
@Override public long getTimeout() { return wrappedInstance.getTimeout(); }
@Override public void onTimeout(AsyncEvent event) throws IOException { LOGGER.warn("asyn request timeout: {}", event.getAsyncContext().getTimeout()); }
@Override public long getTimeout() { return getAsyncContext().getTimeout(); }
@Override public Object getAsyncResult(long timeToWait) { if (this.mockRequest.getAsyncContext() != null && timeToWait == -1) { long requestTimeout = this.mockRequest.getAsyncContext().getTimeout(); timeToWait = requestTimeout == -1 ? Long.MAX_VALUE : requestTimeout; } if (!awaitAsyncDispatch(timeToWait)) { throw new IllegalStateException("Async result for handler [" + this.handler + "]" + " was not set during the specified timeToWait=" + timeToWait); } Object result = this.asyncResult.get(); Assert.state(result != RESULT_NONE, () -> "Async result for handler [" + this.handler + "] was not set"); return this.asyncResult.get(); }
@Override public Object getAsyncResult(long timeToWait) { if (this.mockRequest.getAsyncContext() != null) { timeToWait = (timeToWait == -1 ? this.mockRequest.getAsyncContext().getTimeout() : timeToWait); } if (!awaitAsyncDispatch(timeToWait)) { throw new IllegalStateException("Async result for handler [" + this.handler + "]" + " was not set during the specified timeToWait=" + timeToWait); } Object result = this.asyncResult.get(); if (result == RESULT_NONE) { throw new IllegalStateException("Async result for handler [" + this.handler + "] was not set"); } return this.asyncResult.get(); }
public boolean suspend(long timeout) { if (isPending && timeout != 0) { long currentTimeout = context.getTimeout(); timeout = currentTimeout + timeout; } else { isPending = true; } isNew = false; isResumed = false; context.setTimeout(timeout); updateMessageForSuspend(); return true; } protected void updateMessageForSuspend() {
@Override public void onTimeout(AsyncEvent event) throws IOException { HttpServletRequest httpRequest = (HttpServletRequest) event.getSuppliedRequest(); HttpServletResponse httpResponse = (HttpServletResponse) event.getSuppliedResponse(); for (ServletFilterSpanDecorator spanDecorator : spanDecorators) { spanDecorator.onTimeout(httpRequest, httpResponse, event.getAsyncContext().getTimeout(), scope.span()); } }
public boolean suspend(long timeout) { if (isPending && timeout != 0) { long currentTimeout = context.getTimeout(); timeout = currentTimeout + timeout; } else { isPending = true; } isNew = false; isResumed = false; context.setTimeout(timeout); if (PhaseInterceptorChain.getCurrentMessage() == null) { // the current thread is different to the one which holds a lock on PhaseInterceptorChain inMessage.getExchange().put(Message.SUSPENDED_INVOCATION, true); } else { // Need to get the right message which is handled in the interceptor chain inMessage.getExchange().getInMessage().getInterceptorChain().suspend(); } return true; } public void redispatch() {