public boolean updateData(T update) throws AmbariException {
    updateLock.lock();
    try {
      initializeDataIfNeeded(true);
      boolean changed = handleUpdate(update);
      if (changed) {
        regenerateDataIdentifiers(data);
        update.setHash(getData().getHash());
        STOMPUpdatePublisher.publish(update);
      }
      return changed;
    } 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