if (serverEnvironment == null) {
final ModuleLoader localModuleLoader = this.moduleLoader;
configurationPersisterFactory = new ConfigurationPersisterFactory() {
@Override
public ExtensibleConfigurationPersister createConfigurationPersister(ServerEnvironment serverEnvironment, ExecutorService executorService) {
return new NullConfigurationPersister(new StandaloneXml(localModuleLoader, executorService));
}
};
}
else {
configurationPersisterFactory = new ConfigurationPersisterFactory() {
@Override
public ExtensibleConfigurationPersister createConfigurationPersister(ServerEnvironment serverEnvironment, ExecutorService executorService) {
QName rootElement = new QName(Namespace.CURRENT.getUriString(), "server");
StandaloneXml parser = new StandaloneXml(Module.getBootModuleLoader(), executorService);
BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister(serverEnvironment.getServerConfigurationFile(), rootElement, parser, parser);
persister.registerAdditionalRootElement(new QName(Namespace.DOMAIN_1_0.getUriString(), "server"), parser);
return persister;
}
};