Class DefaultBufferPool
- java.lang.Object
-
- org.apache.activemq.transport.udp.SimpleBufferPool
-
- org.apache.activemq.transport.udp.DefaultBufferPool
-
- All Implemented Interfaces:
Service
,ByteBufferPool
public class DefaultBufferPool extends SimpleBufferPool implements ByteBufferPool
A default implementation ofSimpleBufferPool
which keeps a pool of direct byte buffers.
-
-
Constructor Summary
Constructors Constructor Description DefaultBufferPool()
DefaultBufferPool(boolean useDirect)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ByteBuffer
borrowBuffer()
Extract a buffer from the pool.void
returnBuffer(ByteBuffer buffer)
Returns the buffer to the pool or just discards it for a non-pool strategyvoid
start()
void
stop()
-
Methods inherited from class org.apache.activemq.transport.udp.SimpleBufferPool
createBuffer, isUseDirect, setDefaultSize, setUseDirect
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.transport.udp.ByteBufferPool
setDefaultSize
-
-
-
-
Method Detail
-
borrowBuffer
public ByteBuffer borrowBuffer()
Description copied from interface:ByteBufferPool
Extract a buffer from the pool.- Specified by:
borrowBuffer
in interfaceByteBufferPool
- Overrides:
borrowBuffer
in classSimpleBufferPool
-
returnBuffer
public void returnBuffer(ByteBuffer buffer)
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
- Overrides:
returnBuffer
in classSimpleBufferPool
-
start
public void start() throws Exception
- Specified by:
start
in interfaceService
- Overrides:
start
in classSimpleBufferPool
- Throws:
Exception
-
-