org.jboss.as.controller.parsing.Namespace.getUriString()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(17.1k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中org.jboss.as.controller.parsing.Namespace.getUriString()方法的一些代码示例,展示了Namespace.getUriString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Namespace.getUriString()方法的具体详情如下:
包路径:org.jboss.as.controller.parsing.Namespace
类名称:Namespace
方法名:getUriString

Namespace.getUriString介绍

[英]Get the URI of this namespace.
[中]获取此命名空间的URI。

代码示例

代码示例来源:origin: org.jboss.as/jboss-as-host-controller

public static ExtensibleConfigurationPersister createHostXmlConfigurationPersister(final ConfigurationFile file, String defaultHostControllerName) {
  HostXml hostXml = new HostXml(defaultHostControllerName);
  BackupXmlConfigurationPersister persister =  new BackupXmlConfigurationPersister(file, new QName(Namespace.CURRENT.getUriString(), "host"), hostXml, hostXml);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "host"), hostXml);
    }
  }
  return persister;
}

代码示例来源:origin: wildfly/wildfly-core

public static ExtensibleConfigurationPersister createRemoteBackupDomainXmlConfigurationPersister(final File configDir, ExecutorService executorService, ExtensionRegistry extensionRegistry) {
  DomainXml domainXml = new DomainXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
  File bootFile = new File(configDir, CACHED_DOMAIN_XML_BOOTFILE);
  File file = new File(configDir, CACHED_DOMAIN_XML);
  BackupRemoteDomainXmlPersister persister = new BackupRemoteDomainXmlPersister(file, bootFile, new QName(Namespace.CURRENT.getUriString(), "domain"), domainXml, domainXml);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "domain"), domainXml);
    }
  }
  extensionRegistry.setWriterRegistry(persister);
  return persister;
}

代码示例来源:origin: org.jboss.as/jboss-as-host-controller

public static ExtensibleConfigurationPersister createCachedRemoteDomainXmlConfigurationPersister(final File configDir, ExecutorService executorService, ExtensionRegistry extensionRegistry) {
  DomainXml domainXml = new DomainXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
  File file = new File(configDir, CACHED_DOMAIN_XML);
  CachedRemoteDomainXmlPersister persister = new CachedRemoteDomainXmlPersister(file, new QName(Namespace.CURRENT.getUriString(), "domain"), domainXml, domainXml);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "domain"), domainXml);
    }
  }
  extensionRegistry.setWriterRegistry(persister);
  return persister;
}

代码示例来源:origin: org.jboss.as/jboss-as-host-controller

public static ExtensibleConfigurationPersister createRemoteBackupDomainXmlConfigurationPersister(final File configDir, ExecutorService executorService, ExtensionRegistry extensionRegistry) {
  DomainXml domainXml = new DomainXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
  File file = new File(configDir, CACHED_DOMAIN_XML);
  BackupRemoteDomainXmlPersister persister = new BackupRemoteDomainXmlPersister(file, new QName(Namespace.CURRENT.getUriString(), "domain"), domainXml, domainXml);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "domain"), domainXml);
    }
  }
  extensionRegistry.setWriterRegistry(persister);
  return persister;
}

代码示例来源:origin: org.wildfly.core/wildfly-host-controller

public static ExtensibleConfigurationPersister createRemoteBackupDomainXmlConfigurationPersister(final File configDir, ExecutorService executorService, ExtensionRegistry extensionRegistry) {
  DomainXml domainXml = new DomainXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
  File bootFile = new File(configDir, CACHED_DOMAIN_XML_BOOTFILE);
  File file = new File(configDir, CACHED_DOMAIN_XML);
  BackupRemoteDomainXmlPersister persister = new BackupRemoteDomainXmlPersister(file, bootFile, new QName(Namespace.CURRENT.getUriString(), "domain"), domainXml, domainXml);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "domain"), domainXml);
    }
  }
  extensionRegistry.setWriterRegistry(persister);
  return persister;
}

代码示例来源:origin: org.jboss.as/jboss-as-server

