// Create the management client
ModelControllerClient client = ModelControllerClient.Factory.create("localhost", 9990);
// Create the operation request
ModelNode op = new ModelNode();
// Set the operation
op.get("operation").set("read-resource");
// Set the address
ModelNode address = op.get("address");
address.add("subsystem", "undertow");
address.add("server", "default-server");
address.add("http-listener", "default");
// Execute the operation and manipulate the result
ModelNode returnVal = client.execute(op);
System.out.println("Outcome: " + returnVal.get("outcome").toString());
System.out.println("Result: " + returnVal.get("result").toString());
// Close the client
client.close();
// Create the management client
ModelControllerClient client = ModelControllerClient.Factory.create("localhost", 9990);
// Create the operation request
ModelNode op = new ModelNode();
// Set the operation
op.get("operation").set("read-resource");
// Set the address
ModelNode address = op.get("address");
address.add("subsystem", "undertow");
address.add("server", "default-server");
address.add("http-listener", "default");
// Execute the operation and manipulate the result
ModelNode returnVal = client.execute(op);
System.out.println("Outcome: " + returnVal.get("outcome").toString());
System.out.println("Result: " + returnVal.get("result").toString());
// Close the client
client.close();
Copy to ClipboardCopied!Toggle word wrapToggle overflow