Example usage for org.apache.commons.pool2.impl GenericObjectPoolConfig getJmxNameBase

List of usage examples for org.apache.commons.pool2.impl GenericObjectPoolConfig getJmxNameBase

Introduction

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

Prototype

public String getJmxNameBase() 

Source Link

Document

Gets the value of the JMX name base that will be used as part of the name assigned to JMX enabled pools created with this configuration instance.

Usage

From source file:org.ops4j.pax.jdbc.pool.dbcp2.impl.BeanConfigTest.java

@Test
public void testPoolConfig() throws Exception {
    Map<String, String> props = new HashMap<String, String>();
    props.put("maxIdle", "2");
    props.put("testOnBorrow", "true");
    props.put("maxWaitMillis", "1000");
    props.put("jmxNameBase", "name");
    GenericObjectPoolConfig config = new GenericObjectPoolConfig();
    BeanConfig.configure(config, props);
    Assert.assertEquals(2, config.getMaxIdle());
    Assert.assertEquals(true, config.getTestOnBorrow());
    Assert.assertEquals(1000, config.getMaxWaitMillis());
    Assert.assertEquals("name", config.getJmxNameBase());
}