[wildfly-dev] Need write to standalone.xml after parsing

Stan Silvert ssilvert at redhat.com
Wed Aug 3 09:53:48 EDT 2016


The Keycloak server is currently configured via a keycloak-server.json 
file.  We are converting this to configuration through 
standalone.xml/domain.xml.

To automatically upgrade, I need to read keycloak-server.json and write 
back to standalone.xml.  I can easily add the operations to do this at 
parse time.  The parser has this method:

@Override
public void readElement(final XMLExtendedStreamReader reader, final 
List<ModelNode> list) throws XMLStreamException

So one way to do this is to parse keycloak-server.json at this time and 
add operations to the list.

That puts everything into the management model.  But nothing will be 
written to standalone.xml unless someone manually does a write operation 
from CLI.

So my question is, what is the best way to accomplish this?  Is there a 
good, safe way to manually trigger a flush to standalone.xml at this 
point or at some later point during startup?

Stan


More information about the wildfly-dev mailing list