@Override public List<ModelNode> load() throws ConfigurationPersistenceException { // TODO investigate replacing all this with something more like BackupXmlConfigurationPersister.isSuppressLoad if (environment.getProcessType() == ProcessType.EMBEDDED_HOST_CONTROLLER) { final ConfigurationFile configurationFile = environment.getHostConfigurationFile(); final File bootFile = configurationFile.getBootFile(); final ConfigurationFile.InteractionPolicy policy = configurationFile.getInteractionPolicy(); final HostRunningModeControl runningModeControl = environment.getRunningModeControl(); if (bootFile.exists() && bootFile.length() == 0) { // empty config, by definition return new ArrayList<>(); } if (policy == ConfigurationFile.InteractionPolicy.NEW && (bootFile.exists() && bootFile.length() != 0)) { throw HostControllerLogger.ROOT_LOGGER.cannotOverwriteHostXmlWithEmpty(bootFile.getName()); } // if we started with new / discard but now we're reloading, ignore it. Otherwise on a reload, we have no way to drop the --empty-host-config // if we're loading a 0 byte file, treat this the same as booting with an emoty config if (bootFile.length() == 0 || (!runningModeControl.isReloaded() && (policy == ConfigurationFile.InteractionPolicy.NEW || policy == ConfigurationFile.InteractionPolicy.DISCARD))) { return new ArrayList<>(); } } return hostPersister.load(); }
@Override public List<ModelNode> load() throws ConfigurationPersistenceException { // TODO investigate replacing all this with something more like BackupXmlConfigurationPersister.isSuppressLoad if (environment.getProcessType() == ProcessType.EMBEDDED_HOST_CONTROLLER) { final ConfigurationFile configurationFile = environment.getHostConfigurationFile(); final File bootFile = configurationFile.getBootFile(); final ConfigurationFile.InteractionPolicy policy = configurationFile.getInteractionPolicy(); final HostRunningModeControl runningModeControl = environment.getRunningModeControl(); if (bootFile.exists() && bootFile.length() == 0) { // empty config, by definition return new ArrayList<>(); } if (policy == ConfigurationFile.InteractionPolicy.NEW && (bootFile.exists() && bootFile.length() != 0)) { throw HostControllerLogger.ROOT_LOGGER.cannotOverwriteHostXmlWithEmpty(bootFile.getName()); } // if we started with new / discard but now we're reloading, ignore it. Otherwise on a reload, we have no way to drop the --empty-host-config // if we're loading a 0 byte file, treat this the same as booting with an emoty config if (bootFile.length() == 0 || (!runningModeControl.isReloaded() && (policy == ConfigurationFile.InteractionPolicy.NEW || policy == ConfigurationFile.InteractionPolicy.DISCARD))) { return new ArrayList<>(); } } return hostPersister.load(); }
public HostControllerConfigurationPersister(final HostControllerEnvironment environment, final LocalHostControllerInfo localHostControllerInfo, final ExecutorService executorService, final ExtensionRegistry hostExtensionRegistry, final ExtensionRegistry extensionRegistry) { this.environment = environment; this.hostControllerInfo = localHostControllerInfo; this.executorService = executorService; this.hostExtensionRegistry = hostExtensionRegistry; this.extensionRegistry = extensionRegistry; final ConfigurationFile configurationFile = environment.getHostConfigurationFile(); final HostRunningModeControl runningModeControl = environment.getRunningModeControl(); if (runningModeControl.isReloaded()) { configurationFile.resetBootFile(runningModeControl.isUseCurrentConfig(), runningModeControl.getAndClearNewBootFileName()); } this.hostPersister = ConfigurationPersisterFactory.createHostXmlConfigurationPersister(configurationFile, environment, executorService, hostExtensionRegistry, hostControllerInfo); }
public HostControllerConfigurationPersister(final HostControllerEnvironment environment, final LocalHostControllerInfo localHostControllerInfo, final ExecutorService executorService, final ExtensionRegistry hostExtensionRegistry, final ExtensionRegistry extensionRegistry) { this.environment = environment; this.hostControllerInfo = localHostControllerInfo; this.executorService = executorService; this.hostExtensionRegistry = hostExtensionRegistry; this.extensionRegistry = extensionRegistry; final ConfigurationFile configurationFile = environment.getHostConfigurationFile(); final HostRunningModeControl runningModeControl = environment.getRunningModeControl(); if (runningModeControl.isReloaded()) { configurationFile.resetBootFile(runningModeControl.isUseCurrentConfig(), runningModeControl.getAndClearNewBootFileName()); } this.hostPersister = ConfigurationPersisterFactory.createHostXmlConfigurationPersister(configurationFile, environment, executorService, hostExtensionRegistry, hostControllerInfo); }
public HostControllerConfigurationPersister(final HostControllerEnvironment environment, final LocalHostControllerInfo localHostControllerInfo, final ExecutorService executorService, final ExtensionRegistry extensionRegistry) { this.environment = environment; this.hostControllerInfo = localHostControllerInfo; this.executorService = executorService; this.extensionRegistry = extensionRegistry; final ConfigurationFile configurationFile = environment.getHostConfigurationFile(); if (environment.getRunningModeControl().isReloaded()) { configurationFile.resetBootFile(environment.getRunningModeControl().isUseCurrentConfig()); } this.hostPersister = ConfigurationPersisterFactory.createHostXmlConfigurationPersister(configurationFile, environment.getHostControllerName()); }
throw HostControllerLogger.ROOT_LOGGER.domainConfigForReloadNotFound(domainConfig); if (hostConfig != null && !environment.getHostConfigurationFile().checkCanFindNewBootFile(hostConfig)) { throw HostControllerLogger.ROOT_LOGGER.domainConfigForReloadNotFound(hostConfig);
throw HostControllerLogger.ROOT_LOGGER.domainConfigForReloadNotFound(domainConfig); if (hostConfig != null && !environment.getHostConfigurationFile().checkCanFindNewBootFile(hostConfig)) { throw HostControllerLogger.ROOT_LOGGER.domainConfigForReloadNotFound(hostConfig);
set(result, environment.getDomainConfigurationDir()); } else if (equals(name, HOST_CONFIG_FILE)) { set(result, environment.getHostConfigurationFile()); } else if (equals(name, DOMAIN_CONFIG_FILE)) { set(result, environment.getDomainConfigurationFile());
set(result, environment.getDomainConfigurationDir()); } else if (equals(name, HOST_CONFIG_FILE)) { set(result, environment.getHostConfigurationFile()); } else if (equals(name, DOMAIN_CONFIG_FILE)) { set(result, environment.getDomainConfigurationFile());
set(result, environment.getDomainConfigurationDir()); } else if (equals(name, HOST_CONFIG_FILE)) { set(result, environment.getHostConfigurationFile()); } else if (equals(name, DOMAIN_CONFIG_FILE)) { set(result, environment.getDomainConfigurationFile());