Class ObjectPool<T>


  • public abstract class ObjectPool<T>
    extends java.lang.Object
    Object pool. Thread-safe with exception of unit-test-only methods marked otherwise.
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectPool​(int initialCapacity)  
      ObjectPool​(int initialCapacity, int limitCapacity)  
    • Constructor Detail

      • ObjectPool

        public ObjectPool​(int initialCapacity)
      • ObjectPool

        public ObjectPool​(int initialCapacity,
                          int limitCapacity)
    • Method Detail

      • borrow

        public final T borrow()
      • newItem

        protected abstract T newItem()
      • release

        public final boolean release​(T msg)
      • trim

        public final void trim()