Class ObjectPool<T>

java.lang.Object
org.qiunet.utils.pool.ObjectPool<T>

public abstract class ObjectPool<T> extends Object
一个简单的对象池
Author:
qiunet 2022/8/15 15:29
  • Constructor Details

    • ObjectPool

      public ObjectPool()
    • ObjectPool

      public ObjectPool(int maxCapacity, int queueCapacityForPerThread)
  • Method Details

    • newObject

      protected abstract T newObject(ObjectPool.Handle<T> handler)
      为池构造一个新的对象
      Parameters:
      handler -
      Returns:
    • threadScopeSize

      public int threadScopeSize()
      线程域的size
      Returns:
    • threadScopeStackSize

      public int threadScopeStackSize()
      线程域的 stack size
      Returns:
    • asyncThreadRecycleSize

      public int asyncThreadRecycleSize()
      其它线程回收数
      Returns:
    • get

      public T get()
      获得对象
      Returns: