}
final Bootstrap bootstrap = Bootstrap.Factory.newInstance();
final Bootstrap.Configuration configuration = new Bootstrap.Configuration(serverEnvironment);
configuration.setModuleLoader(Module.getBootModuleLoader());
final ExtensionRegistry extensionRegistry = configuration.getExtensionRegistry();
final AppClientXml parser = new AppClientXml(Module.getBootModuleLoader(), extensionRegistry);
final Bootstrap.ConfigurationPersisterFactory configurationPersisterFactory = new Bootstrap.ConfigurationPersisterFactory() {
@Override
public ExtensibleConfigurationPersister createConfigurationPersister(ServerEnvironment serverEnvironment, ExecutorService executorService) {
ApplicationClientConfigurationPersister persister = new ApplicationClientConfigurationPersister(earPath, deploymentName, options.hostUrl,options.propertiesFile, params,
serverEnvironment.getServerConfigurationFile().getBootFile(), rootElement, parser);
for (Namespace namespace : Namespace.values()) {
if (!namespace.equals(Namespace.CURRENT)) {
persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "server"), parser);
}
}
extensionRegistry.setWriterRegistry(persister);
return persister;
}
};
configuration.setConfigurationPersisterFactory(configurationPersisterFactory);
bootstrap.bootstrap(configuration, Collections.<ServiceActivator>emptyList()).get();