protected void writeSchemaLocation(final XMLExtendedStreamWriter writer, final ModelNode modelNode)
    throws XMLStreamException {
  if (!modelNode.hasDefined(SCHEMA_LOCATIONS)) {
    return;
  }
  final StringBuilder b = new StringBuilder();
  final Iterator<ModelNode> iterator = modelNode.get(SCHEMA_LOCATIONS).asList().iterator();
  while (iterator.hasNext()) {
    final ModelNode location = iterator.next();
    final Property property = location.asProperty();
    b.append(property.getName()).append(' ').append(property.getValue().asString());
    if (iterator.hasNext()) {
      b.append(' ');
    }
  }
  if (b.length() > 0) {
    writer.writeAttribute(Namespace.XML_SCHEMA_INSTANCE.getUriString(), Attribute.SCHEMA_LOCATION.getLocalName(),
        b.toString());
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-server

protected void writeSchemaLocation(final XMLExtendedStreamWriter writer, final ModelNode modelNode)
    throws XMLStreamException {
  if (!modelNode.hasDefined(SCHEMA_LOCATIONS)) {
    return;
  }
  final StringBuilder b = new StringBuilder();
  final Iterator<ModelNode> iterator = modelNode.get(SCHEMA_LOCATIONS).asList().iterator();
  while (iterator.hasNext()) {
    final ModelNode location = iterator.next();
    final Property property = location.asProperty();
    b.append(property.getName()).append(' ').append(property.getValue().asString());
    if (iterator.hasNext()) {
      b.append(' ');
    }
  }
  if (b.length() > 0) {
    writer.writeAttribute(Namespace.XML_SCHEMA_INSTANCE.getUriString(), Attribute.SCHEMA_LOCATION.getLocalName(),
        b.toString());
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-host-controller

public static ExtensibleConfigurationPersister createDomainXmlConfigurationPersister(final ConfigurationFile file, ExecutorService executorService, ExtensionRegistry extensionRegistry) {
  DomainXml domainXml = new DomainXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
  BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister(file, new QName(Namespace.CURRENT.getUriString(), "domain"), domainXml, domainXml);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "domain"), domainXml);
    }
  }
  extensionRegistry.setWriterRegistry(persister);
  return persister;
}

代码示例来源:origin: org.wildfly/wildfly-server

protected void writeSchemaLocation(final XMLExtendedStreamWriter writer, final ModelNode modelNode)
    throws XMLStreamException {
  if (!modelNode.hasDefined(SCHEMA_LOCATIONS)) {
    return;
  }
  final StringBuilder b = new StringBuilder();
  final Iterator<ModelNode> iterator = modelNode.get(SCHEMA_LOCATIONS).asList().iterator();
  while (iterator.hasNext()) {
    final ModelNode location = iterator.next();
    final Property property = location.asProperty();
    b.append(property.getName()).append(' ').append(property.getValue().asString());
    if (iterator.hasNext()) {
      b.append(' ');
    }
  }
  if (b.length() > 0) {
    writer.writeAttribute(Namespace.XML_SCHEMA_INSTANCE.getUriString(), Attribute.SCHEMA_LOCATION.getLocalName(),
        b.toString());
  }
}

代码示例来源:origin: org.wildfly.swarm/container

private XmlConfigurationPersister createDelegate(File configFile) {

    QName rootElement = new QName(Namespace.CURRENT.getUriString(), "server");
    ExtensionRegistry extensionRegistry = new ExtensionRegistry(
        ProcessType.SELF_CONTAINED,
        new RunningModeControl(RunningMode.NORMAL),
        null,
        null,
        null,
        RuntimeHostControllerInfoAccessor.SERVER
    );
    StandaloneXml parser = new StandaloneXml(Module.getBootModuleLoader(), Executors.newSingleThreadExecutor(), extensionRegistry);

    XmlConfigurationPersister persister = new XmlConfigurationPersister(
        configFile, rootElement, parser, parser, false
    );

    return persister;

  }
}

代码示例来源:origin: wildfly/wildfly-core

public static ExtensibleConfigurationPersister createDomainXmlConfigurationPersister(final ConfigurationFile file, ExecutorService executorService, ExtensionRegistry extensionRegistry, final HostControllerEnvironment environment) {
  DomainXml domainXml = new DomainXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
  boolean suppressLoad = false;
  ConfigurationFile.InteractionPolicy policy = file.getInteractionPolicy();
  final boolean isReloaded = environment.getRunningModeControl().isReloaded();
  if (!isReloaded && (policy == ConfigurationFile.InteractionPolicy.NEW && (file.getBootFile().exists() && file.getBootFile().length() != 0))) {
    throw HostControllerLogger.ROOT_LOGGER.cannotOverwriteDomainXmlWithEmpty(file.getBootFile().getName());
  }
  if (!isReloaded && (policy == ConfigurationFile.InteractionPolicy.NEW || policy == ConfigurationFile.InteractionPolicy.DISCARD)) {
    suppressLoad = true;
  }
  BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister(file, new QName(Namespace.CURRENT.getUriString(), "domain"), domainXml, domainXml, suppressLoad);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "domain"), domainXml);
    }
  }
  extensionRegistry.setWriterRegistry(persister);
  return persister;
}

