class JndiAddressProvider extends DefaultAddressProvider implements InitializingBean {

    @Override
    public List<InetSocketAddress> getAddresses() {
        Object ips = null;
        List<InetSocketAddress> addrs = null;
        try {
            if (jndiKey != null && (ips = lookup(jndiKey)) != null) {
                getLogger().info("Addresses from JNDI will be used to connect to memcached servers. Addresses: {}", ips);
                addrs = getAddresses((String) ips);
            } else {
                addrs = super.getAddresses();
            }
        } catch (NamingException ex) {
            getLogger()
                    .warn(String.format("Name of the JNDI key with memcached addresses is set but wrong value is bound to this key: %s",
                            jndiKey), ex);
            addrs = super.getAddresses();
        }

        return addrs;
    }

    public  JndiAddressProvider();
    public  JndiAddressProvider(final String jndiKey, final String address);

}