* @param statisticsListener the new listener
* @throws ProxoolException if the pool couldn't be found
*/
public static void addStatisticsListener(String alias, StatisticsListenerIF statisticsListener) throws ProxoolException {
// TODO investigate what happens if we add a statistics monitor after we register a listener
final Admin monitor = ConnectionPoolManager.getInstance().getConnectionPool(alias).getAdmin();
if (monitor != null) {
monitor.addStatisticsListener(statisticsListener);
} else {
throw new ProxoolException("Statistics are switched off, your can't add a listener");
}
}