ariba.util.core
Class ByteBufferPool

java.lang.Object
  extended by ariba.util.core.SelfCleaningPool<T>
      extended by ariba.util.core.BufferPool<java.nio.ByteBuffer>
          extended by ariba.util.core.ByteBufferPool
All Implemented Interfaces:
Target

public class ByteBufferPool
extends BufferPool<java.nio.ByteBuffer>

This class implements a self cleaning pool of ByteBuffers, each wrapped around a byte array of the configured buffer length. Superclass get() and release(ByteBuffer) methods can be used to allocate and release ByteBuffers from the pool. ByteBuffers are allocated on demand, and released to the garbage collector after 10 minutes without use, unless the superclass setIdleTimeoutSeconds method is called to change the timeout. If there is a leak and release is not called to return a ByteBuffer after use, it will still be released from the pool after 10 minutes, and thus will become available to the garbage collector.


Nested Class Summary
 
Nested classes/interfaces inherited from class ariba.util.core.SelfCleaningPool
SelfCleaningPool.PoolFloat<T>
 
Constructor Summary
ByteBufferPool(int bufferLength)
           
 
Method Summary
 java.nio.ByteBuffer get()
          Returns an instance of the resource T.
 
Methods inherited from class ariba.util.core.BufferPool
getBufferLength
 
Methods inherited from class ariba.util.core.SelfCleaningPool
getEventLoop, getIdleTimeoutSeconds, performCommand, registerEventLoop, release, setIdleTimeoutSeconds
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ByteBufferPool

public ByteBufferPool(int bufferLength)
Method Detail

get

public java.nio.ByteBuffer get()
Description copied from class: SelfCleaningPool
Returns an instance of the resource T. Synchronizes on this instance for thread safety while calling internal methods to do the work. Never returns null.

Overrides:
get in class SelfCleaningPool<java.nio.ByteBuffer>


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.