|
|
@ -279,8 +279,14 @@ abstract class PoolBase
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
|
|
|
|
final MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
|
|
|
|
|
|
|
|
|
|
|
|
final ObjectName beanConfigName = new ObjectName("com.zaxxer.hikari:type=PoolConfig (" + poolName + ")");
|
|
|
|
ObjectName beanConfigName, beanPoolName;
|
|
|
|
final ObjectName beanPoolName = new ObjectName("com.zaxxer.hikari:type=Pool (" + poolName + ")");
|
|
|
|
if ("true".equals(System.getProperty("hikaricp.jmx.register2.0"))) {
|
|
|
|
|
|
|
|
beanConfigName = new ObjectName("com.zaxxer.hikari:type=PoolConfig,name=" + poolName);
|
|
|
|
|
|
|
|
beanPoolName = new ObjectName("com.zaxxer.hikari:type=Pool,name=" + poolName);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
beanConfigName = new ObjectName("com.zaxxer.hikari:type=PoolConfig (" + poolName + ")");
|
|
|
|
|
|
|
|
beanPoolName = new ObjectName("com.zaxxer.hikari:type=Pool (" + poolName + ")");
|
|
|
|
|
|
|
|
}
|
|
|
|
if (register) {
|
|
|
|
if (register) {
|
|
|
|
if (!mBeanServer.isRegistered(beanConfigName)) {
|
|
|
|
if (!mBeanServer.isRegistered(beanConfigName)) {
|
|
|
|
mBeanServer.registerMBean(config, beanConfigName);
|
|
|
|
mBeanServer.registerMBean(config, beanConfigName);
|
|
|
|