io.undertow.server.handlers.proxy

## Class ProxyConnectionPool

- java.lang.Object
- - io.undertow.server.handlers.proxy.ProxyConnectionPool

All Implemented Interfaces:
  Closeable, AutoCloseable

    public class ProxyConnectionPool
    extends Object
    implements Closeable

A pool of connections to a target host. This pool can also be used to open connections in exclusive mode, in which case they will not be added to the connection pool. In this case the caller is responsible for closing any connections.

Author:
  Stuart Douglas

### Nested Class Summary

Nested Classes
`static class` `ProxyConnectionPool.AvailabilityType`

### Constructor Summary

Constructors
Constructor and Description
`ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, InetSocketAddress bindAddress, URI uri, UndertowClient client, org.xnio.OptionMap options)`
`ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, InetSocketAddress bindAddress, URI uri, org.xnio.ssl.XnioSsl ssl, UndertowClient client, org.xnio.OptionMap options)`
`ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, URI uri, UndertowClient client, org.xnio.OptionMap options)`
`ProxyConnectionPool(ConnectionPoolManager connectionPoolManager, URI uri, org.xnio.ssl.XnioSsl ssl, UndertowClient client, org.xnio.OptionMap options)`

### Method Summary

All Methods Instance Methods Concrete Methods
`ProxyConnectionPool.AvailabilityType` `available()`
`void` `close()`
`void` `connect(ProxyClient.ProxyTarget proxyTarget, HttpServerExchange exchange, ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit, boolean exclusive)`
`InetSocketAddress` `getBindAddress()`
`ClientStatistics` `getClientStatistics()`
`int` `getOpenConnections()`
`URI` `getUri()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ProxyConnectionPool

    public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager,
                               URI uri,
                               UndertowClient client,
                               org.xnio.OptionMap options)

#### ProxyConnectionPool

    public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager,
                               InetSocketAddress bindAddress,
                               URI uri,
                               UndertowClient client,
                               org.xnio.OptionMap options)

#### ProxyConnectionPool

    public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager,
                               URI uri,
                               org.xnio.ssl.XnioSsl ssl,
                               UndertowClient client,
                               org.xnio.OptionMap options)

#### ProxyConnectionPool

    public ProxyConnectionPool(ConnectionPoolManager connectionPoolManager,
                               InetSocketAddress bindAddress,
                               URI uri,
                               org.xnio.ssl.XnioSsl ssl,
                               UndertowClient client,
                               org.xnio.OptionMap options)

### Method Detail

#### getUri

    public URI getUri()

#### getBindAddress

    public InetSocketAddress getBindAddress()

#### close

    public void close()

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`

#### available

    public ProxyConnectionPool.AvailabilityType available()

#### getClientStatistics

    public ClientStatistics getClientStatistics()

#### getOpenConnections

    public int getOpenConnections()

Returns:
  The total number of open connections

#### connect

    public void connect(ProxyClient.ProxyTarget proxyTarget,
                        HttpServerExchange exchange,
                        ProxyCallback<ProxyConnection> callback,
                        long timeout,
                        TimeUnit timeUnit,
                        boolean exclusive)

Parameters:
  `exclusive` - - Is connection for the exclusive use of one client?