<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Aug 3, 2016 at 2:02 PM, Stan Silvert <span dir="ltr">&lt;<a href="mailto:ssilvert@redhat.com" target="_blank">ssilvert@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
    <div>On 8/3/2016 2:49 PM, Ken Wills wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div class="gmail_extra">
          <div class="gmail_quote">On Wed, Aug 3, 2016 at 8:53 AM, Stan
            Silvert <span dir="ltr">&lt;<a href="mailto:ssilvert@redhat.com" target="_blank">ssilvert@redhat.com</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The Keycloak server is
              currently configured via a keycloak-server.json<br>
              file.  We are converting this to configuration through<br>
              standalone.xml/domain.xml.<br>
              <br>
              To automatically upgrade, I need to read
              keycloak-server.json and write<br>
              back to standalone.xml.  I can easily add the operations
              to do this at<br>
              parse time.  The parser has this method:<br>
              <br>
              @Override<br>
              public void readElement(final XMLExtendedStreamReader
              reader, final<br>
              List&lt;ModelNode&gt; list) throws XMLStreamException<br>
              <br>
              So one way to do this is to parse keycloak-server.json at
              this time and<br>
              add operations to the list.<br>
              <br>
              That puts everything into the management model.  But
              nothing will be<br>
              written to standalone.xml unless someone manually does a
              write operation<br>
              from CLI.<br>
              <br>
            </blockquote>
            <div><br>
            </div>
            <div>Not sure if this is exactly what you&#39;re looking for,
              but subsystems / extensions usually register an
              XMLElementWriter for themselves to handle this, see for
              exmaple:</div>
            <div><br>
            </div>
            <div><a href="https://github.com/wildfly/wildfly/blob/9de9217e0106da10c7d05228bcf0559c81b6042c/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanExtension.java#L52" target="_blank">https://github.com/wildfly/wildfly/blob/9de9217e0106da10c7d05228bcf0559c81b6042c/clustering/infinispan/extension/src/main/java/org/jboss/as/clustering/infinispan/subsystem/InfinispanExtension.java#L52</a><br>
            </div>
            <div><br>
            </div>
            <div>Ken </div>
          </div>
          <br>
        </div>
      </div>
    </blockquote></div></div>
    My problem is that the XMLElementWriter is never called during
    startup.   I would like it to be called after the management model
    is read from standalone.xml but before deployments are handled.<br>
  </div>

</blockquote></div><br></div><div class="gmail_extra">Hmm. Not sure about that one, I&quot;ll have a look. </div><div class="gmail_extra"><br></div><div class="gmail_extra">PS: Sorry for replying only to you, I mean&#39;t to include the list too. [cc: wildfly-dev added back.]</div><div class="gmail_extra"><br></div></div>