Class SimpleBufferPool
java.lang.Object
org.apache.activemq.transport.udp.SimpleBufferPool
- All Implemented Interfaces:
Service,ByteBufferPool
- Direct Known Subclasses:
DefaultBufferPool
A simple implementation of
ByteBufferPool which does no pooling and just
creates new buffers each time-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExtract a buffer from the pool.protected ByteBufferbooleanvoidreturnBuffer(ByteBuffer buffer) Returns the buffer to the pool or just discards it for a non-pool strategyvoidsetDefaultSize(int defaultSize) Sets the default size of the buffersvoidsetUseDirect(boolean useDirect) Sets whether direct buffers are used or notvoidstart()voidstop()
-
Constructor Details
-
SimpleBufferPool
public SimpleBufferPool() -
SimpleBufferPool
public SimpleBufferPool(boolean useDirect)
-
-
Method Details
-
borrowBuffer
Description copied from interface:ByteBufferPoolExtract a buffer from the pool.- Specified by:
borrowBufferin interfaceByteBufferPool
-
returnBuffer
Description copied from interface:ByteBufferPoolReturns the buffer to the pool or just discards it for a non-pool strategy- Specified by:
returnBufferin interfaceByteBufferPool
-
setDefaultSize
public void setDefaultSize(int defaultSize) Description copied from interface:ByteBufferPoolSets the default size of the buffers- Specified by:
setDefaultSizein interfaceByteBufferPool
-
isUseDirect
public boolean isUseDirect() -
setUseDirect
public void setUseDirect(boolean useDirect) Sets whether direct buffers are used or not -
start
-
stop
-
createBuffer
-