Java Code Examples for org.jboss.as.controller.parsing.Namespace#forUri()
The following examples show how to use
org.jboss.as.controller.parsing.Namespace#forUri() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DomainXml_Legacy.java From wildfly-core with GNU Lesser General Public License v2.1 | 6 votes |
private void readDomainElementAttributes_1_0(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { switch (Namespace.forUri(reader.getAttributeNamespace(i))) { case XML_SCHEMA_INSTANCE: { switch (Attribute.forName(reader.getAttributeLocalName(i))) { case SCHEMA_LOCATION: { parseSchemaLocations(reader, address, list, i); break; } case NO_NAMESPACE_SCHEMA_LOCATION: { // todo, jeez break; } default: { throw unexpectedAttribute(reader, i); } } break; } default: throw unexpectedAttribute(reader, i); } } }
Example 2
Source File: HostXml_Legacy.java From wildfly-core with GNU Lesser General Public License v2.1 | 6 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { final ModelNode address = new ModelNode().setEmptyList(); if (Element.forName(reader.getLocalName()) != Element.HOST) { throw unexpectedElement(reader); } Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); if (readerNS == DOMAIN_1_0) { readHostElement_1_0(reader, address, operationList); } else if (readerNS.getMajorVersion() == 1 || readerNS.getMajorVersion() == 2) { readHostElement_1_1(readerNS, reader, address, operationList); } else { // Instead of having to list the remaining versions we just check it is actually a valid version. for (Namespace current : Namespace.domainValues()) { if (readerNS.equals(current)) { readHostElement_3_0(readerNS, reader, address, operationList); return; } } throw unexpectedElement(reader); } }
Example 3
Source File: DomainXml_Legacy.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> nodes) throws XMLStreamException { if (Element.forName(reader.getLocalName()) != Element.DOMAIN) { throw unexpectedElement(reader); } Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); switch (readerNS) { case DOMAIN_1_0: { readDomainElement1_0(reader, new ModelNode(), nodes); break; } case DOMAIN_1_1: case DOMAIN_1_2: readDomainElement1_1(reader, new ModelNode(), nodes); break; case DOMAIN_1_3: readDomainElement1_3(reader, new ModelNode(), nodes); break; case DOMAIN_1_4: readDomainElement1_4(reader, new ModelNode(), nodes); break; default: // Instead of having to list the remaining versions we just check it is actually a valid version. for (Namespace current : Namespace.domainValues()) { if (readerNS.equals(current)) { readDomainElement2_0(reader, new ModelNode(), nodes); return; } } throw unexpectedElement(reader); } }
Example 4
Source File: DomainXml_Legacy.java From wildfly-core with GNU Lesser General Public License v2.1 | 5 votes |
private void readDomainElementAttributes_1_3(XMLExtendedStreamReader reader, ModelNode address, List<ModelNode> list) throws XMLStreamException { final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { Namespace ns = Namespace.forUri(reader.getAttributeNamespace(i)); switch (ns) { case XML_SCHEMA_INSTANCE: { switch (Attribute.forName(reader.getAttributeLocalName(i))) { case SCHEMA_LOCATION: { parseSchemaLocations(reader, address, list, i); break; } case NO_NAMESPACE_SCHEMA_LOCATION: { // todo, jeez break; } default: { throw unexpectedAttribute(reader, i); } } break; } default: switch (Attribute.forName(reader.getAttributeLocalName(i))) { case NAME: ModelNode op = new ModelNode(); op.get(OP).set(WRITE_ATTRIBUTE_OPERATION); op.get(NAME).set(NAME); op.get(VALUE).set(ParseUtils.parsePossibleExpression(reader.getAttributeValue(i))); list.add(op); break; default: throw unexpectedAttribute(reader, i); } } } }
Example 5
Source File: HostXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); switch (readerNS.getMajorVersion()) { case 1: case 2: case 3: new HostXml_Legacy(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 4: new HostXml_4(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 5: new HostXml_5(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 6: new HostXml_6(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 7: new HostXml_7(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 8: new HostXml_8(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 9: new HostXml_9(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 10: new HostXml_10(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 11: new HostXml_11(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 12: new HostXml_12(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; case 13: new HostXml_13(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); break; default: new HostXml_14(defaultHostControllerName, runningMode, isCachedDc, extensionRegistry, extensionXml, readerNS).readElement(reader, operationList); } }
Example 6
Source File: DomainXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> nodes) throws XMLStreamException { Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); switch (readerNS.getMajorVersion()) { case 1: case 2: case 3: new DomainXml_Legacy(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 4: new DomainXml_4(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 5: new DomainXml_5(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 6: new DomainXml_6(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 7: new DomainXml_7(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 8: new DomainXml_8(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 9: new DomainXml_9(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 10: new DomainXml_10(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 11: new DomainXml_11(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 12: new DomainXml_12(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; case 13: new DomainXml_13(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); break; default: new DomainXml_14(extensionXml, extensionRegistry, readerNS).readElement(reader, nodes); } }
Example 7
Source File: HostXml_Legacy.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
private void readHostElement_1_0(final XMLExtendedStreamReader reader, final ModelNode address, final List<ModelNode> list) throws XMLStreamException { String hostName = null; // Deffer adding the namespaces and schema locations until after the host has been created. List<ModelNode> namespaceOperations = new LinkedList<ModelNode>(); parseNamespaces(reader, address, namespaceOperations); // attributes final int count = reader.getAttributeCount(); for (int i = 0; i < count; i++) { switch (Namespace.forUri(reader.getAttributeNamespace(i))) { case NONE: { final String value = reader.getAttributeValue(i); final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i)); switch (attribute) { case NAME: { hostName = value; break; } default: throw unexpectedAttribute(reader, i); } break; } case XML_SCHEMA_INSTANCE: { switch (Attribute.forName(reader.getAttributeLocalName(i))) { case SCHEMA_LOCATION: { parseSchemaLocations(reader, address, namespaceOperations, i); break; } case NO_NAMESPACE_SCHEMA_LOCATION: { // todo, jeez break; } default: { throw unexpectedAttribute(reader, i); } } break; } default: throw unexpectedAttribute(reader, i); } } // The following also updates the address parameter so this address can be used for future operations // in the context of this host. final ModelNode hostAddOp = addLocalHost(address, list, hostName); // The namespace operations were created before the host name was known, the address can now be updated // to the local host specific address. for (ModelNode operation : namespaceOperations) { operation.get(OP_ADDR).set(address); list.add(operation); } // Content // Handle elements: sequence Element element = nextElement(reader, DOMAIN_1_0); if (element == Element.SYSTEM_PROPERTIES) { parseSystemProperties(reader, address, DOMAIN_1_0, list, false); element = nextElement(reader, DOMAIN_1_0); } if (element == Element.PATHS) { parsePaths(reader, address, DOMAIN_1_0, list, true); element = nextElement(reader, DOMAIN_1_0); } if (element == Element.MANAGEMENT) { ManagementXml managementXml = ManagementXml.newInstance(DOMAIN_1_0, this, false); managementXml.parseManagement(reader, address, list, false); element = nextElement(reader, DOMAIN_1_0); } if (element == Element.DOMAIN_CONTROLLER) { parseDomainController(reader, address, list, hostAddOp); element = nextElement(reader, DOMAIN_1_0); } final Set<String> interfaceNames = new HashSet<String>(); if (element == Element.INTERFACES) { parseInterfaces(reader, interfaceNames, address, DOMAIN_1_0, list, true); element = nextElement(reader, DOMAIN_1_0); } if (element == Element.JVMS) { parseJvms(reader, address, list); element = nextElement(reader, DOMAIN_1_0); } if (element == Element.SERVERS) { parseServers_1_0(reader, address, list); element = nextElement(reader, DOMAIN_1_0); } if (element != null) { throw unexpectedElement(reader); } }
Example 8
Source File: StandaloneXml_Legacy.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { long start = System.currentTimeMillis(); final ModelNode address = new ModelNode().setEmptyList(); if (Element.forName(reader.getLocalName()) != Element.SERVER) { throw unexpectedElement(reader); } Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); switch (readerNS) { case DOMAIN_1_0: { readServerElement_1_0(reader, address, operationList); break; } case DOMAIN_1_1: case DOMAIN_1_2: case DOMAIN_1_3: readServerElement_1_1(readerNS, reader, address, operationList); break; default: // Instead of having to list the remaining versions we just check it is actually a valid version. boolean validNamespace = false; for (Namespace current : Namespace.domainValues()) { if (readerNS.equals(current)) { validNamespace = true; readServerElement_1_4(readerNS, reader, address, operationList); break; } } if (validNamespace == false) { throw unexpectedElement(reader); } } if (ServerLogger.ROOT_LOGGER.isDebugEnabled()) { long elapsed = System.currentTimeMillis() - start; ServerLogger.ROOT_LOGGER.debugf("Parsed standalone configuration in [%d] ms", elapsed); } }
Example 9
Source File: StandaloneXml.java From wildfly-core with GNU Lesser General Public License v2.1 | 4 votes |
@Override public void readElement(final XMLExtendedStreamReader reader, final List<ModelNode> operationList) throws XMLStreamException { Namespace readerNS = Namespace.forUri(reader.getNamespaceURI()); switch (readerNS.getMajorVersion()) { case 1: case 2: case 3: new StandaloneXml_Legacy(extensionHandler, readerNS, deferredExtensionContext, parsingOptions) .readElement(reader, operationList); break; case 4: new StandaloneXml_4(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 5: new StandaloneXml_5(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 6: new StandaloneXml_6(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 7: new StandaloneXml_7(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 8: new StandaloneXml_8(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 9: new StandaloneXml_9(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 10: new StandaloneXml_10(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 11: new StandaloneXml_11(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 12: new StandaloneXml_12(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; case 13: new StandaloneXml_13(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); break; default: new StandaloneXml_14(extensionHandler, readerNS, deferredExtensionContext, parsingOptions).readElement(reader, operationList); } }