Example usage for org.apache.commons.dbcp2 BasicDataSource getJmxName

List of usage examples for org.apache.commons.dbcp2 BasicDataSource getJmxName

Introduction

In this page you can find the example usage for org.apache.commons.dbcp2 BasicDataSource getJmxName.

Prototype

public String getJmxName() 

Source Link

Document

Returns the JMX name that has been requested for this DataSource.

Usage

From source file:org.ofbiz.core.entity.transaction.DBCPConnectionFactory.java

private static void unregisterDatasourceFromJmx(BasicDataSource dataSource) {
    final MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
    try {//  w  w  w . j  a  va  2 s .co m
        mbs.unregisterMBean(ObjectName.getInstance(dataSource.getJmxName()));
    } catch (Exception e) {
        throw new RuntimeException(e);
    }
}