Class BufferPoolImpl

java.lang.Object
org.eclipse.parsson.BufferPoolImpl
All Implemented Interfaces:
BufferPool

class BufferPoolImpl extends Object implements BufferPool
char[] pool that pool instances of char[] which are expensive to create.
  • Field Details

  • Constructor Details

    • BufferPoolImpl

      BufferPoolImpl()
  • Method Details

    • take

      public final char[] take()
      Gets a new object from the pool.

      If no object is available in the pool, this method creates a new one.

      Specified by:
      take in interface BufferPool
      Returns:
      always non-null.
    • getQueue

      private ConcurrentLinkedQueue<char[]> getQueue()
    • recycle

      public final void recycle(char[] t)
      Returns an object back to the pool.
      Specified by:
      recycle in interface BufferPool
      Parameters:
      t - object to return back to the pool