Example usage for org.apache.commons.pool2.impl BaseObjectPoolConfig getFairness

List of usage examples for org.apache.commons.pool2.impl BaseObjectPoolConfig getFairness

Introduction

In this page you can find the example usage for org.apache.commons.pool2.impl BaseObjectPoolConfig getFairness.

Prototype

public boolean getFairness() 

Source Link

Document

Get the value for the fairness configuration attribute for pools created with this configuration instance.

Usage

From source file:JDBCPool.dbcp.demo.sourcecode.BaseGenericObjectPool.java

/**
 * Handles JMX registration (if required) and the initialization required for
 * monitoring.//from   w  w w  . ja  v a2 s .c  o  m
 *
 * @param config        Pool configuration
 * @param jmxNameBase   The default base JMX name for the new pool unless
 *                      overridden by the config
 * @param jmxNamePrefix Prefix to be used for JMX name for the new pool
 */
public BaseGenericObjectPool(BaseObjectPoolConfig config, String jmxNameBase, String jmxNamePrefix) {
    if (config.getJmxEnabled()) {
        this.oname = jmxRegister(config, jmxNameBase, jmxNamePrefix);
    } else {
        this.oname = null;
    }

    // Populate the creation stack trace
    this.creationStackTrace = getStackTrace(new Exception());

    // save the current TCCL (if any) to be used later by the evictor Thread
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (cl == null) {
        factoryClassLoader = null;
    } else {
        factoryClassLoader = new WeakReference<ClassLoader>(cl);
    }

    fairness = config.getFairness();
}