代码示例来源:origin: thorntail/thorntail

private XmlConfigurationPersister createDelegate(File configFile) {

    QName rootElement = new QName(Namespace.CURRENT.getUriString(), "server");
    ExtensionRegistry extensionRegistry = new ExtensionRegistry(
        ProcessType.SELF_CONTAINED,
        new RunningModeControl(RunningMode.NORMAL),
        null,
        null,
        null,
        RuntimeHostControllerInfoAccessor.SERVER
    );
    StandaloneXml parser = new StandaloneXml(Module.getBootModuleLoader(), Executors.newSingleThreadExecutor(), extensionRegistry);

    XmlConfigurationPersister persister = new XmlConfigurationPersister(
        configFile, rootElement, parser, parser, false
    );

    return persister;

  }
}

代码示例来源:origin: io.thorntail/container

private XmlConfigurationPersister createDelegate(File configFile) {

    QName rootElement = new QName(Namespace.CURRENT.getUriString(), "server");
    ExtensionRegistry extensionRegistry = new ExtensionRegistry(
        ProcessType.SELF_CONTAINED,
        new RunningModeControl(RunningMode.NORMAL),
        null,
        null,
        null,
        RuntimeHostControllerInfoAccessor.SERVER
    );
    StandaloneXml parser = new StandaloneXml(Module.getBootModuleLoader(), Executors.newSingleThreadExecutor(), extensionRegistry);

    XmlConfigurationPersister persister = new XmlConfigurationPersister(
        configFile, rootElement, parser, parser, false
    );

    return persister;

  }
}

代码示例来源:origin: org.jboss.as/jboss-as-server

protected void writeNamespaces(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
  final boolean needXsd = modelNode.hasDefined(SCHEMA_LOCATIONS) && modelNode.get(SCHEMA_LOCATIONS).asInt() > 0;
  final boolean hasNamespaces = modelNode.hasDefined(NAMESPACES);
  if (!needXsd && !hasNamespaces) {
    return;
  }
  boolean wroteXsd = false;
  final String xsdUri = Namespace.XML_SCHEMA_INSTANCE.getUriString();
  if (hasNamespaces) {
    for (final Property property : modelNode.get(NAMESPACES).asPropertyList()) {
      final String uri = property.getValue().asString();
      writer.writeNamespace(property.getName(), uri);
      if (!wroteXsd && xsdUri.equals(uri)) {
        wroteXsd = true;
      }
    }
  }
  if (needXsd && !wroteXsd) {
    writer.writeNamespace("xsd", xsdUri);
  }
}

代码示例来源:origin: org.wildfly.core/wildfly-host-controller

public static ExtensibleConfigurationPersister createDomainXmlConfigurationPersister(final ConfigurationFile file, ExecutorService executorService, ExtensionRegistry extensionRegistry, final HostControllerEnvironment environment) {
  DomainXml domainXml = new DomainXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
  boolean suppressLoad = false;
  ConfigurationFile.InteractionPolicy policy = file.getInteractionPolicy();
  final boolean isReloaded = environment.getRunningModeControl().isReloaded();
  if (!isReloaded && (policy == ConfigurationFile.InteractionPolicy.NEW && (file.getBootFile().exists() && file.getBootFile().length() != 0))) {
    throw HostControllerLogger.ROOT_LOGGER.cannotOverwriteDomainXmlWithEmpty(file.getBootFile().getName());
  }
  if (!isReloaded && (policy == ConfigurationFile.InteractionPolicy.NEW || policy == ConfigurationFile.InteractionPolicy.DISCARD)) {
    suppressLoad = true;
  }
  BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister(file, new QName(Namespace.CURRENT.getUriString(), "domain"), domainXml, domainXml, suppressLoad);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "domain"), domainXml);
    }
  }
  extensionRegistry.setWriterRegistry(persister);
  return persister;
}

代码示例来源:origin: org.wildfly.core/wildfly-server

