class JndiChangeNotifier extends JndiAddressProvider implements AddressChangeNotifier, InitializingBean {

    public void check() {
        List<InetSocketAddress> newAddrs = getAddresses();
        if (newAddrs != null && !newAddrs.equals(currentAddrs)) {

            if (addressChangeListener != null) {
                currentAddrs = newAddrs;
                addressChangeListener.changeAddresses(newAddrs);
            } else {
                LOGGER.error("Address change listener is null for JNDI key {}, cannot notify about new value {}", getJndiKey(), newAddrs);
            }
        }
    }

}