final ProductConfig productConfig = new ProductConfig(Module.getBootModuleLoader(), home);
// Create server environment on the server, so that the system properties are getting initialized on the right side
final ServerEnvironment providedEnvironment = new ServerEnvironment(hostControllerName, properties,
SecurityActions.getSystemEnvironment(), null, ServerEnvironment.LaunchType.DOMAIN, RunningMode.NORMAL, productConfig);
final Bootstrap.Configuration configuration = new Bootstrap.Configuration(providedEnvironment);
final ExtensionRegistry extensionRegistry = configuration.getExtensionRegistry();
final Bootstrap.ConfigurationPersisterFactory configurationPersisterFactory = new Bootstrap.ConfigurationPersisterFactory() {
@Override
public ExtensibleConfigurationPersister createConfigurationPersister(ServerEnvironment serverEnvironment, ExecutorService executorService) {
ExtensibleConfigurationPersister persister = new AbstractConfigurationPersister(new StandaloneXml(configuration.getModuleLoader(), executorService, extensionRegistry)) {
private final PersistenceResource pr = new PersistenceResource() {
@Override
public void commit() {
}
@Override
public void rollback() {
}
};
@Override
public PersistenceResource store(final ModelNode model, Set<PathAddress> affectedAddresses) throws ConfigurationPersistenceException {
return pr;
}
@Override
public List<ModelNode> load() throws ConfigurationPersistenceException {
return updates;
}
};
extensionRegistry.setWriterRegistry(persister);
return persister;
}
};
configuration.setConfigurationPersisterFactory(configurationPersisterFactory);
return bootstrap.bootstrap(configuration, startServices);