public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, InetSocketAddress bindAddress,URI uri, XnioSsl ssl, UndertowClient client, OptionMap options) { this.connectionPoolManager = connectionPoolManager; this.maxConnections = Math.max(connectionPoolManager.getMaxConnections(), 1); this.maxCachedConnections = Math.max(connectionPoolManager.getMaxCachedConnections(), 0); this.coreCachedConnections = Math.max(connectionPoolManager.getSMaxConnections(), 0); this.timeToLive = connectionPoolManager.getTtl(); this.bindAddress = bindAddress; this.uri = uri; this.ssl = ssl; this.client = client; this.options = options; }
public AvailabilityType available() { if (closed) { return AvailabilityType.CLOSED; } if (!connectionPoolManager.isAvailable()) { return AvailabilityType.PROBLEM; } HostThreadData data = getData(); if (data.connections < maxConnections) { return AvailabilityType.AVAILABLE; } if (!data.availableConnections.isEmpty()) { return AvailabilityType.AVAILABLE; } if (data.awaitingConnections.size() >= connectionPoolManager.getMaxQueueSize()) { return AvailabilityType.FULL_QUEUE; } return AvailabilityType.FULL; }
final int retry = connectionPoolManager.getProblemServerRetry(); if (retry > 0 && !connectionPoolManager.isAvailable()) { WorkerUtils.executeAfter(exchange.getIoThread(), new Runnable() { @Override
@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);
} else { if (data.awaitingConnections.size() >= connectionPoolManager.getMaxQueueSize()) { callback.queuedRequestFailed(exchange); return;
@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);
} else { if (data.awaitingConnections.size() >= connectionPoolManager.getMaxQueueSize()) { callback.queuedRequestFailed(exchange); return;
public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, InetSocketAddress bindAddress,URI uri, XnioSsl ssl, UndertowClient client, OptionMap options) { this.connectionPoolManager = connectionPoolManager; this.maxConnections = Math.max(connectionPoolManager.getMaxConnections(), 1); this.maxCachedConnections = Math.max(connectionPoolManager.getMaxCachedConnections(), 0); this.coreCachedConnections = Math.max(connectionPoolManager.getSMaxConnections(), 0); this.timeToLive = connectionPoolManager.getTtl(); this.bindAddress = bindAddress; this.uri = uri; this.ssl = ssl; this.client = client; this.options = options; }
public AvailabilityType available() { if (closed) { return AvailabilityType.CLOSED; } if (!connectionPoolManager.isAvailable()) { return AvailabilityType.PROBLEM; } HostThreadData data = getData(); if (data.connections < maxConnections) { return AvailabilityType.AVAILABLE; } if (!data.availableConnections.isEmpty()) { return AvailabilityType.AVAILABLE; } if (data.awaitingConnections.size() >= connectionPoolManager.getMaxQueueSize()) { return AvailabilityType.FULL_QUEUE; } return AvailabilityType.FULL; }
final int retry = connectionPoolManager.getProblemServerRetry(); if (retry > 0 && !connectionPoolManager.isAvailable()) { WorkerUtils.executeAfter(exchange.getIoThread(), new Runnable() { @Override
@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);
} else { if (data.awaitingConnections.size() >= connectionPoolManager.getMaxQueueSize()) { callback.queuedRequestFailed(exchange); return;
public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, InetSocketAddress bindAddress,URI uri, XnioSsl ssl, UndertowClient client, OptionMap options) { this.connectionPoolManager = connectionPoolManager; this.maxConnections = Math.max(connectionPoolManager.getMaxConnections(), 1); this.maxCachedConnections = Math.max(connectionPoolManager.getMaxCachedConnections(), 0); this.coreCachedConnections = Math.max(connectionPoolManager.getSMaxConnections(), 0); this.timeToLive = connectionPoolManager.getTtl(); this.bindAddress = bindAddress; this.uri = uri; this.ssl = ssl; this.client = client; this.options = options; }
public AvailabilityType available() { if (closed) { return AvailabilityType.CLOSED; } if (!connectionPoolManager.isAvailable()) { return AvailabilityType.PROBLEM; } HostThreadData data = getData(); if (data.connections < maxConnections) { return AvailabilityType.AVAILABLE; } if (!data.availableConnections.isEmpty()) { return AvailabilityType.AVAILABLE; } if (data.awaitingConnections.size() >= connectionPoolManager.getMaxQueueSize()) { return AvailabilityType.FULL_QUEUE; } return AvailabilityType.FULL; }
final int retry = connectionPoolManager.getProblemServerRetry(); if (retry > 0 && !connectionPoolManager.isAvailable()) { WorkerUtils.executeAfter(exchange.getIoThread(), new Runnable() { @Override