class BufferPoolImpl extends java.lang.Object implements BufferPool
| Modifier and Type | Field and Description |
|---|---|
private java.lang.ref.WeakReference<java.util.concurrent.ConcurrentLinkedQueue<char[]>> |
queue |
| Constructor and Description |
|---|
BufferPoolImpl() |
| Modifier and Type | Method and Description |
|---|---|
private java.util.concurrent.ConcurrentLinkedQueue<char[]> |
getQueue() |
void |
recycle(char[] t)
Returns an object back to the pool.
|
char[] |
take()
Gets a new object from the pool.
|
private volatile java.lang.ref.WeakReference<java.util.concurrent.ConcurrentLinkedQueue<char[]>> queue
public final char[] take()
If no object is available in the pool, this method creates a new one.
take in interface BufferPoolprivate java.util.concurrent.ConcurrentLinkedQueue<char[]> getQueue()
public final void recycle(char[] t)
recycle in interface BufferPool