docs: @Override
      protected void boot(final BootContext context) throws ConfigurationPersistenceException {
  
          final ServiceTarget serviceTarget = context.getServiceTarget();
          boolean ok = false;
          boolean reachedServers = false;
  
          try {
              // Install server inventory callback
              ServerInventoryCallbackService.install(serviceTarget);
  
              // handler for domain server auth.
              DomainManagedServerCallbackHandler.install(serviceTarget);
              // Parse the host.xml and invoke all the ops. The ops should rollback on any Stage.RUNTIME failure
              List<ModelNode> hostBootOps = hostControllerConfigurationPersister.load();
              if (hostBootOps.isEmpty()) { // booting with empty config
                  ok = bootEmptyConfig(context);
                  return;
              }
  
              // We run the first op ("/host=foo:add()") separately to let it set up the host ManagementResourceRegistration
              ModelNode addHostOp = hostBootOps.remove(0);
              HostControllerLogger.ROOT_LOGGER.debug("Invoking the initial host=foo:add() op");
              //Disable model validation here since it will will fail
              ok = boot(Collections.singletonList(addHostOp), true, true);
  
              // Add the controller initialization operation
              hostBootOps.add(registerModelControllerServiceInitializationBootStep(context));
  
              //Pass in a custom mutable root resource registration provider for the remaining host model ops boot
              //This will be used to make sure that any extensions added in parallel get registered in the host model
              if (ok) {
                  HostControllerLogger.ROOT_LOGGER.debug("Invoking remaining host.xml ops");
                  ok = boot(hostBootOps, true, true, new MutableRootResourceRegistrationProvider() {
                      public ManagementResourceRegistration getRootResourceRegistrationForUpdate(OperationContext context) {
                          return hostModelRegistration;
                      }
                  });
              }
  
              final RunningMode currentRunningMode = runningModeControl.getRunningMode();
  
              if (ok) {
                  // Now we know our management interface configuration. Install the server inventory
                  Future<ServerInventory> inventoryFuture = installServerInventory(serviceTarget);
  
                  // Now we know our discovery configuration.
                  List<DiscoveryOption> discoveryOptions = hostControllerInfo.getRemoteDomainControllerDiscoveryOptions();
                  if (hostControllerInfo.isMasterDomainController() && (discoveryOptions != null)) {
                      // Install the discovery service
                      installDiscoveryService(serviceTarget, discoveryOptions);
                  }
  
                  boolean useLocalDomainXml = hostControllerInfo.isMasterDomainController();
                  boolean isCachedDc = environment.isUseCachedDc();
  
                  if (!useLocalDomainXml) {
                      // Block for the ServerInventory
                      establishServerInventory(inventoryFuture);
  
                      boolean discoveryConfigured = (discoveryOptions != null) && !discoveryOptions.isEmpty();
                      if (currentRunningMode != RunningMode.ADMIN_ONLY) {
                          if (discoveryConfigured) {
                              // Try and connect.
                              // If can't connect && !environment.isUseCachedDc(), abort
                              // Otherwise if can't connect, use local domain.xml and start trying to reconnect later
                              DomainConnectResult connectResult = connectToDomainMaster(serviceTarget, currentRunningMode, isCachedDc, false);
                              if (connectResult == DomainConnectResult.ABORT) {
                                  ok = false;
                              } else if (connectResult == DomainConnectResult.FAILED) {
                                  useLocalDomainXml = true;
                              }
                          } else {
                              // Invalid configuration; no way to get the domain config
                              ROOT_LOGGER.noDomainControllerConfigurationProvided(currentRunningMode,
                                      CommandLineConstants.ADMIN_ONLY, RunningMode.ADMIN_ONLY);
                              SystemExiter.abort(ExitCodes.HOST_CONTROLLER_ABORT_EXIT_CODE);
                          }
                      } else {
                          // We're in admin-only mode. See how we handle access control config
                          // if cached-dc is specified, we try and use the last configuration we have before failing.
                          if (isCachedDc) {
                              useLocalDomainXml = true;
                          }
                          switch (hostControllerInfo.getAdminOnlyDomainConfigPolicy()) {
                              case ALLOW_NO_CONFIG:
                                  // our current setup is good, if we're using --cached-dc, we'll try and load the config below
                                  // if not, we'll start empty.
                                  break;
                              case FETCH_FROM_MASTER:
                                  if (discoveryConfigured) {
                                      // Try and connect.
                                      // If can't connect && !environment.isUseCachedDc(), abort
                                      // Otherwise if can't connect, use local domain.xml but DON'T start trying to reconnect later
                                      DomainConnectResult connectResult = connectToDomainMaster(serviceTarget, currentRunningMode, isCachedDc, true);
                                      ok = connectResult != DomainConnectResult.ABORT;
                                  } else {
                                      // try and use a local cached version below before failing
                                      if (isCachedDc) {
                                          break;
                                      }
                                      // otherwise, this is an invalid configuration; no way to get the domain config
                                      ROOT_LOGGER.noDomainControllerConfigurationProvidedForAdminOnly(
                                              ModelDescriptionConstants.ADMIN_ONLY_POLICY,
                                              AdminOnlyDomainConfigPolicy.REQUIRE_LOCAL_CONFIG,
                                              CommandLineConstants.CACHED_DC, RunningMode.ADMIN_ONLY);
                                      SystemExiter.abort(ExitCodes.HOST_CONTROLLER_ABORT_EXIT_CODE);
                                      break;
                                  }
                                  break;
                              case REQUIRE_LOCAL_CONFIG:
                                  // if we have a cached copy, and --cached-dc we can try to use that below
                                  if (isCachedDc) {
                                      break;
                                  }
  
                                  // otherwise, this is an invalid configuration; no way to get the domain config
                                  ROOT_LOGGER.noAccessControlConfigurationAvailable(currentRunningMode,
                                          ModelDescriptionConstants.ADMIN_ONLY_POLICY,
                                          AdminOnlyDomainConfigPolicy.REQUIRE_LOCAL_CONFIG,
                                          CommandLineConstants.CACHED_DC, currentRunningMode);
                                  SystemExiter.abort(ExitCodes.HOST_CONTROLLER_ABORT_EXIT_CODE);
                                  break;
                              default:
                                  throw new IllegalStateException(hostControllerInfo.getAdminOnlyDomainConfigPolicy().toString());
                          }
                      }
  
                  }
  
                  if (useLocalDomainXml) {
                      if (!hostControllerInfo.isMasterDomainController() && isCachedDc) {
                          ROOT_LOGGER.usingCachedDC(CommandLineConstants.CACHED_DC, ConfigurationPersisterFactory.CACHED_DOMAIN_XML);
                      }
  
                      // parse the domain.xml and load the steps
                      // TODO look at having LocalDomainControllerAdd do this, using Stage.IMMEDIATE for the steps
                      ConfigurationPersister domainPersister = hostControllerConfigurationPersister.getDomainPersister();
  
                      // if we're using --cached-dc, we have to have had a persisted copy of the domain config for this to work
                      // otherwise we fail and can't continue.
                      List<ModelNode> domainBootOps = domainPersister.load();
  
                      HostControllerLogger.ROOT_LOGGER.debug("Invoking domain.xml ops");
                      // https://issues.jboss.org/browse/WFCORE-3897
                      domainConfigAvailable.set(true);
                      ok = boot(domainBootOps, false);
                      domainConfigAvailable.set(ok);
  
                      if (!ok && runningModeControl.getRunningMode().equals(RunningMode.ADMIN_ONLY)) {
                          ROOT_LOGGER.reportAdminOnlyDomainXmlFailure();
                          ok = true;
                      }
  
                      if (ok && processType != ProcessType.EMBEDDED_HOST_CONTROLLER) {
                          InternalExecutor executor = new InternalExecutor();
                          ManagementRemotingServices.installManagementChannelServices(serviceTarget, ManagementRemotingServices.MANAGEMENT_ENDPOINT,
                                  new MasterDomainControllerOperationHandlerService(this, executor, executor, environment.getDomainTempDir(), this, domainHostExcludeRegistry),
                                  DomainModelControllerService.SERVICE_NAME, ManagementRemotingServices.DOMAIN_CHANNEL,
                                  HC_EXECUTOR_SERVICE_NAME, HC_SCHEDULED_EXECUTOR_SERVICE_NAME);
  
                          // Block for the ServerInventory
                          establishServerInventory(inventoryFuture);
                      }
  
                      // register local host controller
                      final String hostName = hostControllerInfo.getLocalHostName();
                      slaveHostRegistrations.registerHost(hostName, null, "local");
                  }
              }
  
              if (ok && hostControllerInfo.getAdminOnlyDomainConfigPolicy() != AdminOnlyDomainConfigPolicy.ALLOW_NO_CONFIG) {
                  final ModelNode validate = new ModelNode();
                  validate.get(OP).set("validate");
                  validate.get(OP_ADDR).setEmptyList();
                  final ModelNode result = internalExecute(OperationBuilder.create(validate).build(), OperationMessageHandler.DISCARD, OperationTransactionControl.COMMIT, new OperationStepHandler() {
                      @Override
                      public void execute(OperationContext context, ModelNode operation) throws OperationFailedException {
                          DomainModelIncludesValidator.validateAtBoot(context, operation);
                      }
                  }).getResponseNode();
  
                  if (!SUCCESS.equals(result.get(OUTCOME).asString())) {
                      throw HostControllerLogger.ROOT_LOGGER.bootConfigValidationFailed(result.get(FAILURE_DESCRIPTION));
                  }
  
              }
  
              if (ok && processType != ProcessType.EMBEDDED_HOST_CONTROLLER) {
                  // Install the server > host operation handler
                  ServerToHostOperationHandlerFactoryService.install(serviceTarget, ServerInventoryService.SERVICE_NAME,
                          getExecutorServiceInjector().getValue(), new InternalExecutor(), this, expressionResolver, environment.getDomainTempDir());
  
                  // demand native mgmt services
                  final ServiceBuilder nativeSB = serviceTarget.addService(ServiceName.JBOSS.append("native-mgmt-startup"), Service.NULL);
                  nativeSB.requires(ManagementRemotingServices.channelServiceName(ManagementRemotingServices.MANAGEMENT_ENDPOINT, ManagementRemotingServices.SERVER_CHANNEL));
                  nativeSB.install();
  
                  // demand http mgmt services
                  if (capabilityRegistry.hasCapability(UndertowHttpManagementService.EXTENSIBLE_HTTP_MANAGEMENT_CAPABILITY.getName(), CapabilityScope.GLOBAL)) {
                      final ServiceBuilder httpSB = serviceTarget.addService(ServiceName.JBOSS.append("http-mgmt-startup"), Service.NULL);
                      httpSB.requires(UndertowHttpManagementService.SERVICE_NAME);
                      httpSB.install();
                  }
  
                  reachedServers = true;
                  if (currentRunningMode == RunningMode.NORMAL) {
                      startServers();
                  }
              }
  
          } catch (Exception e) {
              ROOT_LOGGER.caughtExceptionDuringBoot(e);
              if (!reachedServers) {
                  ok = false;
              }
          } finally {
              if (ok) {
                  try {
                      finishBoot();
                  } finally {
                      // Trigger the started message
                      Notification notification = new Notification(ModelDescriptionConstants.BOOT_COMPLETE_NOTIFICATION, PathAddress.pathAddress(PathElement.pathElement(CORE_SERVICE, MANAGEMENT),
                              PathElement.pathElement(SERVICE, MANAGEMENT_OPERATIONS)), ControllerLogger.MGMT_OP_LOGGER.bootComplete());
                      getNotificationSupport().emit(notification);
                      bootstrapListener.printBootStatistics();
                  }
              } else {
                  // Die!
                  String failed = ROOT_LOGGER.unsuccessfulBoot();
                  ROOT_LOGGER.fatal(failed);
                  bootstrapListener.bootFailure(failed);
  
                  // don't exit if we're embedded
                  if (processType != ProcessType.EMBEDDED_HOST_CONTROLLER) {
                      SystemExiter.abort(ExitCodes.HOST_CONTROLLER_ABORT_EXIT_CODE);
                  }
              }
          }
      }