예제 #1
0
  private static void writeAcceptorContent(
      final XMLExtendedStreamWriter writer, final Property property) throws XMLStreamException {
    writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
    final ModelNode value = property.getValue();

    RemoteTransportDefinition.SOCKET_BINDING.marshallAsAttribute(value, writer);
    InVMTransportDefinition.SERVER_ID.marshallAsAttribute(value, writer);
    CommonAttributes.FACTORY_CLASS.marshallAsElement(value, writer);

    writeTransportParam(writer, value.get(PARAM));
  }
예제 #2
0
 private static void writeConnectors(final XMLExtendedStreamWriter writer, final ModelNode node)
     throws XMLStreamException {
   if (node.hasDefined(CONNECTOR)
       || node.hasDefined(REMOTE_CONNECTOR)
       || node.hasDefined(IN_VM_CONNECTOR)) {
     writer.writeStartElement(Element.CONNECTORS.getLocalName());
     if (node.hasDefined(REMOTE_CONNECTOR)) {
       for (final Property property : node.get(REMOTE_CONNECTOR).asPropertyList()) {
         writer.writeStartElement(Element.NETTY_CONNECTOR.getLocalName());
         writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
         RemoteTransportDefinition.SOCKET_BINDING.marshallAsAttribute(property.getValue(), writer);
         writeTransportParam(writer, property.getValue().get(PARAM));
         writer.writeEndElement();
       }
     }
     if (node.hasDefined(IN_VM_CONNECTOR)) {
       for (final Property property : node.get(IN_VM_CONNECTOR).asPropertyList()) {
         writer.writeStartElement(Element.IN_VM_CONNECTOR.getLocalName());
         writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
         InVMTransportDefinition.SERVER_ID.marshallAsAttribute(property.getValue(), writer);
         writeTransportParam(writer, property.getValue().get(PARAM));
         writer.writeEndElement();
       }
     }
     if (node.hasDefined(CONNECTOR)) {
       for (final Property property : node.get(CONNECTOR).asPropertyList()) {
         writer.writeStartElement(Element.CONNECTOR.getLocalName());
         writer.writeAttribute(Attribute.NAME.getLocalName(), property.getName());
         GenericTransportDefinition.SOCKET_BINDING.marshallAsElement(property.getValue(), writer);
         CommonAttributes.FACTORY_CLASS.marshallAsElement(property.getValue(), writer);
         writeTransportParam(writer, property.getValue().get(PARAM));
         writer.writeEndElement();
       }
     }
     writer.writeEndElement();
     writeNewLine(writer);
   }
 }