Class FixedObjectPool<T>

java.lang.Object
io.grpc.internal.FixedObjectPool<T>
All Implemented Interfaces:
ObjectPool<T>

public final class FixedObjectPool<T> extends Object implements ObjectPool<T>
An object pool that always returns the same instance and does nothing when returning the object.
  • Constructor Details

    • FixedObjectPool

      public FixedObjectPool(T object)
  • Method Details

    • getObject

      public T getObject()
      Description copied from interface: ObjectPool
      Get an object from the pool.
      Specified by:
      getObject in interface ObjectPool<T>
    • returnObject

      public T returnObject(Object returned)
      Description copied from interface: ObjectPool
      Return the object to the pool. The caller should not use the object beyond this point.
      Specified by:
      returnObject in interface ObjectPool<T>
      Returns:
      always null