Example #1
0
    private void parseDefaultWorkManager(
        final XMLExtendedStreamReader reader,
        final ModelNode parentAddress,
        final List<ModelNode> list,
        final ModelNode node)
        throws XMLStreamException {

      while (reader.hasNext() && reader.nextTag() != END_ELEMENT) {

        final Element element = Element.forName(reader.getLocalName());

        switch (element) {
          case LONG_RUNNING_THREADS:
            {
              ThreadsParser.getInstance()
                  .parseBoundedQueueThreadPool(
                      reader, parentAddress, list, THREAD_POOL, LONG_RUNNING_THREADS);
              break;
            }
          case SHORT_RUNNING_THREADS:
            {
              ThreadsParser.getInstance()
                  .parseBoundedQueueThreadPool(
                      reader, parentAddress, list, THREAD_POOL, SHORT_RUNNING_THREADS);
              break;
            }
          default:
            throw unexpectedElement(reader);
        }
      }
      // AS7-1352 The "blocking" attribute for the JCA thread pools should be ignored as it should
      // always be true.
      for (ModelNode op : list) {
        if (op.hasDefined(BLOCKING)) {
          op.get(BLOCKING).set(Boolean.TRUE);
        }
      }
      // Handle elements
      requireNoContent(reader);
    }
Example #2
0
 private void writeDefaultWorkManager(XMLExtendedStreamWriter writer, ModelNode node)
     throws XMLStreamException {
   if (node.hasDefined(THREAD_POOL)) {
     writer.writeStartElement(Element.DEFAULT_WORKMANAGER.getLocalName());
     for (Property prop : node.get(THREAD_POOL).asPropertyList()) {
       if (LONG_RUNNING_THREADS.equals(prop.getName())) {
         ThreadsParser.getInstance()
             .writeBoundedQueueThreadPool(
                 writer, prop.getValue(), Element.LONG_RUNNING_THREADS.getLocalName(), false);
       }
       if (SHORT_RUNNING_THREADS.equals(prop.getName())) {
         ThreadsParser.getInstance()
             .writeBoundedQueueThreadPool(
                 writer, prop.getValue(), Element.SHORT_RUNNING_THREADS.getLocalName(), false);
       }
     }
     writer.writeEndElement();
   }
   // if (hasAnyOf(node, DEFAULT_WORKMANAGER_SHORT_RUNNING_THREAD_POOL,
   // DEFAULT_WORKMANAGER_LONG_RUNNING_THREAD_POOL)) {
   // writer.writeStartElement(Element.DEFAULT_WORKMANAGER.getLocalName());
   // if
   // (node.hasDefined(DEFAULT_WORKMANAGER_LONG_RUNNING_THREAD_POOL)) {
   // writer.writeStartElement(Element.LONG_RUNNING_THREADS.getLocalName());
   // (new NewThreadsParser()).writeThreadsElement(writer,
   // node.get(DEFAULT_WORKMANAGER_THREADS, LONG_RUNNING_THREADS).as);
   // writer.writeEndElement();
   // }
   // if
   // (node.hasDefined(DEFAULT_WORKMANAGER_SHORT_RUNNING_THREAD_POOL))
   // {
   // writer.writeStartElement(Element.SHORT_RUNNING_THREADS.getLocalName());
   // (new NewThreadsParser()).writeThreadsElement(writer,
   // node.get(DEFAULT_WORKMANAGER_THREADS, SHORT_RUNNING_THREADS));
   // writer.writeEndElement();
   // }
   //
   // writer.writeEndElement();
   // }
 }