@Override public void failed(IOException e) { callback.failed(exchange); } }
@Override public void run() { cancelled = true; callback.failed(exchange); }
@Override public void failed(HttpServerExchange exchange) { callback.failed(exchange); }
private void redistributeQueued(HostThreadData hostData) { CallbackHolder callback = hostData.awaitingConnections.poll(); while (callback != null) { if (callback.getTimeoutKey() != null) { callback.getTimeoutKey().remove(); } if (!callback.isCancelled()) { long time = System.currentTimeMillis(); if (callback.getExpireTime() > 0 && callback.getExpireTime() < time) { callback.getCallback().failed(callback.getExchange()); } else { callback.getCallback().queuedRequestFailed(callback.getExchange()); } } callback = hostData.awaitingConnections.poll(); } }
@Override public void failed(HttpServerExchange exchange) { UndertowLogger.PROXY_REQUEST_LOGGER.proxyFailedToConnectToBackend(exchange.getRequestURI(), host.uri); callback.failed(exchange); }
@Override public void failed(IOException e) { if (!exclusive) { data.connections--; } UndertowLogger.REQUEST_LOGGER.debug("Failed to connect", e); if (!connectionPoolManager.handleError()) { redistributeQueued(getData()); scheduleFailedHostRetry(exchange); } callback.failed(exchange); } }, bindAddress, getUri(), exchange.getIoThread(), ssl, exchange.getConnection().getByteBufferPool(), options);
private void connectionReady(final ConnectionHolder result, final ProxyCallback<ProxyConnection> callback, final HttpServerExchange exchange, final boolean exclusive) { try { exchange.addExchangeCompleteListener(new ExchangeCompletionListener() { @Override public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener) { if (!exclusive) { returnConnection(result); } nextListener.proceed(); } }); } catch (Exception e) { returnConnection(result); callback.failed(exchange); return; } callback.completed(exchange, new ProxyConnection(result.clientConnection, uri.getPath() == null ? "/" : uri.getPath())); }
/** * Handle a proxy request for this context. * * @param target the proxy target * @param exchange the http server exchange * @param callback the proxy callback * @param timeout the timeout * @param timeUnit the time unit * @param exclusive whether this connection is exclusive */ void handleRequest(final ModClusterProxyTarget target, final HttpServerExchange exchange, final ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit, boolean exclusive) { if (addRequest()) { exchange.addExchangeCompleteListener(new ExchangeCompletionListener() { @Override public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener) { requestDone(); nextListener.proceed(); } }); node.getConnectionPool().connect(target, exchange, callback, timeout, timeUnit, exclusive); } else { callback.failed(exchange); } }
@Override public void run() { cancelled = true; callback.failed(exchange); }
@Override public void failed(IOException e) { callback.failed(exchange); } }
@Override public void failed(HttpServerExchange exchange) { callback.failed(exchange); }
@Override public void run() { cancelled = true; callback.failed(exchange); }
@Override public void failed(IOException e) { callback.failed(exchange); } }
@Override public void failed(HttpServerExchange exchange) { callback.failed(exchange); }
@Override public void failed(HttpServerExchange exchange) { UndertowLogger.PROXY_REQUEST_LOGGER.proxyFailedToConnectToBackend(exchange.getRequestURI(), host.uri); callback.failed(exchange); }
@Override public void failed(HttpServerExchange exchange) { UndertowLogger.PROXY_REQUEST_LOGGER.proxyFailedToConnectToBackend(exchange.getRequestURI(), host.uri); callback.failed(exchange); }
@Override public void failed(IOException e) { if (!exclusive) { data.connections--; } UndertowLogger.REQUEST_LOGGER.debug("Failed to connect", e); if (!connectionPoolManager.handleError()) { redistributeQueued(getData()); scheduleFailedHostRetry(exchange); } callback.failed(exchange); } }, bindAddress, getUri(), exchange.getIoThread(), ssl, exchange.getConnection().getByteBufferPool(), options);
@Override public void failed(IOException e) { if (!exclusive) { data.connections--; } UndertowLogger.REQUEST_LOGGER.debug("Failed to connect", e); if (!connectionPoolManager.handleError()) { redistributeQueued(getData()); scheduleFailedHostRetry(exchange); } callback.failed(exchange); } }, bindAddress, getUri(), exchange.getIoThread(), ssl, exchange.getConnection().getByteBufferPool(), options);
@Override public void failed(HttpServerExchange httpServerExchange) { try { adminHandler.removeUnavailableServer(client.getUri()); } finally { callback.failed(exchange); client.clear(); } }
@Override public void failed(HttpServerExchange httpServerExchange) { try { adminHandler.removeUnavailableServer(client.getUri()); } finally { callback.failed(exchange); client.clear(); } }