@Override
  @Transactional
  public void setState(State state) {
    State oldState = getState();
    stateMachine.setCurrentState(state);
    HostComponentStateEntity stateEntity = getStateEntity();
    if (stateEntity != null) {
      stateEntity.setCurrentState(state);
      stateEntity = hostComponentStateDAO.merge(stateEntity);
      if (!oldState.equals(state)) {
        STOMPUpdatePublisher.publish(new HostComponentsUpdateEvent(Collections.singletonList(
            HostComponentUpdate.createHostComponentStatusUpdate(stateEntity, oldState))));
      }
    } else {
      LOG.warn("Setting a member on an entity object that may have been "
          + "previously deleted, serviceName = " + getServiceName() + ", " + "componentName = "
          + getServiceComponentName() + ", " + "hostName = " + getHostName());
    }
  }
The {@link AlertDefinitionCommandTransition} is used to capture the
transition from {@link State#INSTALLING} to {@link State#INSTALLED} so that
the host affected will have new {@link AlertDefinitionCommand}s pushed to
it.
ambari-server/src/main/java/org/apache/ambari/server/state/svccomphost/ServiceComponentHostImpl.java