Source:
protected void execute(final OperationContext context, final ModelNode operation, final InstallationManager installationManager, final String patchStream) throws OperationFailedException { if (installationManager.requiresRestart()) { throw PatchLogger.ROOT_LOGGER.serverRequiresRestart(); } final ModelNode patchIdNode = PatchResourceDefinition.PATCH_ID.resolveModelAttribute(context, operation); if(!patchIdNode.isDefined()) { throw ControllerLogger.ROOT_LOGGER.nullNotAllowed(PatchResourceDefinition.PATCH_ID.getName()); } final String patchId = patchIdNode.asString(); final boolean rollbackTo = PatchResourceDefinition.ROLLBACK_TO.resolveModelAttribute(context, operation).asBoolean(); final boolean restoreConfiguration = PatchResourceDefinition.RESET_CONFIGURATION.resolveModelAttribute(context, operation).asBoolean(); final PatchTool runner = PatchTool.Factory.create(installationManager); final ContentVerificationPolicy policy = PatchTool.Factory.create(operation); try { final PatchingResult result = runner.rollback(patchStream, patchId, policy, rollbackTo, restoreConfiguration); installationManager.restartRequired(); context.restartRequired(); context.completeStep(new OperationContext.ResultHandler() { @Override public void handleResult(OperationContext.ResultAction resultAction, OperationContext context, ModelNode operation) { if(resultAction == OperationContext.ResultAction.KEEP) { result.commit(); } else { installationManager.clearRestartRequired(); context.revertRestartRequired(); result.rollback(); } } }); } catch (PatchingException e) { final ModelNode failureDescription = context.getFailureDescription(); PatchOperationTarget.formatFailedResponse(e, failureDescription); installationManager.clearRestartRequired(); } finally { } }

Target:
protected void execute(final OperationContext context, final ModelNode operation, final InstallationManager installationManager, final String patchStream) throws OperationFailedException { if (installationManager.requiresRestart()) { throw PatchLogger.ROOT_LOGGER.serverRequiresRestart(); } final String patchId = PatchResourceDefinition.PATCH_ID.resolveModelAttribute(context, operation).asString(); final boolean rollbackTo = PatchResourceDefinition.ROLLBACK_TO.resolveModelAttribute(context, operation).asBoolean(); final boolean restoreConfiguration = PatchResourceDefinition.RESET_CONFIGURATION.resolveModelAttribute(context, operation).asBoolean(); final PatchTool runner = PatchTool.Factory.create(installationManager); final ContentVerificationPolicy policy = PatchTool.Factory.create(operation); try { final PatchingResult result = runner.rollback(patchStream, patchId, policy, rollbackTo, restoreConfiguration); installationManager.restartRequired(); context.restartRequired(); context.completeStep(new OperationContext.ResultHandler() { @Override public void handleResult(OperationContext.ResultAction resultAction, OperationContext context, ModelNode operation) { if(resultAction == OperationContext.ResultAction.KEEP) { result.commit(); } else { installationManager.clearRestartRequired(); context.revertRestartRequired(); result.rollback(); } } }); } catch (PatchingException e) { final ModelNode failureDescription = context.getFailureDescription(); PatchOperationTarget.formatFailedResponse(e, failureDescription); installationManager.clearRestartRequired(); } finally { } }