コード例 #1
0
 @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()));
 }
コード例 #2
0
 @Override
 public void connectionPoolClosed(final ConnectionPoolEvent event) {
   map.remove(new ClusterIdServerAddressPair(event.getClusterId(), event.getServerAddress()));
   MBeanServerFactory.getMBeanServer()
       .unregisterMBean(getMBeanObjectName(event.getClusterId(), event.getServerAddress()));
 }