class RefreshableDataSource implements DataSource, DataSourceConfigureChangeListener {

    @Override
    public synchronized void configChanged(DataSourceConfigureChangeEvent event) throws SQLException {
        String name = event.getName();
        DataSourceConfigure newConfigure = event.getNewDataSourceConfigure();
        SingleDataSource oldDataSource = dataSourceReference.getAndSet(newConfigure == null ? null : new SingleDataSource(name, newConfigure));
        close(oldDataSource);
    }

    public  RefreshableDataSource(String name, DataSourceConfigure config);

}