org.apache.activemq.transport.udp
Class SimpleBufferPool

java.lang.Object
  extended by org.apache.activemq.transport.udp.SimpleBufferPool
All Implemented Interfaces:
Service, ByteBufferPool
Direct Known Subclasses:
DefaultBufferPool

public class SimpleBufferPool
extends Object
implements ByteBufferPool

A simple implementation of BufferPool which does no pooling and just creates new buffers each time


Constructor Summary
SimpleBufferPool()
           
SimpleBufferPool(boolean useDirect)
           
 
Method Summary
 ByteBuffer borrowBuffer()
          Extract a buffer from the pool.
protected  ByteBuffer createBuffer()
           
 boolean isUseDirect()
           
 void returnBuffer(ByteBuffer buffer)
          Returns the buffer to the pool or just discards it for a non-pool strategy
 void setDefaultSize(int defaultSize)
          Sets the default size of the buffers
 void setUseDirect(boolean useDirect)
          Sets whether direct buffers are used or not
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBufferPool

public SimpleBufferPool()

SimpleBufferPool

public SimpleBufferPool(boolean useDirect)
Method Detail

borrowBuffer

public ByteBuffer borrowBuffer()
Description copied from interface: ByteBufferPool
Extract a buffer from the pool.

Specified by:
borrowBuffer in interface ByteBufferPool

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 interface ByteBufferPool

setDefaultSize

public void setDefaultSize(int defaultSize)
Description copied from interface: ByteBufferPool
Sets the default size of the buffers

Specified by:
setDefaultSize in interface ByteBufferPool

isUseDirect

public boolean isUseDirect()

setUseDirect

public void setUseDirect(boolean useDirect)
Sets whether direct buffers are used or not


start

public void start()
           throws Exception
Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface Service
Throws:
Exception

createBuffer

protected ByteBuffer createBuffer()


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.