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
-
Method Summary
Modifier and TypeMethodDescriptionExtract a buffer from the pool.protected ByteBuffer
boolean
void
returnBuffer
(ByteBuffer buffer) Returns the buffer to the pool or just discards it for a non-pool strategyvoid
setDefaultSize
(int defaultSize) Sets the default size of the buffersvoid
setUseDirect
(boolean useDirect) Sets whether direct buffers are used or notvoid
start()
void
stop()
-
Constructor Details
-
SimpleBufferPool
public SimpleBufferPool() -
SimpleBufferPool
public SimpleBufferPool(boolean useDirect)
-
-
Method Details
-
borrowBuffer
Description copied from interface:ByteBufferPool
Extract a buffer from the pool.- Specified by:
borrowBuffer
in interfaceByteBufferPool
-
returnBuffer
Description copied from interface:ByteBufferPool
Returns the buffer to the pool or just discards it for a non-pool strategy- Specified by:
returnBuffer
in interfaceByteBufferPool
-
setDefaultSize
public void setDefaultSize(int defaultSize) Description copied from interface:ByteBufferPool
Sets the default size of the buffers- Specified by:
setDefaultSize
in interfaceByteBufferPool
-
isUseDirect
public boolean isUseDirect() -
setUseDirect
public void setUseDirect(boolean useDirect) Sets whether direct buffers are used or not -
start
-
stop
-
createBuffer
-