Example usage for org.apache.commons.pool2.impl GenericObjectPool setConfig

List of usage examples for org.apache.commons.pool2.impl GenericObjectPool setConfig

Introduction

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

Prototype

public void setConfig(GenericObjectPoolConfig conf) 

Source Link

Document

Sets the base pool configuration.

Usage

From source file:org.atmosphere.cpr.PoolableBroadcasterFactoryTest.java

@Test
public void testImplementation() {
    assertNotNull(factory.poolableProvider());
    assertNotNull(factory.poolableProvider().implementation());
    assertEquals(factory.poolableProvider().implementation().getClass(), GenericObjectPool.class);
    GenericObjectPool nativePool = (GenericObjectPool) factory.poolableProvider().implementation();
    assertTrue(nativePool.getLifo());//from   ww w  .j  ava 2  s  .  c o  m
    GenericObjectPoolConfig c = new GenericObjectPoolConfig();
    c.setMaxTotal(1);
    nativePool.setConfig(c);
    assertEquals(1, nativePool.getMaxTotal());
}