@Override
    public long waitNextGeneration(boolean isInitializing) {
        if (handles.isEmpty())
            throw new IllegalStateException("No config keys registered");

        boolean gotNextGen = false;
        while ( ! gotNextGen) {
            try {
                if (subscriber.nextGeneration(isInitializing)) {
                    gotNextGen = true;
                    log.log(FINE, () -> this + " got next config generation " + subscriber.getGeneration() + "\n" + subscriber.toString());
                }
            } catch (IllegalArgumentException e) {
                throw new IllegalArgumentException("Failed retrieving the next config generation", e);
            }
        }

        generation = subscriber.getGeneration();
        return generation;
    }
@author gjoranv
@author Tony Vaagenes
@author ollivir
container-core/src/main/java/com/yahoo/container/di/CloudSubscriber.java