All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.anaptecs.jeaf.workload.proxy.ByteBufferPoolConfiguration Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
/**
 * Copyright 2004 - 2021 anaptecs GmbH, Burgstr. 96, 72764 Reutlingen, Germany
 *
 * All rights reserved.
 */
package com.anaptecs.jeaf.workload.proxy;

/**
 * Class implements the configuration of the byte buffer pool that is used to reduce garbage of incoming requests. Class
 * {@link ByteBufferPool} provides independent pools for byte buffers of different sizes. However the size of each pool
 * is the same.
 * 
 * @author JEAF Development Team
 */
public class ByteBufferPoolConfiguration {
  /**
   * Pool size with default size of 20.
   */
  private int poolSize = 20;

  /**
   * Size of the smallest byte buffers (default 128 bytes).
   */
  private int minBufferSize = 128;

  /**
   * Size of the largest byte buffers (default 16k bytes). Larger byte buffers will not be pooled.
   */
  private int maxBufferSize = 16 * 1024;

  /**
   * Method returns the size of the pool.
   * 
   * @return int Size of the pool.
   */
  public int getPoolSize( ) {
    return poolSize;
  }

  /**
   * Method sets the size of the pool.
   * 
   * @param pPoolSize Size of the pool.
   */
  public void setPoolSize( int pPoolSize ) {
    poolSize = pPoolSize;
  }

  /**
   * Method returns the size of the smallest byte buffers.
   * 
   * @return Size of the smallest byte buffers.
   */
  public int getMinBufferSize( ) {
    return minBufferSize;
  }

  /**
   * Method sets the size of the smallest byte buffers.
   * 
   * @param pMinBufferSize Size of the smallest byte buffers.
   */
  public void setMinBufferSize( int pMinBufferSize ) {
    minBufferSize = pMinBufferSize;
  }

  /**
   * Method returns the size of the largest byte buffers.
   * 
   * @return Size of the largest byte buffers.
   */
  public int getMaxBufferSize( ) {
    return maxBufferSize;
  }

  /**
   * Method returns the size of the largest byte buffers.
   * 
   * @param pMaxBufferSize Size of the largest byte buffers.
   */
  public void setMaxBufferSize( int pMaxBufferSize ) {
    maxBufferSize = pMaxBufferSize;
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy