Package org.jppf.utils.pooling
Class SynchronizedDirectBufferPool
java.lang.Object
org.jppf.utils.pooling.AbstractObjectPoolQueue<ByteBuffer>
org.jppf.utils.pooling.SynchronizedDirectBufferPool
- All Implemented Interfaces:
ObjectPool<ByteBuffer>
A ByteBuffer pool backed by a
LinkedList.- 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.protected Queue<ByteBuffer>get()Get an object from the pool, or create it if the pool is empty.voidput(ByteBuffer buffer) Release an object into this pool, and make it available.Methods inherited from class org.jppf.utils.pooling.AbstractObjectPoolQueue
isEmpty, size
-
Constructor Details
-
SynchronizedDirectBufferPool
public SynchronizedDirectBufferPool()
-
-
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.
-
get
Description copied from interface:ObjectPoolGet an object from the pool, or create it if the pool is empty.- Specified by:
getin interfaceObjectPool<ByteBuffer>- Overrides:
getin classAbstractObjectPoolQueue<ByteBuffer>- Returns:
- a new Object of the type handled by this 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.
-
createQueue
- Overrides:
createQueuein classAbstractObjectPoolQueue<ByteBuffer>- Returns:
- the new queue.
-