Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.http.impl.nio.pool
Class BasicNIOConnPool

    java.lang.Object
      org.apache.http.nio.pool.AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>
          org.apache.http.impl.nio.pool.BasicNIOConnPool

All Implemented Interfaces:
  ConnPool<HttpHost,BasicNIOPoolEntry>, ConnPoolControl<HttpHost>

    @Contract(threading=SAFE)
    public class BasicNIOConnPool

extends AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>

A very basic `ConnPool` implementation that represents a pool of non-blocking `NHttpClientConnection` connections identified by an `HttpHost` instance. Please note this pool implementation does not support complex routes via a proxy cannot differentiate between direct and proxied connections.

Since:
  4.2
See Also:
  `HttpHost`

Constructor Summary
`BasicNIOConnPool(ConnectingIOReactor ioReactor)`
`BasicNIOConnPool(ConnectingIOReactor ioReactor, ConnectionConfig config)`
`BasicNIOConnPool(ConnectingIOReactor ioReactor, HttpParams params)` Deprecated. (4.3) use `BasicNIOConnPool(ConnectingIOReactor, ConnectionConfig)`
`BasicNIOConnPool(ConnectingIOReactor ioReactor, int connectTimeout, ConnectionConfig config)`
`BasicNIOConnPool(ConnectingIOReactor ioReactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, HttpParams params)` Deprecated. (4.3) use `BasicNIOConnPool(ConnectingIOReactor, NIOConnFactory, int)`
`BasicNIOConnPool(ConnectingIOReactor ioReactor, NIOConnFactory<HttpHost,NHttpClientConnection> connFactory, int connectTimeout)`

Method Summary
`protected BasicNIOPoolEntry` | `createEntry(HttpHost host, NHttpClientConnection conn)`
`Future<BasicNIOPoolEntry>` | `lease(HttpHost route, Object state)`
`Future<BasicNIOPoolEntry>` | `lease(HttpHost route, Object state, FutureCallback<BasicNIOPoolEntry> callback)` Attempts to lease a connection for the given route and with the given state from the pool.
`protected void` | `onLease(BasicNIOPoolEntry entry)`
`protected void` | `onRelease(BasicNIOPoolEntry entry)`
`protected SocketAddress` | `resolveLocalAddress(HttpHost host)` Deprecated. (4.3) use `SocketAddressResolver`
`protected SocketAddress` | `resolveRemoteAddress(HttpHost host)` Deprecated. (4.3) use `SocketAddressResolver`

Methods inherited from class org.apache.http.nio.pool.AbstractNIOConnPool
`closeExpired, closeIdle, enumAvailable, enumEntries, enumLeased, getDefaultMaxPerRoute, getMaxPerRoute, getMaxTotal, getRoutes, getStats, getTotalStats, isShutdown, lease, lease, onReuse, release, requestCancelled, requestCompleted, requestFailed, requestTimeout, setDefaultMaxPerRoute, setMaxPerRoute, setMaxTotal, shutdown, toString, validatePendingRequests`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### BasicNIOConnPool

    @Deprecated
    public BasicNIOConnPool(ConnectingIOReactor ioReactor,
                                       NIOConnFactory<HttpHost,NHttpClientConnection> connFactory,
                                       HttpParams params)

  Deprecated. (4.3) use `BasicNIOConnPool(ConnectingIOReactor, NIOConnFactory, int)`

### BasicNIOConnPool

    @Deprecated
    public BasicNIOConnPool(ConnectingIOReactor ioReactor,
                                       HttpParams params)

  Deprecated. (4.3) use `BasicNIOConnPool(ConnectingIOReactor, ConnectionConfig)`

### BasicNIOConnPool

    public BasicNIOConnPool(ConnectingIOReactor ioReactor,
                            NIOConnFactory<HttpHost,NHttpClientConnection> connFactory,
                            int connectTimeout)

Since:
  4.3

### BasicNIOConnPool

    public BasicNIOConnPool(ConnectingIOReactor ioReactor,
                            int connectTimeout,
                            ConnectionConfig config)

Since:
  4.3

### BasicNIOConnPool

    public BasicNIOConnPool(ConnectingIOReactor ioReactor,
                            ConnectionConfig config)

Since:
  4.3

### BasicNIOConnPool

    public BasicNIOConnPool(ConnectingIOReactor ioReactor)

Since:
  4.3

Method Detail

### resolveRemoteAddress

    @Deprecated
    protected SocketAddress resolveRemoteAddress(HttpHost host)

  Deprecated. (4.3) use `SocketAddressResolver`

  Overrides:
    `resolveRemoteAddress` in class `AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>`

### resolveLocalAddress

    @Deprecated
    protected SocketAddress resolveLocalAddress(HttpHost host)

  Deprecated. (4.3) use `SocketAddressResolver`

  Overrides:
    `resolveLocalAddress` in class `AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>`

### createEntry

    protected BasicNIOPoolEntry createEntry(HttpHost host,
                                            NHttpClientConnection conn)

  Specified by:
    `createEntry` in class `AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>`

### lease

    public Future<BasicNIOPoolEntry> lease(HttpHost route,
                                           Object state,
                                           FutureCallback<BasicNIOPoolEntry> callback)

  Description copied from interface: `ConnPool`
  Attempts to lease a connection for the given route and with the given state from the pool.

  Specified by:
    `lease` in interface `ConnPool<HttpHost,BasicNIOPoolEntry>`
  Overrides:
    `lease` in class `AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>`
  Parameters:
    `route` - route of the connection.
    `state` - arbitrary object that represents a particular state (usually a security principal or a unique token identifying the user whose credentials have been used while establishing the connection). May be `null`.
    `callback` - operation completion callback.
  Returns:
    future for a leased pool entry.

### lease

    public Future<BasicNIOPoolEntry> lease(HttpHost route,
                                           Object state)

  Overrides:
    `lease` in class `AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>`

### onLease

    protected void onLease(BasicNIOPoolEntry entry)

  Overrides:
    `onLease` in class `AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>`

### onRelease

    protected void onRelease(BasicNIOPoolEntry entry)

  Overrides:
    `onRelease` in class `AbstractNIOConnPool<HttpHost,NHttpClientConnection,BasicNIOPoolEntry>`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.