Class SimpleObjectPool<T>

  • All Implemented Interfaces:
    ObjectPool

    public class SimpleObjectPool<T>
    extends java.lang.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 Description
      SimpleObjectPool​(int poolSize, java.util.function.Supplier<T> supplier, java.util.function.Consumer<T> consumer)  
      SimpleObjectPool​(int poolSize, java.util.function.Supplier<T> supplier, java.util.function.Consumer<T> recycler, java.util.function.Consumer<T> consumer)  
    • Constructor Detail

      • SimpleObjectPool

        public SimpleObjectPool​(int poolSize,
                                java.util.function.Supplier<T> supplier,
                                java.util.function.Consumer<T> recycler,
                                java.util.function.Consumer<T> consumer)
      • SimpleObjectPool

        public SimpleObjectPool​(int poolSize,
                                java.util.function.Supplier<T> supplier,
                                java.util.function.Consumer<T> consumer)