// See superclass start. This method is invoked from a separate non-MSC thread after start. So we
  // can do a fair
  // bit of stuff
  @Override
  protected void boot(final BootContext context) throws ConfigurationPersistenceException {

    final ServiceTarget serviceTarget = context.getServiceTarget();
    try {
      super.boot(
          hostControllerConfigurationPersister
              .load()); // This parses the host.xml and invokes all ops

      final RunningMode currentRunningMode = runningModeControl.getRunningMode();

      // Now we know our management interface configuration. Install the server inventory
      Future<ServerInventory> inventoryFuture =
          ServerInventoryService.install(
              serviceTarget,
              this,
              environment,
              hostControllerInfo.getNativeManagementInterface(),
              hostControllerInfo.getNativeManagementPort());

      // Install the core remoting endpoint and listener
      ManagementRemotingServices.installRemotingEndpoint(
          serviceTarget,
          ManagementRemotingServices.MANAGEMENT_ENDPOINT,
          hostControllerInfo.getLocalHostName(),
          EndpointService.EndpointType.MANAGEMENT,
          null,
          null);

      if (!hostControllerInfo.isMasterDomainController() && !environment.isUseCachedDc()) {
        serverInventory = getFuture(inventoryFuture);

        if (hostControllerInfo.getRemoteDomainControllerHost() != null) {
          Future<MasterDomainControllerClient> clientFuture =
              RemoteDomainConnectionService.install(
                  serviceTarget,
                  getValue(),
                  hostControllerInfo.getLocalHostName(),
                  hostControllerInfo.getRemoteDomainControllerHost(),
                  hostControllerInfo.getRemoteDomainControllertPort(),
                  hostControllerInfo.getRemoteDomainControllerSecurityRealm(),
                  remoteFileRepository);
          MasterDomainControllerClient masterDomainControllerClient = getFuture(clientFuture);
          // Registers us with the master and gets down the master copy of the domain model to our
          // DC
          // TODO make sure that the RDCS checks env.isUseCachedDC, and if true falls through to
          // that
          try {
            masterDomainControllerClient.register();
          } catch (IllegalStateException e) {
            // We could not connect to the host
            log.error(HostControllerMessages.MESSAGES.cannotConnectToMaster(e));
            System.exit(ExitCodes.HOST_CONTROLLER_ABORT_EXIT_CODE);
          }
        } else if (currentRunningMode != RunningMode.ADMIN_ONLY) {
          // We could not connect to the host
          log.error(
              HostControllerMessages.MESSAGES.noDomainControllerConfigurationProvided(
                  currentRunningMode, CommandLineConstants.ADMIN_ONLY, RunningMode.ADMIN_ONLY));
          System.exit(ExitCodes.HOST_CONTROLLER_ABORT_EXIT_CODE);
        }

      } else {
        // TODO look at having LocalDomainControllerAdd do this, using Stage.IMMEDIATE for the steps
        // parse the domain.xml and load the steps
        ConfigurationPersister domainPersister =
            hostControllerConfigurationPersister.getDomainPersister();
        super.boot(domainPersister.load());

        ManagementRemotingServices.installManagementChannelServices(
            serviceTarget,
            ManagementRemotingServices.MANAGEMENT_ENDPOINT,
            new MasterDomainControllerOperationHandlerService(this, this),
            DomainModelControllerService.SERVICE_NAME,
            ManagementRemotingServices.DOMAIN_CHANNEL,
            null,
            null);
        serverInventory = getFuture(inventoryFuture);
      }

      // TODO look into adding some of these services in the handlers, but ON-DEMAND.
      // Then here just add some simple service that demands them

      ServerToHostOperationHandlerFactoryService.install(
          serviceTarget, ServerInventoryService.SERVICE_NAME, proxyExecutor);

      NativeManagementAddHandler.installNativeManagementServices(
          serviceTarget, hostControllerInfo, null, null);

      if (hostControllerInfo.getHttpManagementInterface() != null) {
        HttpManagementAddHandler.installHttpManagementServices(
            serviceTarget, hostControllerInfo, environment, null);
      }

      if (currentRunningMode == RunningMode.NORMAL) {
        startServers();
      }

      // TODO when to call hostControllerConfigurationPersister.successful boot? Look into this for
      // standalone as well; may be broken now
    } finally {
      try {
        finishBoot();
      } finally {
        bootstrapListener.tick();
      }
    }
  }