• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SubsystemMarshallingContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.as.controller.persistence.SubsystemMarshallingContext的典型用法代码示例。如果您正苦于以下问题:Java SubsystemMarshallingContext类的具体用法?Java SubsystemMarshallingContext怎么用?Java SubsystemMarshallingContext使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SubsystemMarshallingContext类属于org.jboss.as.controller.persistence包,在下文中一共展示了SubsystemMarshallingContext类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: modelToXml

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
public String modelToXml(String subsystemName, String childType, XMLElementWriter<SubsystemMarshallingContext> parser) throws Exception {
    final ModelNode address = new ModelNode();
    address.add("subsystem", subsystemName);
    address.protect();

    final ModelNode operation = new ModelNode();
    operation.get(OP).set("read-children-resources");
    operation.get("child-type").set(childType);
    operation.get(RECURSIVE).set(true);
    operation.get(OP_ADDR).set(address);

    final ModelNode result = executeOperation(operation);
    Assert.assertNotNull(result);

    ModelNode dsNode = new ModelNode();
    dsNode.get(childType).set(result);

    StringWriter strWriter = new StringWriter();
    XMLExtendedStreamWriter writer = XMLExtendedStreamWriterFactory.create(XMLOutputFactory.newInstance()
            .createXMLStreamWriter(strWriter));
    parser.writeContent(writer, new SubsystemMarshallingContext(dsNode, writer));
    writer.flush();
    return strWriter.toString();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:AbstractMgmtTestBase.java


示例2: writeProfile

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
private void writeProfile(final XMLExtendedStreamWriter writer, final String profileName, final ModelNode profileNode, final ModelMarshallingContext context) throws XMLStreamException {

        writer.writeStartElement(Element.PROFILE.getLocalName());
        writer.writeAttribute(Attribute.NAME.getLocalName(), profileName);
        ProfileResourceDefinition.INCLUDES.getMarshaller().marshallAsAttribute(ProfileResourceDefinition.INCLUDES, profileNode, false, writer);

        if (profileNode.hasDefined(SUBSYSTEM)) {
            final Set<String> subsystemNames = profileNode.get(SUBSYSTEM).keys();
            if (subsystemNames.size() > 0) {
                String defaultNamespace = writer.getNamespaceContext().getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
                for (String subsystemName : subsystemNames) {
                    try {
                        ModelNode subsystem = profileNode.get(SUBSYSTEM, subsystemName);
                        XMLElementWriter<SubsystemMarshallingContext> subsystemWriter = context.getSubsystemWriter(subsystemName);
                        if (subsystemWriter != null) { // FIXME -- remove when extensions are doing the registration
                            subsystemWriter.writeContent(writer, new SubsystemMarshallingContext(subsystem, writer));
                        }
                    } finally {
                        writer.setDefaultNamespace(defaultNamespace);
                    }
                }
            }
        }
        writer.writeEndElement();
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:26,代码来源:DomainXml_6.java


示例3: wrapPossibleHost

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
private ModelMarshallingContext wrapPossibleHost(final ModelMarshallingContext context) {

        if (type == TestModelType.HOST) {
            return new ModelMarshallingContext() {

                @Override
                public XMLElementWriter<SubsystemMarshallingContext> getSubsystemWriter(String subsystemName) {
                    return context.getSubsystemWriter(subsystemName);
                }

                @Override
                public ModelNode getModelNode() {
                    return context.getModelNode().get(ModelDescriptionConstants.HOST, "master");
                }
            };
        }

        return context;
    }
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:20,代码来源:TestParser.java


示例4: sanitizeContext

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
private ModelMarshallingContext sanitizeContext(final ModelMarshallingContext context) {
    if (writeSanitizers == null) {
        return context;
    }

    ModelNode model = context.getModelNode();
    for (ModelWriteSanitizer sanitizer : writeSanitizers) {
        model = sanitizer.sanitize(model);
    }

    final ModelNode theModel = model;
    return new ModelMarshallingContext() {

        @Override
        public XMLElementWriter<SubsystemMarshallingContext> getSubsystemWriter(String subsystemName) {
            return context.getSubsystemWriter(subsystemName);
        }

        @Override
        public ModelNode getModelNode() {
            return theModel;
        }
    };
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:25,代码来源:TestParser.java


示例5: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
@Override
public void writeContent(XMLExtendedStreamWriter writer, ModelMarshallingContext context) throws XMLStreamException {

    String defaultNamespace = writer.getNamespaceContext().getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
    try {
        ModelNode subsystems = context.getModelNode().get(SUBSYSTEM);
        if (subsystems.has(mainSubsystemName)) {
            ModelNode subsystem = subsystems.get(mainSubsystemName);
            //We might have been removed
            XMLElementWriter<SubsystemMarshallingContext> subsystemWriter = context.getSubsystemWriter(mainSubsystemName);
            if (subsystemWriter != null) {
                subsystemWriter.writeContent(writer, new SubsystemMarshallingContext(subsystem, writer));
            }
        }else{
            writer.writeEmptyElement(Element.SUBSYSTEM.getLocalName());
        }
    }catch (Throwable t){
        Assert.fail("could not marshal subsystem xml: "+t.getMessage()+":\n"+ Arrays.toString(t.getStackTrace()).replaceAll(", ","\n"));
    } finally {
        writer.setDefaultNamespace(defaultNamespace);
    }
    writer.writeEndDocument();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:24,代码来源:TestParser.java


示例6: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
    ModelNode node = context.getModelNode();

    if (node.hasDefined(ModelConstants.CONTEXT)) {
        ModelNode properties = node.get(ModelConstants.CONTEXT);
        for (String key : new TreeSet<String>(properties.keys())) {
            String val = properties.get(key).get(ModelConstants.VALUE).asString();
            writer.writeStartElement(Element.CAMEL_CONTEXT.getLocalName());
            writer.writeAttribute(Attribute.ID.getLocalName(), key);
            writer.writeCharacters(val);
            writer.writeEndElement();
        }
    }

    writer.writeEndElement();
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:19,代码来源:CamelSubsystemWriter.java


示例7: writeJobExecutorContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
private void writeJobExecutorContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException {
  ModelNode node = context.getModelNode();
  ModelNode jobExecutorNode = node.get(Element.JOB_EXECUTOR.getLocalName());
  
  if (jobExecutorNode.isDefined()) { 
    writer.writeStartElement(Element.JOB_EXECUTOR.getLocalName());
    
    Property property = jobExecutorNode.asProperty();
    writeElement(Element.THREAD_POOL_NAME, writer, property.getValue());
    
    writeJobAcquisitionsContent(writer, context, property.getValue());
    
    // end job-executor
    writer.writeEndElement();
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:BpmPlatformParser.java


示例8: writeJobAcquisitionsContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
private void writeJobAcquisitionsContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context, ModelNode parentNode) throws XMLStreamException {
  writer.writeStartElement(Element.JOB_AQUISITIONS.getLocalName());

  ModelNode jobAcquisitionConfigurations = parentNode.get(Element.JOB_AQUISITIONS.getLocalName());
  if (jobAcquisitionConfigurations.isDefined()) {
    for (Property property : jobAcquisitionConfigurations.asPropertyList()) {
      // write each child element to xml
      writer.writeStartElement(Element.JOB_AQUISITION.getLocalName());
      
      writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
      ModelNode entry = property.getValue();

      writeElement(Element.ACQUISITION_STRATEGY, writer, entry);
      
      writeProperties(writer, entry);

      writer.writeEndElement();
    }
  }
  // end job-acquisitions
  writer.writeEndElement();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:BpmPlatformParser.java


示例9: writeJobExecutorContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
protected void writeJobExecutorContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException {
  ModelNode node = context.getModelNode();
  ModelNode jobExecutorNode = node.get(Element.JOB_EXECUTOR.getLocalName());

  if (jobExecutorNode.isDefined()) {

    writer.writeStartElement(Element.JOB_EXECUTOR.getLocalName());

    for (Property property : jobExecutorNode.asPropertyList()) {
      ModelNode propertyValue = property.getValue();

      for (AttributeDefinition jobExecutorAttribute : SubsystemAttributeDefinitons.JOB_EXECUTOR_ATTRIBUTES) {
        if (jobExecutorAttribute.equals(SubsystemAttributeDefinitons.NAME)) {
          ((SimpleAttributeDefinition) jobExecutorAttribute).marshallAsAttribute(propertyValue, writer);
        } else {
          jobExecutorAttribute.marshallAsElement(propertyValue, writer);
        }
      }

      writeJobAcquisitionsContent(writer, context, propertyValue);
    }

    // end job-executor
    writer.writeEndElement();
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:BpmPlatformParser1_1.java


示例10: writeJobAcquisitionsContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
protected void writeJobAcquisitionsContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context, ModelNode parentNode) throws XMLStreamException {
  writer.writeStartElement(Element.JOB_AQUISITIONS.getLocalName());

  ModelNode jobAcquisitionConfigurations = parentNode.get(Element.JOB_AQUISITIONS.getLocalName());
  if (jobAcquisitionConfigurations.isDefined()) {

    for (Property property : jobAcquisitionConfigurations.asPropertyList()) {
      // write each child element to xml
      writer.writeStartElement(Element.JOB_AQUISITION.getLocalName());

      for (AttributeDefinition jobAcquisitionAttribute : SubsystemAttributeDefinitons.JOB_ACQUISITION_ATTRIBUTES) {
        if (jobAcquisitionAttribute.equals(SubsystemAttributeDefinitons.NAME)) {
          ((SimpleAttributeDefinition) jobAcquisitionAttribute).marshallAsAttribute(property.getValue(), writer);
        } else {
          jobAcquisitionAttribute.marshallAsElement(property.getValue(), writer);
        }
      }

      writer.writeEndElement();
    }
  }
  // end job-acquisitions
  writer.writeEndElement();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:BpmPlatformParser1_1.java


示例11: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);

    final ModelNode node = context.getModelNode();
    final ModelNode mbean = node.get(SmppMbeanDefinition.MBEAN);

    for (Property mbeanProp : mbean.asPropertyList()) {
        writer.writeStartElement(SmppMbeanDefinition.MBEAN);

        final ModelNode mbeanEntry = mbeanProp.getValue();

        SmppMbeanDefinition.NAME_ATTR.marshallAsAttribute(mbeanEntry, true, writer);
        SmppMbeanDefinition.TYPE_ATTR.marshallAsAttribute(mbeanEntry, true, writer);

        final ModelNode property = mbeanEntry.get(SmppMbeanPropertyDefinition.PROPERTY);
        if (property != null && property.isDefined()) {
            for (Property propertyProp : property.asPropertyList()) {
                writer.writeStartElement(SmppMbeanPropertyDefinition.PROPERTY);

                final ModelNode propertyEntry = propertyProp.getValue();

                SmppMbeanPropertyDefinition.NAME_ATTR.marshallAsAttribute(propertyEntry, true, writer);
                SmppMbeanPropertyDefinition.TYPE_ATTR.marshallAsAttribute(propertyEntry, true, writer);
                SmppMbeanPropertyDefinition.VALUE_ATTR.marshallAsAttribute(propertyEntry, true, writer);

                writer.writeEndElement();
            }
        }

        writer.writeEndElement();
    }

    writer.writeEndElement();
}
 
开发者ID:RestComm,项目名称:smpp-extensions,代码行数:39,代码来源:SmppSubsystemParser.java


示例12: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
@Override
public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context)
        throws XMLStreamException {
    ModelNode node = context.getModelNode();

    // <subsystem>
    context.startSubsystemElement(NestSubsystemExtension.NAMESPACE, false);
    writer.writeAttribute(NEST_ENABLED_ATTR, node.get(NEST_ENABLED_ATTR).asString());

    // our config elements
    writeElement(writer, node, NEST_NAME_ELEMENT);

    // <custom-configuration>
    writer.writeStartElement(CUSTOM_CONFIG_ELEMENT);
    ModelNode configNode = node.get(CUSTOM_CONFIG_ELEMENT);
    if (configNode != null && configNode.isDefined()) {
        for (Property property : configNode.asPropertyList()) {
            // <propery>
            writer.writeStartElement(PROPERTY_ELEMENT);
            writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
            writer.writeAttribute(Attribute.VALUE.getLocalName(), property.getValue().asString());
            // </property>
            writer.writeEndElement();
        }
    }
    // </custom-configuration>
    writer.writeEndElement();

    // </subsystem>
    writer.writeEndElement();
}
 
开发者ID:hawkular,项目名称:hawkular-commons,代码行数:32,代码来源:NestSubsystemExtension.java


示例13: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(OpenShiftSubsystemExtension.NAMESPACE, false);

    ModelNode node = context.getModelNode();

    if(node.hasDefined(Constants.MAX_LINE_LENGTH)) {
        OpenShiftSubsystemDefinition.MAX_LINE_LENGTH.marshallAsElement(node, writer);
    }

    ModelNode metricsGroups = node.get(Constants.METRICS_GROUP);
    writeMetricsGroups(writer, metricsGroups);
    writer.writeEndElement();
}
 
开发者ID:ncdc,项目名称:jboss-openshift-metrics-module,代码行数:18,代码来源:OpenShiftSubsystemParser.java


示例14: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context)
        throws XMLStreamException {
    context.startSubsystemElement(OrderedChildResourceExtension.NAMESPACE, false);
    final ModelNode node = context.getModelNode();
    if (node.hasDefined("child")) {
        for (Property prop : node.get("child").asPropertyList()) {
            writer.writeStartElement("child");
            writer.writeAttribute("name", prop.getName());
            writer.writeEndElement();
        }
    }
    writer.writeEndElement();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:15,代码来源:OrderedChildResourceExtension.java


示例15: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
@Override
public void writeContent(final XMLExtendedStreamWriter writer, final SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);

    ModelNode model = context.getModelNode();

    // Marshall attributes
    for (AttributeDefinition attribute : LoggingResourceDefinition.ATTRIBUTES) {
        attribute.marshallAsElement(model, false, writer);
    }

    writeContent(writer, model);

    if (model.hasDefined(LOGGING_PROFILE)) {
        final List<Property> profiles = model.get(LOGGING_PROFILE).asPropertyList();
        if (!profiles.isEmpty()) {
            writer.writeStartElement(LOGGING_PROFILES);
            for (Property profile : profiles) {
                final String name = profile.getName();
                writer.writeStartElement(LOGGING_PROFILE);
                writer.writeAttribute(Attribute.NAME.getLocalName(), name);
                writeContent(writer, profile.getValue());
                writer.writeEndElement();
            }
            writer.writeEndElement();
        }
    }
    writer.writeEndElement();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:30,代码来源:LoggingSubsystemWriter.java


示例16: writeHostProfile

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
private void writeHostProfile(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context)
        throws XMLStreamException {

    final ModelNode profileNode = context.getModelNode();
    // In case there are no subsystems defined
    if (!profileNode.hasDefined(SUBSYSTEM)) {
        return;
    }

    writer.writeStartElement(Element.PROFILE.getLocalName());
    Set<String> subsystemNames = profileNode.get(SUBSYSTEM).keys();
    if (subsystemNames.size() > 0) {
        String defaultNamespace = writer.getNamespaceContext().getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
        for (String subsystemName : subsystemNames) {
            try {
                ModelNode subsystem = profileNode.get(SUBSYSTEM, subsystemName);
                XMLElementWriter<SubsystemMarshallingContext> subsystemWriter = context.getSubsystemWriter(subsystemName);
                if (subsystemWriter != null) { // FIXME -- remove when extensions are doing the registration
                    subsystemWriter.writeContent(writer, new SubsystemMarshallingContext(subsystem, writer));
                }
            } finally {
                writer.setDefaultNamespace(defaultNamespace);
            }
        }
    }
    writer.writeEndElement();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:28,代码来源:HostXml_6.java


示例17: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    PersistentResourceXMLDescription description = getParserDescription();
    ModelNode model = new ModelNode();
    model.get(description.getPathElement().getKeyValuePair()).set(context.getModelNode());
    description.persist(writer, model);
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:8,代码来源:PersistentResourceXMLParser.java


示例18: writeServerProfile

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
private void writeServerProfile(final XMLExtendedStreamWriter writer, final ModelMarshallingContext context)
        throws XMLStreamException {

    final ModelNode profileNode = context.getModelNode();
    // In case there are no subsystems defined
    if (!profileNode.hasDefined(SUBSYSTEM)) {
        return;
    }

    writer.writeStartElement(Element.PROFILE.getLocalName());
    Set<String> subsystemNames = profileNode.get(SUBSYSTEM).keys();
    if (subsystemNames.size() > 0) {
        String defaultNamespace = writer.getNamespaceContext().getNamespaceURI(XMLConstants.DEFAULT_NS_PREFIX);
        for (String subsystemName : subsystemNames) {
            try {
                ModelNode subsystem = profileNode.get(SUBSYSTEM, subsystemName);
                XMLElementWriter<SubsystemMarshallingContext> subsystemWriter = context.getSubsystemWriter(subsystemName);
                if (subsystemWriter != null) { // FIXME -- remove when extensions are doing the registration
                    subsystemWriter.writeContent(writer, new SubsystemMarshallingContext(subsystem, writer));
                }
            } finally {
                writer.setDefaultNamespace(defaultNamespace);
            }
        }
    }
    writer.writeEndElement();
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:28,代码来源:StandaloneXml_6.java


示例19: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
    ModelNode scanners = context.getModelNode();
    for (final Property list : scanners.asPropertyList()) {

        final ModelNode node = list.getValue();

        for (final Property scanner : node.asPropertyList()) {

            final String scannerName = scanner.getName();
            final ModelNode configuration = scanner.getValue();

            writer.writeEmptyElement(DEPLOYMENT_SCANNER);

            if (!DeploymentScannerExtension.DEFAULT_SCANNER_NAME.equals(scannerName)) {
                writer.writeAttribute(NAME, scannerName);
            }

            DeploymentScannerDefinition.PATH.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.RELATIVE_TO.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.SCAN_ENABLED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.SCAN_INTERVAL.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_ZIPPED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_EXPLODED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_XML.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.DEPLOYMENT_TIMEOUT.marshallAsAttribute(configuration, writer);
        }
        writer.writeEndElement();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:35,代码来源:DeploymentScannerParser_1_1.java


示例20: writeContent

import org.jboss.as.controller.persistence.SubsystemMarshallingContext; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeContent(XMLExtendedStreamWriter writer, SubsystemMarshallingContext context) throws XMLStreamException {
    context.startSubsystemElement(Namespace.CURRENT.getUriString(), false);
    ModelNode scanners = context.getModelNode();
    for (final Property list : scanners.asPropertyList()) {

        final ModelNode node = list.getValue();

        for (final Property scanner : node.asPropertyList()) {

            final String scannerName = scanner.getName();
            final ModelNode configuration = scanner.getValue();

            writer.writeEmptyElement(DEPLOYMENT_SCANNER);

            if (!DeploymentScannerExtension.DEFAULT_SCANNER_NAME.equals(scannerName)) {
                writer.writeAttribute(NAME, scannerName);
            }

            DeploymentScannerDefinition.PATH.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.RELATIVE_TO.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.SCAN_ENABLED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.SCAN_INTERVAL.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_ZIPPED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_EXPLODED.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.AUTO_DEPLOY_XML.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.DEPLOYMENT_TIMEOUT.marshallAsAttribute(configuration, writer);
            DeploymentScannerDefinition.RUNTIME_FAILURE_CAUSES_ROLLBACK.marshallAsAttribute(configuration, writer);
        }
        writer.writeEndElement();
    }
}
 
开发者ID:wildfly,项目名称:wildfly-core,代码行数:36,代码来源:DeploymentScannerParser_2_0.java



注:本文中的org.jboss.as.controller.persistence.SubsystemMarshallingContext类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java StdCouchDbInstance类代码示例发布时间:2022-05-21
下一篇:
Java Form类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap