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

com.rapleaf.jack.transaction.DbPoolStatusImpl Maven / Gradle / Ivy

There is a newer version: 1.8
Show newest version
package com.rapleaf.jack.transaction;

import com.rapleaf.jack.IDb;
import org.apache.commons.pool2.impl.GenericObjectPool;

public class DbPoolStatusImpl implements DbPoolStatus {

  private final GenericObjectPool connectionPool;
  public DbPoolStatusImpl(GenericObjectPool connectionPool) {
    this.connectionPool = connectionPool;
  }

  /**
   * @return The number of db connection object currently borrowed from this pool
   */
  @Override
  public int getNumActive() {
    return this.connectionPool.getNumActive();
  }

  /**
   * @return The number of db connection object currently idle in this pool
   */
  @Override
  public int getNumIdle() {
    return this.connectionPool.getNumIdle();
  }

  /**
   * @return The number of threads currently blocked waiting for an db connection object from the pool
   */
  @Override
  public int getNumWaiters() {
    return this.connectionPool.getNumWaiters();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy