Esempio n. 1
0
  private void writeDomainDeployments(
      final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {

    final Set<String> deploymentNames = modelNode.keys();
    if (deploymentNames.size() > 0) {
      writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
      for (String uniqueName : deploymentNames) {
        final ModelNode deployment = modelNode.get(uniqueName);
        final String runtimeName = deployment.get(RUNTIME_NAME).asString();
        writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
        writeAttribute(writer, Attribute.NAME, uniqueName);
        writeAttribute(writer, Attribute.RUNTIME_NAME, runtimeName);
        final List<ModelNode> contentItems = deployment.require(CONTENT).asList();
        for (ModelNode contentItem : contentItems) {
          writeContentItem(writer, contentItem);
        }
        writer.writeEndElement();
      }
      writer.writeEndElement();
    }
  }
Esempio n. 2
0
  private void writeServerGroupDeployments(
      final XMLExtendedStreamWriter writer, final ModelNode modelNode) throws XMLStreamException {

    final Set<String> deploymentNames = modelNode.keys();
    if (deploymentNames.size() > 0) {
      writer.writeStartElement(Element.DEPLOYMENTS.getLocalName());
      for (String uniqueName : deploymentNames) {
        final ModelNode deployment = modelNode.get(uniqueName);
        final String runtimeName = deployment.get(RUNTIME_NAME).asString();
        final boolean enabled =
            !deployment.hasDefined(ENABLED) || deployment.get(ENABLED).asBoolean();
        writer.writeStartElement(Element.DEPLOYMENT.getLocalName());
        writeAttribute(writer, Attribute.NAME, uniqueName);
        writeAttribute(writer, Attribute.RUNTIME_NAME, runtimeName);
        if (!enabled) {
          writeAttribute(writer, Attribute.ENABLED, Boolean.FALSE.toString());
        }
        writer.writeEndElement();
      }
      writer.writeEndElement();
    }
  }