Package io.grpc.internal
Class FixedObjectPool<T>
- java.lang.Object
-
- io.grpc.internal.FixedObjectPool<T>
-
- All Implemented Interfaces:
ObjectPool<T>
public final class FixedObjectPool<T> extends java.lang.Object implements ObjectPool<T>
An object pool that always returns the same instance and does nothing when returning the object.
-
-
Constructor Summary
Constructors Constructor Description FixedObjectPool(T object)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetObject()Get an object from the pool.TreturnObject(java.lang.Object returned)Return the object to the pool.
-
-
-
Field Detail
-
object
private final T object
-
-
Constructor Detail
-
FixedObjectPool
public FixedObjectPool(T object)
-
-
Method Detail
-
getObject
public T getObject()
Description copied from interface:ObjectPoolGet an object from the pool.- Specified by:
getObjectin interfaceObjectPool<T>
-
returnObject
public T returnObject(java.lang.Object returned)
Description copied from interface:ObjectPoolReturn the object to the pool. The caller should not use the object beyond this point.- Specified by:
returnObjectin interfaceObjectPool<T>- Returns:
- always
null
-
-