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 T
getObject()
Get an object from the pool.T
returnObject(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:ObjectPool
Get an object from the pool.- Specified by:
getObject
in interfaceObjectPool<T>
-
returnObject
public T returnObject(java.lang.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 interfaceObjectPool<T>
- Returns:
- always
null
-
-