@Override
  public void initialize() {
    registerListener(configManager);

    Document document = configManager.getXML(USER_CREDENTIALS_CONFIG).getDocument();
    UserCredentialsReader reader = newUserCredencialsReader(document);
    cache = Collections.unmodifiableMap(reader.readAll());

    Runnable removedTimedOutTokens =
        new Runnable() {
          @Override
          public void run() {
            removedTimedOutTokens();
          }
        };

    this.backgroundThreadsManager.configure(
        BackgroundThreadConfiguration.repeatingAction(
                "removedTimedOutTokens", removedTimedOutTokens)
            .handlingExceptionWith(CONTINUE)
            .executedEvery(configuration.getTokenRemovalThreadDelayBetweenChecks()));
  }
 @Override
 public void onConfigUpdated(String configPath) {
   Document document = configManager.getXML(USER_CREDENTIALS_CONFIG).getDocument();
   UserCredentialsReader reader = newUserCredencialsReader(document);
   cache = Collections.unmodifiableMap(reader.readAll());
 }