| Modifier and Type | Class and Description |
|---|---|
| public abstract static class |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public T |
| recycle | back to summary |
|---|---|
| public void recycle(T t) Returns an object back to the pool.
| |
| take | back to summary |
|---|---|
| public T take() Gets a new object from the pool. If no object is available in the pool, this method creates a new one.
| |
ConcurrentLinkedQueue
as the data store.
Don't rely on the fact that this class extends from ConcurrentLinkedQueue.
| Modifier and Type | Field and Description |
|---|---|
| private volatile WeakReference |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract T | |
| private ConcurrentLinkedQueue | |
| public final void | recycle(T
object to put back to the pool t)Implements com. Returns an object back to the pool. |
| public final T | Returns: always non-null.Implements com. Gets a new object from the pool. |
| queue | back to summary |
|---|---|
| private volatile WeakReference<ConcurrentLinkedQueue<T>> queue | |
| Impl | back to summary |
|---|---|
| protected Impl() Create new Impl | |
| create | back to summary |
|---|---|
| protected abstract T create() Creates a new instance of object.
This method is used when someone wants to
Also note that multiple threads may call this method concurrently.
| |
| getQueue | back to summary |
|---|---|
| private ConcurrentLinkedQueue | |
| recycle | back to summary |
|---|---|
| public final void recycle(T t) Implements com. Returns an object back to the pool.
| |
| take | back to summary |
|---|---|
| public final T take() Implements com. Gets a new object from the pool. If no object is available in the pool, this method creates a new one. | |