public synchronized ConnectionPoolStats initializeConnectionPoolStats(String dsName) {
        ConnectionPoolStats cStats = this.connectionPoolCountByName.get(dsName);
        if (cStats == null) {
            cStats = new ConnectionPoolStats();
            this.connectionPoolCountByName.put(dsName, cStats);
            if (StatsFactory.isPMIEnabled()) {
                legacyPMIMap.put(dsName, new LegacyMonitor(dsName, grp));
                CPStatsMap.put(dsName, cStats);
            }
            return cStats;
        } else {
            return cStats;
        }
    }
public synchronized ConnectionPoolStats initializeConnectionPoolStats ( String dsName ) { ConnectionPoolStats cStats = this . connectionPoolCountByName . get ( dsName ) ; if ( cStats == null ) { cStats = new ConnectionPoolStats ( ) ; this . connectionPoolCountByName . put ( dsName , cStats ) ; if ( StatsFactory . isPMIEnabled ( ) ) { legacyPMIMap . put ( dsName , new LegacyMonitor ( dsName , grp ) ) ; CPStatsMap . put ( dsName , cStats ) ; } return cStats ; } else { return cStats ; } }
@param dsName=DataSourceName
@return ConnectionPoolStats Object
This is responsible for creating a ConnectionPoolStats for specific datasource and adding it to the MeterCollection.Before adding
we check in the synchronized block to make sure that there is no already existing connectionPoolStats Object for the specific datasource.