示例#1
0
 private void writeTransport(
     XMLExtendedStreamWriter writer, GlobalConfiguration globalConfiguration)
     throws XMLStreamException {
   TransportConfiguration transport = globalConfiguration.transport();
   AttributeSet attributes = transport.attributes();
   if (attributes.isModified()) {
     writer.writeStartElement(Element.TRANSPORT);
     attributes.write(writer, TransportConfiguration.CLUSTER_NAME, Attribute.CLUSTER);
     attributes.write(writer, TransportConfiguration.MACHINE_ID, Attribute.MACHINE_ID);
     attributes.write(writer, TransportConfiguration.RACK_ID, Attribute.RACK_ID);
     if (transport.siteId() != null) {
       attributes.write(writer, TransportConfiguration.SITE_ID, Attribute.SITE);
     } else if (globalConfiguration.sites().localSite() != null) {
       writer.writeAttribute(Attribute.SITE, globalConfiguration.sites().localSite());
     }
     attributes.write(writer, TransportConfiguration.NODE_NAME, Attribute.NODE_NAME);
     TypedProperties properties = globalConfiguration.transport().properties();
     if (properties.containsKey("stack")) {
       writer.writeAttribute(Attribute.STACK, properties.getProperty("stack"));
     }
     if (transport.remoteCommandThreadPool().threadPoolFactory() != null) {
       writer.writeAttribute(Attribute.REMOTE_COMMAND_EXECUTOR, "remote-command-pool");
     }
     if (transport.transportThreadPool().threadPoolFactory() != null) {
       writer.writeAttribute(Attribute.EXECUTOR, "transport-pool");
     }
     writer.writeEndElement();
   }
 }