org.vertx.java.core.impl

## Class ConnectionPool<T>

- java.lang.Object
- - org.vertx.java.core.impl.ConnectionPool<T>

    public abstract class ConnectionPool<T>
    extends java.lang.Object

A simple, non-blocking pool implementation

### Constructor Summary

Constructors
Constructor and Description
`ConnectionPool()`

### Method Summary

Methods
`void` `close()` Close the pool
`protected abstract void` `connect(Handler<T> connectHandler, Context context)` Implement this method in a sub-class to implement the actual connection creation for the specific type of connection
`void` `connectionClosed()` Inform the pool that the connection has been closed externally.
`void` `getConnection(Handler<T> handler, Context context)`
`int` `getMaxPoolSize()` Returns the maximum number of connections in the pool
`void` `report()`
`void` `returnConnection(T conn)` Return a connection to the pool so it can be used by others.
`void` `setMaxPoolSize(int maxConnections)` Set the maximum pool size to the value specified by `maxConnections`

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

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

### Constructor Detail

#### ConnectionPool

    public ConnectionPool()

### Method Detail

#### setMaxPoolSize

    public void setMaxPoolSize(int maxConnections)

Set the maximum pool size to the value specified by `maxConnections`

The client will maintain up to `maxConnections` HTTP connections in an internal pool

#### getMaxPoolSize

    public int getMaxPoolSize()

Returns the maximum number of connections in the pool

#### report

    public void report()

#### getConnection

    public void getConnection(Handler<T> handler,
                     Context context)

#### connectionClosed

    public void connectionClosed()

Inform the pool that the connection has been closed externally.

#### returnConnection

    public void returnConnection(T conn)

Return a connection to the pool so it can be used by others.

#### close

    public void close()

Close the pool

#### connect

    protected abstract void connect(Handler<T> connectHandler,
               Context context)

Implement this method in a sub-class to implement the actual connection creation for the specific type of connection