Package org.jppf.utils.pooling
Class DirectBufferPoolQueue
java.lang.Object
org.jppf.utils.pooling.AbstractObjectPoolQueue<ByteBuffer>
org.jppf.utils.pooling.DirectBufferPoolQueue
- All Implemented Interfaces:
ObjectPool<ByteBuffer>
A ByteBuffer pool backed by a
ConcurrentLinkedQueue.- Author:
- Laurent Cohen
-
Field Summary
Fields inherited from class org.jppf.utils.pooling.AbstractObjectPoolQueue
queue -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ByteBuffercreate()Create a new object for the pool.init(int size) Initialize with size buffers.voidput(ByteBuffer buffer) Release an object into this pool, and make it available.Methods inherited from class org.jppf.utils.pooling.AbstractObjectPoolQueue
createQueue, get, isEmpty, size
-
Constructor Details
-
DirectBufferPoolQueue
public DirectBufferPoolQueue()
-
-
Method Details
-
create
Description copied from class:AbstractObjectPoolQueueCreate a new object for the pool.- Specified by:
createin classAbstractObjectPoolQueue<ByteBuffer>- Returns:
- an object that can be returned to the pool.
-
put
Description copied from interface:ObjectPoolRelease an object into this pool, and make it available.- Specified by:
putin interfaceObjectPool<ByteBuffer>- Overrides:
putin classAbstractObjectPoolQueue<ByteBuffer>- Parameters:
buffer- the object to release.
-
init
Initialize with size buffers.- Parameters:
size- the number of buffers to create.- Returns:
- this pool.
-