protected final void initializeDataIfNeeded(boolean regenerateHash) throws AmbariException {
    if (data == null) {
      updateLock.lock();
      try {
        if (data == null) {
          T localData = getCurrentData();
          if (regenerateHash) {
            regenerateDataIdentifiers(localData);
          }
          data = localData;
        }
      } finally {
        updateLock.unlock();
      }
    }
  }
Template method to update the data.
@return true if the update introduced any change
ambari-server/src/main/java/org/apache/ambari/server/agent/stomp/AgentClusterDataHolder.java