@Override public void connectionPoolOpened(final ConnectionPoolOpenedEvent event) { ConnectionPoolStatistics statistics = new ConnectionPoolStatistics(event); map.put( new ClusterIdServerAddressPair(event.getClusterId(), event.getServerAddress()), statistics); MBeanServerFactory.getMBeanServer() .registerMBean( statistics, getMBeanObjectName(event.getClusterId(), event.getServerAddress())); }
@Override public void connectionPoolClosed(final ConnectionPoolEvent event) { map.remove(new ClusterIdServerAddressPair(event.getClusterId(), event.getServerAddress())); MBeanServerFactory.getMBeanServer() .unregisterMBean(getMBeanObjectName(event.getClusterId(), event.getServerAddress())); }