@Override protected void doUpdate(final Configuration configuration) throws Exception { // detect URL changes URI previousUrl = config.remoteUrl; super.doUpdate(configuration); remoteUrlChanged = !config.remoteUrl.equals(previousUrl); }
@Override protected void doUpdate(final Configuration configuration) throws Exception { // detect member changes Set<String> previousMemberNames = config.memberNames; super.doUpdate(configuration); // check whether any members or their ordering have changed if (!Iterables.elementsEqual(config.memberNames, previousMemberNames)) { cacheController.invalidateCache(); } }
@Override protected void doUpdate(final Configuration configuration) throws Exception { Config previous = config; super.doUpdate(configuration); // re-create cache if enabled or cache settings changed if (config.enabled) { if (!previous.enabled || !config.timeToLive.equals(previous.timeToLive)) { maybeDestroyCache(); maybeCreateCache(); } } else { // else destroy cache if disabled maybeDestroyCache(); } }
@Override @Guarded(by = STOPPED) public void update() throws Exception { doUpdate(getRepository().getConfiguration()); }