本文整理汇总了Java中org.apache.commons.pool2.impl.GenericObjectPoolConfig.setJmxEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java GenericObjectPoolConfig.setJmxEnabled方法的具体用法?Java GenericObjectPoolConfig.setJmxEnabled怎么用?Java GenericObjectPoolConfig.setJmxEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.commons.pool2.impl.GenericObjectPoolConfig
的用法示例。
在下文中一共展示了GenericObjectPoolConfig.setJmxEnabled方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: DefaultSessionPool
import org.apache.commons.pool2.impl.GenericObjectPoolConfig; //导入方法依赖的package包/类
public DefaultSessionPool(final ConnectionService connect, final X509TrustManager trust, final X509KeyManager key,
final VaultRegistry registry, final Cache<Path> cache, final TranscriptListener transcript,
final Host bookmark) {
this.connect = connect;
this.registry = registry;
this.cache = cache;
this.bookmark = bookmark;
this.transcript = transcript;
final GenericObjectPoolConfig configuration = new GenericObjectPoolConfig();
configuration.setJmxEnabled(false);
configuration.setEvictionPolicyClassName(CustomPoolEvictionPolicy.class.getName());
configuration.setBlockWhenExhausted(true);
configuration.setMaxWaitMillis(BORROW_MAX_WAIT_INTERVAL);
this.pool = new GenericObjectPool<Session>(new PooledSessionFactory(connect, trust, key, cache, bookmark, registry), configuration);
final AbandonedConfig abandon = new AbandonedConfig();
abandon.setUseUsageTracking(true);
this.pool.setAbandonedConfig(abandon);
}