org.apache.activemq.transport.udp
Class DefaultBufferPool

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

public class DefaultBufferPool
extends SimpleBufferPool
implements ByteBufferPool

A default implementation of BufferPool which keeps a pool of direct byte buffers.


Constructor Summary
DefaultBufferPool()
           
DefaultBufferPool(boolean useDirect)
           
 
Method Summary
 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 strategy
 void 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
 

Constructor Detail

DefaultBufferPool

public DefaultBufferPool()

DefaultBufferPool

public DefaultBufferPool(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
Overrides:
borrowBuffer in class SimpleBufferPool

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
Overrides:
returnBuffer in class SimpleBufferPool

start

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

stop

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


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