io.undertow.util

## Class SimpleObjectPool<T>

- java.lang.Object
- - io.undertow.util.SimpleObjectPool<T>

All Implemented Interfaces:
  ObjectPool

    public class SimpleObjectPool<T>
    extends Object
    implements ObjectPool

Simple pool that attempts to maintain a specified number of objects in the pool. If more objects are created new ones are created on the fly, and then destroyed once the pool is full.

Author:
  ckozak, Stuart Douglas

### Constructor Summary

Constructors
Constructor and Description
`SimpleObjectPool(int poolSize, Supplier<T> supplier, Consumer<T> consumer)`
`SimpleObjectPool(int poolSize, Supplier<T> supplier, Consumer<T> recycler, Consumer<T> consumer)`

### Method Summary

All Methods Instance Methods Concrete Methods
`PooledObject<T>` `allocate()`

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

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

### Constructor Detail

#### SimpleObjectPool

    public SimpleObjectPool(int poolSize,
                            Supplier<T> supplier,
                            Consumer<T> recycler,
                            Consumer<T> consumer)

#### SimpleObjectPool

    public SimpleObjectPool(int poolSize,
                            Supplier<T> supplier,
                            Consumer<T> consumer)

### Method Detail

#### allocate

    public PooledObject<T> allocate()

Specified by:
  `allocate` in interface `ObjectPool`