Search in sources :

Example 1 with Operations

use of org.jboss.as.controller.client.helpers.Operations in project wildfly by wildfly.

the class TestLogHandlerSetupTask method tearDown.

@Override
public void tearDown(ManagementClient managementClient, String containerId) throws Exception {
    Path logPath = LoggingUtil.getLogPath(managementClient, "file-handler", getHandlerName());
    // Remove the loggers and handler
    final Operations.CompositeOperationBuilder builder = Operations.CompositeOperationBuilder.create();
    ModelNode removeOp;
    while ((removeOp = removeOps.pollFirst()) != null) {
        builder.addStep(removeOp);
    }
    applyUpdate(managementClient.getControllerClient(), builder.build(), false);
    // remove file, note this needs to be done after the operations have been executed as we need to ensure that
    // no FD's are open. This can be an issue on Windows.
    Files.deleteIfExists(logPath);
}
Also used : Path(java.nio.file.Path) ModelNode(org.jboss.dmr.ModelNode) Operations(org.jboss.as.controller.client.helpers.Operations)

Aggregations

Path (java.nio.file.Path)1 Operations (org.jboss.as.controller.client.helpers.Operations)1 ModelNode (org.jboss.dmr.ModelNode)1