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 ofSimpleBufferPoolwhich 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 ByteBufferborrowBuffer()Extract a buffer from the pool.voidreturnBuffer(ByteBuffer buffer)Returns the buffer to the pool or just discards it for a non-pool strategyvoidstart()voidstop()-
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:ByteBufferPoolExtract a buffer from the pool.- Specified by:
borrowBufferin interfaceByteBufferPool- Overrides:
borrowBufferin classSimpleBufferPool
-
returnBuffer
public void returnBuffer(ByteBuffer buffer)
Description copied from interface:ByteBufferPoolReturns the buffer to the pool or just discards it for a non-pool strategy- Specified by:
returnBufferin interfaceByteBufferPool- Overrides:
returnBufferin classSimpleBufferPool
-
start
public void start() throws Exception- Specified by:
startin interfaceService- Overrides:
startin classSimpleBufferPool- Throws:
Exception
-
-