List of usage examples for org.apache.commons.pool2.impl BaseObjectPoolConfig getJmxEnabled
public boolean getJmxEnabled()
From source file:JDBCPool.dbcp.demo.sourcecode.BaseGenericObjectPool.java
/** * Handles JMX registration (if required) and the initialization required for * monitoring./*from w w w. j av a 2 s. c om*/ * * @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(); }