protected void writeNamespaces(final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {
  final boolean needXsd = modelNode.hasDefined(SCHEMA_LOCATIONS) && modelNode.get(SCHEMA_LOCATIONS).asInt() > 0;
  final boolean hasNamespaces = modelNode.hasDefined(NAMESPACES);
  if (!needXsd && !hasNamespaces) {
    return;
  }
  boolean wroteXsd = false;
  final String xsdUri = Namespace.XML_SCHEMA_INSTANCE.getUriString();
  if (hasNamespaces) {
    for (final Property property : modelNode.get(NAMESPACES).asPropertyList()) {
      final String uri = property.getValue().asString();
      writer.writeNamespace(property.getName(), uri);
      if (!wroteXsd && xsdUri.equals(uri)) {
        wroteXsd = true;
      }
    }
  }
  if (needXsd && !wroteXsd) {
    writer.writeNamespace("xsd", xsdUri);
  }
}

代码示例来源:origin: org.jboss.as/jboss-as-server

@Override
  public ExtensibleConfigurationPersister createConfigurationPersister(ServerEnvironment serverEnvironment, ExecutorService executorService) {
    ConfigurationFile configurationFile = serverEnvironment.getServerConfigurationFile();
    if (runningModeControl.isReloaded()) {
      configurationFile.resetBootFile(runningModeControl.isUseCurrentConfig());
    }
    QName rootElement = new QName(Namespace.CURRENT.getUriString(), "server");
    StandaloneXml parser = new StandaloneXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
    BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister(configurationFile, rootElement, parser, parser);
    for (Namespace namespace : Namespace.domainValues()) {
      if (!namespace.equals(Namespace.CURRENT)) {
        persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "server"), parser);
      }
    }
    extensionRegistry.setWriterRegistry(persister);
    return persister;
  }
};

代码示例来源:origin: org.wildfly/wildfly-server

@Override
  public ExtensibleConfigurationPersister createConfigurationPersister(ServerEnvironment serverEnvironment, ExecutorService executorService) {
    ConfigurationFile configurationFile = serverEnvironment.getServerConfigurationFile();
    if (runningModeControl.isReloaded()) {
      configurationFile.resetBootFile(runningModeControl.isUseCurrentConfig());
    }
    QName rootElement = new QName(Namespace.CURRENT.getUriString(), "server");
    StandaloneXml parser = new StandaloneXml(Module.getBootModuleLoader(), executorService, extensionRegistry);
    BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister(configurationFile, rootElement, parser, parser);
    for (Namespace namespace : Namespace.domainValues()) {
      if (!namespace.equals(Namespace.CURRENT)) {
        persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "server"), parser);
      }
    }
    extensionRegistry.setWriterRegistry(persister);
    return persister;
  }
};

代码示例来源:origin: org.jboss.as/jboss-as-appclient

@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.domainValues()) {
      if (!namespace.equals(Namespace.CURRENT)) {
        persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "server"), parser);
      }
    }
    extensionRegistry.setWriterRegistry(persister);
    return persister;
  }
};

代码示例来源:origin: org.wildfly.core/wildfly-host-controller

public static ExtensibleConfigurationPersister createHostXmlConfigurationPersister(final ConfigurationFile file, final HostControllerEnvironment environment,
                                          final ExecutorService executorService, final ExtensionRegistry hostExtensionRegistry,
                                          final LocalHostControllerInfo localHostControllerInfo) {
  String defaultHostname = localHostControllerInfo.getLocalHostName();
  if (environment.getRunningModeControl().isReloaded()) {
    if (environment.getRunningModeControl().getReloadHostName() != null) {
      defaultHostname = environment.getRunningModeControl().getReloadHostName();
    }
  }
  HostXml hostXml = new HostXml(defaultHostname, environment.getRunningModeControl().getRunningMode(),
      environment.isUseCachedDc(), Module.getBootModuleLoader(), executorService, hostExtensionRegistry);
  BackupXmlConfigurationPersister persister = new BackupXmlConfigurationPersister(file, new QName(Namespace.CURRENT.getUriString(), "host"), hostXml, hostXml, false);
  for (Namespace namespace : Namespace.domainValues()) {
    if (!namespace.equals(Namespace.CURRENT)) {
      persister.registerAdditionalRootElement(new QName(namespace.getUriString(), "host"), hostXml);
    }
  }
  hostExtensionRegistry.setWriterRegistry(persister);
  return persister;
}

相关文章